YoannPa/methview.qc

Legends of devscore.heatmap() are not left aligned to each other

Closed this issue · 3 comments

Hi Yoann,

Describe the bug
When using the the function devscore.heatmap() with the argument annot.grps, and show.annot=TRUE (see code below), the produced legend to the right of the plot is currently aligned to the right.

To Reproduce

color1<-brewer.pal(6, "BrBG")
color2=brewer.pal(7, "YlOrRd" )
color3=brewer.pal(6, "PRGn")

all.probes.dev.plot<-devscore.heatmap(RnBSet = result, target=NULL, samples=result@pheno[,1], show.annot = TRUE, draw=TRUE, verbose=TRUE, 
                                      annot.grps = list("Batch" = result@pheno$Batch, "Sample Plate" = result@pheno$Sample_Plate, "TMM" = result@pheno$TMM), 
                                      annot.pal = list(color1, color2, color3))

You can find the full script in my dkfz directory ..../../../data/rathgeber/scripts/neuroblastoma/Methylation_Analysis/Quality_Control_Methview.qc_Package_1.R

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Desktop (please complete the following information):

sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS: /usr/lib64/libblas.so.3.4.2
LAPACK: /usr/lib64/liblapack.so.3.4.2

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] colorRamps_2.3 RnBeads.hg19_1.20.0 RColorBrewer_1.1-2
[4] colorspace_2.0-2 ggsci_2.9 methview.qc_0.0.27
[7] BiocompR_0.0.156 RnBeads_2.6.0 plyr_1.8.6
[10] methylumi_2.34.0 minfi_1.34.0 bumphunter_1.30.0
[13] locfit_1.5-9.4 iterators_1.0.13 foreach_1.5.1
[16] Biostrings_2.56.0 XVector_0.28.0 SummarizedExperiment_1.18.2
[19] DelayedArray_0.14.1 FDb.InfiniumMethylation.hg19_2.2.0 org.Hs.eg.db_3.11.4
[22] TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2 GenomicFeatures_1.40.1 AnnotationDbi_1.50.3
[25] reshape2_1.4.4 scales_1.1.1 Biobase_2.48.0
[28] illuminaio_0.30.0 matrixStats_0.60.0 limma_3.44.3
[31] gridExtra_2.3 gplots_3.1.1 fields_12.5
[34] viridis_0.6.1 viridisLite_0.4.0 spam_2.7-0
[37] dotCall64_1.0-1 ff_4.0.4 bit_4.0.4
[40] cluster_2.1.0 MASS_7.3-51.5 GenomicRanges_1.40.0
[43] GenomeInfoDb_1.24.2 IRanges_2.22.2 S4Vectors_0.26.1
[46] BiocGenerics_0.34.0 data.table_1.14.0 ggplot2_3.3.5

loaded via a namespace (and not attached):
[1] parallelDist_0.2.4 BiocFileCache_1.12.1 splines_4.0.0 BiocParallel_1.22.0
[5] digest_0.6.27 fansi_0.5.0 magrittr_2.0.1 memoise_2.0.0
[9] tzdb_0.1.2 fastcluster_1.2.3 readr_2.0.1 annotate_1.66.0
[13] RcppParallel_5.1.4 askpass_1.1 siggenes_1.62.0 prettyunits_1.1.1
[17] ggrepel_0.9.1 blob_1.2.2 rappdirs_0.3.3 dplyr_1.0.7
[21] crayon_1.4.1 RCurl_1.98-1.3 genefilter_1.70.0 GEOquery_2.56.0
[25] survival_3.1-12 glue_1.4.2 gtable_0.3.0 zlibbioc_1.34.0
[29] Rhdf5lib_1.10.1 maps_3.3.0 HDF5Array_1.16.1 DBI_1.1.1
[33] rngtools_1.5 Rcpp_1.0.7 xtable_1.8-4 progress_1.2.2
[37] mclust_5.4.7 preprocessCore_1.50.0 httr_1.4.2 ellipsis_0.3.2
[41] farver_2.1.0 pkgconfig_2.0.3 reshape_0.8.8 XML_3.99-0.6
[45] dbplyr_2.1.1 utf8_1.2.2 labeling_0.4.2 tidyselect_1.1.1
[49] rlang_0.4.11 munsell_0.5.0 tools_4.0.0 cachem_1.0.5
[53] generics_0.1.0 RSQLite_2.2.7 ggdendro_0.1.22 stringr_1.4.0
[57] fastmap_1.1.0 bit64_4.0.5 beanplot_1.2 caTools_1.18.2
[61] scrime_1.3.5 purrr_0.3.4 nlme_3.1-147 doRNG_1.8.2
[65] nor1mix_1.3-0 xml2_1.3.2 biomaRt_2.44.4 compiler_4.0.0
[69] rstudioapi_0.13 curl_4.3.2 tibble_3.1.3 stringi_1.7.3
[73] lattice_0.20-41 Matrix_1.2-18 multtest_2.44.0 vctrs_0.3.8
[77] pillar_1.6.2 lifecycle_1.0.0 bitops_1.0-7 rtracklayer_1.48.0
[81] R6_2.5.0 KernSmooth_2.23-16 codetools_0.2-16 gtools_3.9.2
[85] assertthat_0.2.1 rhdf5_2.32.4 openssl_1.4.4 withr_2.4.2
[89] GenomicAlignments_1.24.0 Rsamtools_2.4.0 GenomeInfoDbData_1.2.3 hms_1.1.0
[93] quadprog_1.5-8 tidyr_1.1.3 base64_2.0 DelayedMatrixStats_1.10.1

Additional context
I believe this is probably the same cause as for #12 and should be be fixable the same way

Hi @AnjaCaRa !

Yes it must be the same issue. So I will make the same changes on devscore.heatmap() to allow users access legend theme.
The same theme_legend = theme(legend.justification = c(0, 1)) should also work after I will have made these changes.

I keep you in touch.

The latest version of methview.qc contains the necessary changes.
Please install methview.qc 0.0.28 and use the option theme_legend with the same value as in #12

Issue solved :)