EnhancedVolcano plot - labels
1
0
Entering edit mode
Johannes • 0
@086b086a
Last seen 2 days ago
United Kingdom

I am using the great EnhancedVolcano package for creating Volcano plots and have 2 tiny questions:

  1. Is it possible to put in a preselected set of labels for the argument selectLab? I have created a vector and all containing labels are in the lab argument, but it does not seem to work.
  2. According to the vignette even when using selectLab only variables passing the cut offs are labeled. But in my case it lables all of them. What am I doing wrong?

Thank you very much for your help!


Checkpoints <- as.vector(list_genes$IMMUNE.CHECKPOINTS.)
Checkpoints
Checkpoints <- Checkpoints[-c(15:268)] 

EnhancedVolcano(res,
                lab = rownames(res),
                x = 'log2FoldChange',
                y = 'padj',
                selectLab = Checkpoints,
                xlab = bquote(~Log[2]~ 'fold change'),
                pCutoff = 0.05,
                pCutoffCol = 'padj',
                FCcutoff = 0.75,
                pointSize = 3.0,
                labSize = 4.0)

enter image description here

sessionInfo( )

R version 4.1.1 (2021-08-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.5.2

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale:
[1] de_DE.UTF-8/de_DE.UTF-8/de_DE.UTF-8/C/de_DE.UTF-8/de_DE.UTF-8

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

other attached packages:
 [1] EnhancedVolcano_1.10.0      ggrepel_0.9.1              
 [3] pheatmap_1.0.12             ggpubr_0.4.0               
 [5] ggplot2_3.3.5               RColorBrewer_1.1-2         
 [7] DESeq2_1.32.0               SummarizedExperiment_1.22.0
 [9] Biobase_2.52.0              MatrixGenerics_1.4.3       
[11] matrixStats_0.60.1          GenomicRanges_1.44.0       
[13] GenomeInfoDb_1.28.4         IRanges_2.26.0             
[15] S4Vectors_0.30.0            BiocGenerics_0.38.0        

loaded via a namespace (and not attached):
 [1] bitops_1.0-7           bit64_4.0.5            ash_1.0-15            
 [4] httr_1.4.2             tools_4.1.1            backports_1.2.1       
 [7] utf8_1.2.2             R6_2.5.1               vipor_0.4.5           
[10] KernSmooth_2.23-20     DBI_1.1.1              colorspace_2.0-2      
[13] withr_2.4.2            ggrastr_0.2.3          tidyselect_1.1.1      
[16] ggalt_0.4.0            extrafontdb_1.0        bit_4.0.4             
[19] curl_4.3.2             compiler_4.1.1         DelayedArray_0.18.0   
[22] labeling_0.4.2         scales_1.1.1           proj4_1.0-10.1        
[25] genefilter_1.74.0      digest_0.6.27          foreign_0.8-81        
[28] rio_0.5.27             XVector_0.32.0         pkgconfig_2.0.3       
[31] extrafont_0.17         maps_3.3.0             fastmap_1.1.0         
[34] rlang_0.4.11           readxl_1.3.1           rstudioapi_0.13       
[37] RSQLite_2.2.8          generics_0.1.0         farver_2.1.0          
[40] BiocParallel_1.26.2    dplyr_1.0.7            zip_2.2.0             
[43] car_3.0-11             RCurl_1.98-1.4         magrittr_2.0.1        
[46] GenomeInfoDbData_1.2.6 Matrix_1.3-4           ggbeeswarm_0.6.0      
[49] Rcpp_1.0.7             munsell_0.5.0          fansi_0.5.0           
[52] abind_1.4-5            lifecycle_1.0.0        stringi_1.7.4         
[55] carData_3.0-4          MASS_7.3-54            zlibbioc_1.38.0       
[58] grid_4.1.1             blob_1.2.2             forcats_0.5.1         
[61] crayon_1.4.1           lattice_0.20-44        Biostrings_2.60.2     
[64] haven_2.4.3            splines_4.1.1          annotate_1.70.0       
[67] hms_1.1.0              KEGGREST_1.32.0        locfit_1.5-9.4        
[70] pillar_1.6.2           ggsignif_0.6.2         geneplotter_1.70.0    
[73] XML_3.99-0.7           glue_1.4.2             data.table_1.14.0     
[76] BiocManager_1.30.16    png_0.1-7              vctrs_0.3.8           
[79] Rttf2pt1_1.3.9         cellranger_1.1.0       gtable_0.3.0          
[82] purrr_0.3.4            tidyr_1.1.3            assertthat_0.2.1      
[85] cachem_1.0.6           openxlsx_4.2.4         xtable_1.8-4          
[88] broom_0.7.9            rstatix_0.7.0          survival_3.2-13       
[91] tibble_3.1.4           beeswarm_0.4.0         AnnotationDbi_1.54.1  
[94] memoise_2.0.0          ellipsis_0.3.2
EnhancedVolcano • 191 views
ADD COMMENT
0
Entering edit mode
@kevin
Last seen 2 hours ago
Republic of Ireland

Hi Johannes,

Is it possible to put in a preselected set of labels for the argument selectLab? I have created a vector and all containing labels are in the lab argument, but it does not seem to work.

Can you help me to better understand this problem? - how do you define "it does not seem to work"? You can show examples from rownames(res) and Checkpoints, and, also, please show the output of str(res) and str(Checkpoints).

According to the vignette even when using selectLab only variables passing the cut offs are labeled. But in my case it lables all of them. What am I doing wrong?

The default is to label everything, irrespective of statistical significance. I can see the conflicting line in the vignette that would make one think otherwise - I will modify this. Thank you

Kevin

ADD COMMENT
0
Entering edit mode

Hi Kevin,

thank you so much for getting back to me. To clarify my problem: I would like to feed a set of genes to selectLab, rather than entering every single name. All names of "Checkpoints" are contained in rownames. An example auf rownames(res): [1] "A2M" "AADAT" "ABCB1" "ABCB11"
[5] "ABCC2" "ABCC6" "ABCF1" "ABCG2"
[9] "ABHD1" "ABL1" "ABL2" "ACKR3"
[13] "ACP6" "ACTG2" "ACTR3B" "ADA"
[17] "ADAM17" "ADCY1" "ADD2" "ADGRE5"
[21] "ADORA2A" "ADORA2B" "ADRB2" "AGER"
[25] "AHR" "AICDA" "AIF1" "AKT1"
[29] "AKT3" "ALCAM" "ALOX15B" "ALOX5"

Checkpoints [1] "ADORA2A " "CD160 " "CD276 " "CD44 " "CD52 " "CD8A "
[7] "HHLA2 " "KIR3DL1 " "KLRD1 " "MS4A1 " "NRP1 " "TIGIT "
[13] "TNFRSF25 " "TNFRSF8 "

str(rownames) Formal class 'standardGeneric' [package "methods"] with 8 slots ..@ .Data :function (x, do.NULL = TRUE, prefix = "row")
..@ generic : chr "rownames" .. ..- attr(, "package")= chr "BiocGenerics" ..@ package : chr "BiocGenerics" ..@ group : list() ..@ valueClass: chr(0) ..@ signature : chr "x" ..@ default :Formal class 'derivedDefaultMethod' [package "methods"] with 4 slots .. .. ..@ .Data :function (x, do.NULL = TRUE, prefix = "row")
.. .. ..@ target :Formal class 'signature' [package "methods"] with 3 slots .. .. .. .. ..@ .Data : chr "ANY" .. .. .. .. ..@ names : chr "x" .. .. .. .. ..@ package: chr "methods" .. .. ..@ defined:Formal class 'signature' [package "methods"] with 3 slots .. .. .. .. ..@ .Data : chr "ANY" .. .. .. .. ..@ names : chr "x" .. .. .. .. ..@ package: chr "methods" .. .. ..@ generic: chr "rownames" .. .. .. ..- attr(
, "package")= chr "base" ..@ skeleton : language (new("derivedDefaultMethod", .Data = function (x, do.NULL = TRUE, prefix = "row") { ...

str(Checkpoints) chr [1:14] "ADORA2A " "CD160 " "CD276 " "CD44 " "CD52 " "CD8A " "HHLA2 " ...

Thanks

ADD REPLY
0
Entering edit mode

I just coincidentally saw this post, but I noticed that all 14 symbols in Checkpoints do contain a trailing withe space, while the row names of res do not! So there won't be any match.... you may want to solve this, and check again. You may want to have a look the the 'base' function trimws (by typing ?trimws).

ADD REPLY
0
Entering edit mode

Wow, thank you so much for the sharp observation. I will look into it.

ADD REPLY
0
Entering edit mode

Thanks Guido

ADD REPLY

Login before adding your answer.

Traffic: 333 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