Question: legChrom = NA doesn't hide legend
gravatar for jordi.planells
27 days ago by
jordi.planells0 wrote:

Hi all! I am using the package chromPlot but I'm having some problems with the legend placement. According to chromPlot manual:

(...)two options: 1. setting the legChrom argument to an arbitrary chromosome name 2. setting the legChrom to NA to omit plotting a legend.

First showing the structure of my data:

> head(data)
  Chrom    Start      End         Group
1 chr2L  1573892  1573953  SimpleRepeat
2 chr2L  1589915  1589962 LowComplexity
3 chr2L  1596249  1596279  SimpleRepeat
4 chr2L 14803935 14804210           LTR
5  chrX    50787    55026          LINE
6  chrX    57732    63810          LINE

Here's my code:

chromPlot(gaps = gap_file, bands = data, title = "My title", legChrom = NA)

Here's my sessioninfo()

> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/

 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=sv_SE.UTF-8       
 [7] LC_PAPER=sv_SE.UTF-8       LC_NAME=C                  LC_ADDRESS=C              

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets  methods  
[9] base     

other attached packages:
[1] chromPlot_1.12.0     GenomicRanges_1.36.0 GenomeInfoDb_1.20.0  IRanges_2.18.1      
[5] S4Vectors_0.22.0     BiocGenerics_0.30.0  biomaRt_2.40.0       dplyr_0.8.1         

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1             XVector_0.24.0         pillar_1.4.1          
 [4] compiler_3.6.0         zlibbioc_1.30.0        prettyunits_1.0.2     
 [7] bitops_1.0-6           tools_3.6.0            progress_1.2.2        
[10] digest_0.6.19          bit_1.1-14             RSQLite_2.1.1         
[13] memoise_1.1.0          tibble_2.1.3           pkgconfig_2.0.2       
[16] rlang_0.4.0            DBI_1.0.0              rstudioapi_0.10       
[19] xfun_0.8               GenomeInfoDbData_1.2.1 httr_1.4.0            
[22] stringr_1.4.0          knitr_1.23             hms_0.4.2             
[25] bit64_0.9-7            tidyselect_0.2.5       glue_1.3.1            
[28] Biobase_2.44.0         R6_2.4.0               AnnotationDbi_1.46.0  
[31] XML_3.98-1.20          purrr_0.3.2            blob_1.1.1            
[34] magrittr_1.5           assertthat_0.2.1       stringi_1.4.3         
[37] RCurl_1.95-4.12        crayon_1.3.4

And finally I attach the plot produced: enter image description here

Basically, I would like to either move the legend to the bottom of Y chromosome (ie: legChrom = "Y") or eliminate the legend (legChrom = NA) and add it after with legend(). However none of these options work and the legend lies in the same position always (possible bug?)

Thanks in advance for your help!


chromplot • 70 views
ADD COMMENTlink written 27 days ago by jordi.planells0
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 256 users visited in the last hour