Entering edit mode
Voke AO
▴
760
@voke-ao-4830
Last seen 10.3 years ago
Hi all,
I'm curious to know how I can get and highlight the top 10% of the
genes based on p-values that I get from my limma analysis in a volcano
plot.
I can get the genes highlighted based on an absolute logFC >2 and a
p-value<0.01(code below) but I would like to have an idea of the
number of genes in the top 10% based simply on p-values.
Any help will be greatly appreciated.
Thanks.
-Avoks
results$threshold = as.factor(abs(results$logFC) > 2 & results$P.Value
< 0.01)
windows()
pdf("VolcanoPlot_GSE25724_9.pdf");
g = ggplot(data=results, aes(x=logFC, y=-log10(P.Value),
colour=threshold)) +
geom_point(alpha=0.4, size=1.75) +
opts(legend.position = "none") +
xlim(c(-8, 8)) + ylim(c(0, 10)) +
xlab("log2 fold change") + ylab("-log10 p-value")
g
dev.off()