Question: highlighting specific genes (from a user-supplied list) in a Volcano plot in R
1
gravatar for Eskimo
16 months ago by
Eskimo90
Eskimo90 wrote:

I've generated a volcano plot using DeSeq2 results and would like to specifically highlight a subset of genes by providing a list of gene IDs

Dataset$condition <- relevel(Dataset$condition, "Ctrl")
res <- lfcShrink(DatasetProcessed, contrast=c("condition","Treat","Ctrl")) 
with(res, plot(log2FoldChange, -log10(pvalue), pch=16, cex=0.6, main="Volcano plot", xlim=c(-5,5)))

Given a list of geneIDs (corresponding to IDs in res) that I have converted into a vector, how can I then highlight these in the volcano plot?

gene_list <- scan("genelist.txt", what="", sep="\n") 
gene_list <- as.vector(gene_list)
volcano plot deseq2 R • 1000 views
ADD COMMENTlink modified 16 months ago • written 16 months ago by Eskimo90

How to add single gene name in volcano plot ?

ADD REPLYlink written 16 months ago by genomax70k
6
gravatar for Eskimo
16 months ago by
Eskimo90
Eskimo90 wrote:

As always seems to be the case, I figured out the answer five minutes after asking the question...

with(res, plot(log2FoldChange, -log10(pvalue), pch=16, cex=0.6, main="Volcano plot", xlim=c(-5,5))) 
gene_list <- scan("genelist.txt", what="", sep="\n")
gene_list <- as.vector(gene_list) 
with(subset(res, rownames(res) %in% gene_list), points(log2FoldChange, -log10(pvalue), pch=20, col="orange"))

Hopefully this will help someone else down the line

ADD COMMENTlink written 16 months ago by Eskimo90
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2173 users visited in the last hour