This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Adding custom legend in volcano plot

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")
r rna-seq

Hello leboralli!

We believe that this post does not fit the main topic of this site.

Pure R question, please search StackOverflow

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

0 answers

No answers yet.

Log in to answer this question.