Question: How to label custom multiple gene lists object into volcano plot?
12 months ago by
choijamtsm • 50
choijamtsm • 50 wrote:
I am new here and I tried to make a basic volcano plot with R.
#import data res <- read.table("results.txt", header=TRUE) genes <- read.table("genes.txt", header=TRUE) # Make a basic volcano plot with(res, plot(log2foldchange, -log10(pvalue), pch=20, cex.lab=1.6, main="Volcano Plot", xlim=c(-8,8), col="grey")) # Add colored points: with(subset(res, pvalue<.05 & abs(log2foldchange)>1.5), points(log2foldchange, -log10(pvalue), pch=20, col="cyan")) # Label points with the textxy function from the calibrate plot library(calibrate) #Label only 1 gene with(subset(res, Gene == "WNT7A"), textxy(log2FoldChange, -log10(pvalue), labs=Gene, cex=.8)) #How to insert "genes" into volcano plot (overlap res)?
My question is how to add "genes" which contains multiple gene lists into res? (which should label only genes list)
Thank you so much!
ADD COMMENT • link •