kevinblighe / EnhancedVolcano

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

selectLab option ends up visualizing numbers rather than the gene names #102

Closed sohitmiglani closed 2 years ago

sohitmiglani commented 2 years ago

Hi,

I'm trying to use the selectLab option to visualize only select gene names. This is what my code looks like:

options(repr.plot.width = 15, repr.plot.height = 10)

EnhancedVolcano::EnhancedVolcano(my_data, 
                                 lab = my_data$'gene_name' , 
                                 selectLab=target_genes,
                                 x = 'logFC', 
                                 y = 'padj',
                                 ylim=c(0,5),
                                 xlim=c(-2,2),
                                 pCutoff = 5e-2,
                                 FCcutoff = 0.4,
                                 xlab='Log2 Fold Change')

I have verified that target_genes is a vector that is a subset of the overall 'lab' that I feed into the volcano plot. But somehow, my output only has numbers. Here's an example:

Screen Shot 2022-03-29 at 12 20 54 PM

I am confused about where the numbers are coming from.

kevinblighe commented 2 years ago

Hi please check the encoding of my_data$gene_name - is it character? Also verify that those genes listed in target_genes are also present in my_data$'gene_name'.