I'm trying to create a volcano plot but I can't seem to figure out how. I tried using the NormalizeMets and ggplot2 package but I don't seem to understand how the syntax works. The syntax used for NormalizeMets doesn't seem in include Fold Change values and ggplot2 seems like its mostly used to make the graph pretty.
I have a table with a list of metabolite retention time/mass-to-charge ratio along with their corresponding fold-change values and p-values. My goal is to create a volcano plot which highlights p-values that are less than 0.05 and to label each point with the retention time/mass-to-charge ratio.
How should I go about doing this?
So far, I've only managed to upload the table and created variables of the Fold-Change and P-Value data.
Hi! I don’t have a direct answer for you, but in the interest of getting you a good answer faster, I do have some suggestions:
To reach helpers with the right interests, I recommend moving this question to the #tidyverse category, since it seems to involve ggplot2. You could also choose #general if you feel like your question isn’t tightly tied to ggplot2, but either way your question does not sound like it’s about the RStudio IDE.
You will be most likely to get an answer quickly if you provide a self-contained, reproducible example of what you’ve got so far. It doesn’t have to work! But at minimum you’ll need to supply some sample data and the code you’ve been working on. This may sound like a chore, but it is the single best thing you can do to increase your chances of getting an answer. When you post your code, please also be sure to format it as code !
If you’ve already tried searching for answers elsewhere, posting links to what you’ve found can help your helpers understand where you’re getting stuck (if you’ve posted this question anywhere else, definitely say so and post a link, to stay on the right side of this site’s cross-posting policy).
I echo the comments about producing a reprex, but I just taught a workshop - proteomics rather than metabolomics - but you're more than welcome to look at the materials for creating a volcano plot here:
The preceding sections deal with how to wrangle your data, and the link takes you to the plotting with ggplot2 part.