Hi, I have performed gene ontology analysis on a set of differentially expressed genes using the Enrichr package in R.I wanted to construct a barplot in R which shows the count of genes on one axis with their respective go terms. I am new to R, so I am not very familiar with plotting using ggplot2. I have a dataset that has the following columns: Gene Ontology Class - Biological Process, Cellular Component, or Molecular Function, GO terms - GO terms associated with a particular GO class, Number of genes -contains the count of genes associated with the respective GO terms, Adjusted p-value, https://ibb.co/XDPJFTj
I want to create a plot like the one shown below. (taken from a publication)
I will be really grateful if anybody can help me out.
Please post example data. Without example data (data images do not help), it will be difficult to follow the question. Graph in the image is faceted by 3 comparisons (a,b and c in the image). In your image, there is no such data. Without that data, following is an example how to facet and fill colour. Use following steps for faceting and colouring and change it as per your needs:
Try this example code:
Hi, Thank you so much for your response. my dataset looks like this:
>
I want to re-arrange and order the bars according to their ontology. For example, all the biological process bars will be arranged together, followed by molecular function and cellular component. But I don't know how to go about that.
Please post expected image. See if following works
It is working. I can't thank you enough for helping me in solving this issue.
I have updated the image/code and check it out.
Thank you so much. It seems my input dataset is missing few details as you have correctly pointed out. I am going to rearrange my dataset and follow the steps you've mentioned. Thank you again.
Hello, Could you help me please to do a similar graph? Instead of number of genes, I want to plot just the -log10(FDR) values.
Here is my data:
Please post it is as a new question.