How can I remove the row and column labels/names in the plot() or dba.plotHeatmap() while plotting correlation matrix using diffbind?
1
0
Entering edit mode
researcher • 0
@researcher-20723
Last seen 2.4 years ago

Hi I am using DiffBind's dba.plotHeatmap() or just plot() to plot a correlation matrix between the peak calls.

For my correlation matrix I don't want to have the axis labels and thus used the given command

plot(DBdata,labRow = NULL, labCol = NULL)

but getting the following error:

Error in heatmap.3(domap, labCol = collab, col = cols, trace = "none",  : 
  formal argument "labRow" matched by multiple actual arguments

For details you can visit this page for DiffBind [source core.R][1] which also incorporated heatmap.3().

Can anyone help me in this regard? Thanks in advance.

Also have a look of my sessionInfo().

sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /usr/local/intel/compilers_and_libraries_2019.1.144/linux/mkl/lib/intel64_lin/libmkl_rt.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] 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   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] ggplot2_3.2.1               DiffBind_2.13.0            
 [3] SummarizedExperiment_1.15.3 DelayedArray_0.11.2        
 [5] BiocParallel_1.19.0         matrixStats_0.54.0         
 [7] Biobase_2.45.0              GenomicRanges_1.37.12      
 [9] GenomeInfoDb_1.21.1         IRanges_2.19.10            
[11] S4Vectors_0.23.13           BiocGenerics_0.31.4        

loaded via a namespace (and not attached):
 [1] Category_2.51.0          bitops_1.0-6             bit64_0.9-7             
 [4] RColorBrewer_1.1-2       progress_1.2.2           httr_1.4.0              
 [7] Rgraphviz_2.29.0         tools_3.6.0              backports_1.1.4         
[10] R6_2.4.0                 KernSmooth_2.23-15       DBI_1.0.0               
[13] lazyeval_0.2.2           colorspace_1.4-1         withr_2.1.2             
[16] tidyselect_0.2.5         prettyunits_1.0.2        bit_1.1-14              
[19] curl_3.3                 compiler_3.6.0           graph_1.63.0            
[22] rtracklayer_1.45.1       checkmate_1.9.3          caTools_1.17.1.2        
[25] scales_1.0.0             genefilter_1.67.1        RBGL_1.61.0             
[28] askpass_1.1              rappdirs_0.3.1           stringr_1.4.0           
[31] digest_0.6.20            Rsamtools_2.1.2          AnnotationForge_1.27.0  
[34] XVector_0.25.0           pkgconfig_2.0.2          BSgenome_1.53.0         
[37] dbplyr_1.4.2             limma_3.41.5             rlang_0.4.0             
[40] RSQLite_2.1.1            GOstats_2.51.0           hwriter_1.3.2           
[43] gtools_3.8.1             dplyr_0.8.3              VariantAnnotation_1.31.3
[46] RCurl_1.95-4.12          magrittr_1.5             GO.db_3.8.2             
[49] GenomeInfoDbData_1.2.1   Matrix_1.2-17            Rcpp_1.0.2              
[52] munsell_0.5.0            yaml_2.2.0               stringi_1.4.3           
[55] edgeR_3.27.5             debugme_1.1.0            zlibbioc_1.31.0         
[58] gplots_3.0.1.1           BiocFileCache_1.9.1      grid_3.6.0              
[61] blob_1.2.0               ggrepel_0.8.1            gdata_2.18.0            
[64] crayon_1.3.4             lattice_0.20-38          splines_3.6.0           
[67] Biostrings_2.53.0        GenomicFeatures_1.37.1   annotate_1.63.0         
[70] hms_0.5.0                batchtools_0.9.11        locfit_1.5-9.1          
[73] zeallot_0.1.0            pillar_1.4.2             rjson_0.2.20            
[76] systemPipeR_1.19.1       base64url_1.4            biomaRt_2.41.7          
[79] XML_3.98-1.20            glue_1.3.1               ShortRead_1.43.0        
[82] latticeExtra_0.6-28      data.table_1.12.2        vctrs_0.2.0             
[85] gtable_0.3.0             openssl_1.4              purrr_0.3.2             
[88] amap_0.8-17              assertthat_0.2.1         xtable_1.8-4            
[91] survival_2.44-1.1        pheatmap_1.0.12          tibble_2.1.3            
[94] GenomicAlignments_1.21.2 AnnotationDbi_1.47.0     memoise_1.1.0           
[97] brew_1.0-6               GSEABase_1.47.0
Diffbind plot heatmap.3 • 717 views
ADD COMMENT
0
Entering edit mode

DiffBind package has neither the plot() function (or any methods that plot() dispatches to) nor does it have the heatmap.3 function.

Can you please edit your question and add the output of sessionInfo() (and also clean up the formatting a bit)?. What would also help are the outputs to find("heatmap.3") and find("plot").

ADD REPLY
0
Entering edit mode

Dear Ramrs, I have made the suggested changes to my post.

DiffBind do have dba.plotHeatmap() or just plot() to plot correlation matrix which uses heatmap.3 in background as mentioned in the source code core.R

I hope this will be helpful in seeking your help.

@Rory Stark , can you please help?

Thanks

ADD REPLY
0
Entering edit mode
Rory Stark ★ 4.4k
@rory-stark-5741
Last seen 3 days ago
CRUK, Cambridge, UK

As you say, DiffBind does indeed support plot(), which dispatches dba.plotHeatmap(), which internally invokes heatmap.3().

However dba.plotHeatmap() doesn't directly support plotting without row and column labels. There are two workarounds you may try.

One is to retrieve the correlation matrix and plot it yourself (using, for example, gplots::heatmap.2()). You can get the correlaiton heatmap as follows:

cor.matrix <- plot(DBdata)
heatmap.2(cor.matrix,labCol="",labRow="")

Alternatively, you can remove the labels from the DBA object and use the regular dba.plotHeatmap() function. You are advised do this using a separate copy of the object, as other plotting functions may not work properly without the labels:

temp.DB <- DBdata
temp.DB$class[DBA_ID,]="" 
plot(DBdata,ColAttributes=NULL)
ADD COMMENT
0
Entering edit mode

Thanks@Rory for answering, it really helped. I have another question how can I control colors for colAttributes as I have one as Factor and other as Condition. Can I use different colors for these two? Additionally, How can I have the color annotation for each factor and condition. Kindly help.

Thanks again!

ADD REPLY
0
Entering edit mode
ADD REPLY

Login before adding your answer.

Traffic: 336 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6