Question: How to add single gene name in volcano plot ?
gravatar for Mike
3.5 years ago by
Mike1.7k 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 • 4.0k views
ADD COMMENTlink modified 20 months ago by zx87549.9k • written 3.5 years ago by Mike1.7k
gravatar for WouterDeCoster
3.5 years ago by
WouterDeCoster45k 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 3.5 years ago • written 3.5 years ago by WouterDeCoster45k
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: 1840 users visited in the last hour