Skip to content

Instantly share code, notes, and snippets.

@gireeshkbogu
Created October 23, 2018 23:42
Show Gist options
  • Save gireeshkbogu/693e6f0cf818a57ef605f260f5b5eaaa to your computer and use it in GitHub Desktop.
Save gireeshkbogu/693e6f0cf818a57ef605f260f5b5eaaa to your computer and use it in GitHub Desktop.
library(ggplot2)
# plot volcano plot
res <- read.table("Male_vs_Female_Pre", head=TRUE)
res$Significant <- ifelse(res$adj.P.Val < 0.05, "adj.P.Val < 0.05", "Not Significant")
ggplot(res, aes(x = logFC, y = -log10(P.Value))) +
geom_point(aes(color = Significant)) +
scale_color_manual(values = c("red", "grey")) +
theme_bw(base_size = 12) + theme(legend.position = "bottom") +
geom_text_repel(
data = subset(res, adj.P.Val < 0.05 & abs(logFC)>4),
#data = subset(res, abs(logFC)>4),
aes(label = gene),
size = 3,
box.padding = unit(0.35, "lines"),
point.padding = unit(0.3, "lines")
) +
ggtitle("Men vs Women")+
theme(plot.title = element_text(hjust = 0.5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment