Question: How to add single gene name in volcano plot ?
gravatar for Mike
21 months 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 R • 2.2k views
ADD COMMENTlink modified 21 months ago by WouterDeCoster38k • written 21 months ago by Mike1.3k
gravatar for WouterDeCoster
21 months ago by
WouterDeCoster38k 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 21 months ago • written 21 months ago by WouterDeCoster38k

Thank you very much..

It is working perfectly fine.

ADD REPLYlink written 21 months ago by Mike1.3k
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: 888 users visited in the last hour