Entering edit mode
Nithisha
▴
10
@nithisha-14272
Last seen 6.9 years ago
Hi everyone,
This is the code I used to create a volcano plot: I am trying to plot several genes and highlight the top 20 most downregulated and top 20 most downregulated genes using green and red.
#Plot a volcano plot library(calibrate) head(afinal) threshold.high <- afinal$logFC[20] threshold.low <- sort(afinal$logFC, decreasing = FALSE)[20] file_nname <- sub('.csv','',file_name) plot_title = paste(file_nname, sep='-') with(afinal, plot(logFC, -log10(P.Value), pch=20, main = plot_title, xlim=c(-7,7))) with(subset(afinal, logFC>threshold.high), points(logFC, -log10(P.Value),pch=20, col='red')) with(subset(afinal, logFC<threshold.low),points(logFC, -log10(P.Value),pch=20, col="green")) with(subset(afinal,logFC>threshold.high | logFC<threshold.low), textxy(logFC, -log10(P.Value), labs=SYMBOL, cex= .8, offset = 0.8))
However, I get overlapping gene labels. Is there anyway to avoid this? I know there is ggrepel but is there something similar for textxy?
Hi,
I have same question, did you find any solution for this? Thanks