Question: How to add single gene name in volcano plot ?
gravatar for Mike
2.2 years ago by
Mike1.3k wrote:

Hi all,

I am using R script from Getting Genetics Done ( to generating Volcano plots but my problem is how to show particular single gene name on volcano plot without any condition (i.e foldchange or pvalue). I just want to highlight my gene name "WNT7A" on volcano plot.

It would be great help if someone help me how to modify following code:


I tried labs <- res$Gene[WNT7A]

but couldnt work...

This is original code from Getting Genetics Done:

res <- read.table("results.txt", header=TRUE)

# Make a basic volcano plot 
with(res, plot(log2FoldChange, -log10(pvalue), pch=20, main="Volcano plot", xlim=c(-2.5,2)))

# Add colored points: red if padj<0.05, orange of log2FC>1, green if both)
with(subset(res, padj<.05 ), points(log2FoldChange, -log10(pvalue), pch=20, col="red"))
with(subset(res, abs(log2FoldChange)>1), points(log2FoldChange, -log10(pvalue), pch=20, col="orange"))
with(subset(res, padj<.05 & abs(log2FoldChange)>1), points(log2FoldChange, -log10(pvalue), pch=20, col="green"))

# Label points with the textxy function from the calibrate plot
with(subset(res, padj<.05 & abs(log2FoldChange)>1), textxy(log2FoldChange, -log10(pvalue), labs=Gene, cex=.8))
volcano plot R • 2.7k views
ADD COMMENTlink modified 3 months ago by zx87548.2k • written 2.2 years ago by Mike1.3k
gravatar for WouterDeCoster
2.2 years ago by
WouterDeCoster40k wrote:

Perhaps I missed something, but it looks quite obvious to me:

with(subset(res, Gene == "WNT7A"), textxy(log2FoldChange, -log10(pvalue), labs=Gene, cex=.8))
ADD COMMENTlink modified 2.2 years ago • written 2.2 years ago by WouterDeCoster40k
Please log in to add an answer.


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