kevinblighe / EnhancedVolcano

Publication-ready volcano plots with enhanced colouring and labeling
397 stars 81 forks source link

labs displayed as numbers instead of gene ID #89

Closed rcnava closed 2 years ago

rcnava commented 2 years ago

I've gotten nice Enhancedvolcano plots using DESEQ2 results but I have filtered out some genes and created a new data frame. When I run Enhancedvolcano on my new data frame, the gene labels show up as row numbers rather than the gene ID. I've tried lab = rownames(filtered$Row.names) but it produces an error.

Here is my data frame:

`> filtered <-as.data.frame(filtered)

filtered Row.names baseMean log2FoldChange lfcSE stat pvalue padj 1 SOX4 391.424101 -1.7466982 0.4070579 -4.291032 1.778448e-05 0.02237984 2 CXCR4 113.819177 -1.7069539 0.4698094 -3.633290 2.798301e-04 0.06870368 3 ELOVL5 634.962488 -0.6960963 0.2035681 -3.419476 6.274186e-04 0.08661427 4 PHLDA1 174.395015 -1.5355330 0.4531562 -3.388529 7.026867e-04 0.08382819 5 SQLE 69.405160 -1.0690695 0.3264271 -3.275063 1.056383e-03 0.11493507 6 RASSF2 270.603503 -1.3877872 0.4295184 -3.231031 1.233447e-03 0.10950127 7 MMP14 1043.700489 -1.7331442 0.5712854 -3.033763 2.415245e-03 0.18018802 8 STARD4 112.274050 -1.2001104 0.3965759 -3.026181 2.476640e-03 0.16288591 9 STK17B 151.821628 -0.6857010 0.2269948 -3.020778 2.521258e-03 0.14497378 10 ELMO1 237.205439 -0.9083841 0.3078106 -2.951114 3.166303e-03 0.15632493`

EnhancedVolcano(toptable = filtered, lab = rownames(filtered), x = 'log2FoldChange', y = 'pvalue', pCutoff = 0.01, FCcutoff = .5, xlim = c(-6, 6), ylim = c(-6, 6))

image

Thank you for your help!

rcnava commented 2 years ago

Something about the column header 'Row.names' was producing this result. I renamed the header to 'gene' then ran lab = data.frame$gene and it worked.