Entering edit mode
5.0 years ago
leboralli
•
0
Hello everyone. I'm trying to do a volcano plot of a dataset from RNA-seq. I want to add a custom legend with the values of the down regulated, up regulated and no regulated, but I really don't know how I can do that and I can't find a way to do that in Google (maybe my problem it's my inexperience in R)
This is my code until now:
ggplot(df_toxins, aes(x = logFC, y = -log10(FDR))) +
geom_point(data = no_reg_toxins,
color = "black", alpha = 0.6, size = 1.5) +
geom_point(data = down_reg_toxins,
color = "red", alpha = 0.5, size = 2.5) +
geom_point(data = up_reg_toxins,
color = "blue", alpha = 0.5, size = 2.5) +
geom_vline(xintercept = c(-1, 1), linetype = "dashed") +
geom_hline(yintercept = 0) +
theme_linedraw() +
theme(plot.title = element_text(hjust = 0.5, size = 22)) +
ggtitle("Toxins")