This is a test version of Biostars. For the public version, visit https://www.biostars.org.
GO analysis

Hello I have lists of pathways , number of genes and adj value as in bellow, How can I put all results of GO analysis (MF, BP, CC AND KEGG) pathways in a graph using ggplot2 or any package?

number of pathways are 32.

adj.Pval,          Genes ,       Pathways 


8.2e-  10  13       - Endopeptidase inhibitor activity 


8.2e-10 -  13        -Peptidase inhibitor activity 
ggplot2 enrichment go analysis

Please provide more information. What result are you trying to highlight with this data? Is there something in the literature that you've seen that you want to replicate?

Post the data Saeed. Either attach a csv, upload to github, or include an example of the data.

1 answer

I manged to generate the the graph but still no pretty, I would like to make GT to each CC, MF, BP and KEGG in single.

Here is a code and data and graph are attached

ggplot(input_mat) + geom_point(aes(x = input_mat$Genes, y = input_mat$Pathways, color = input_mat$Type), size = 2) + theme_bw() + theme(axis.text.x = element_text(size=rel(1.15)), axis.title = element_text(size=rel(1.15))) + xlab("Gene number") + ylab(" GO terms") + ggtitle("Dotplot of top 30 significant GO terms") + theme(plot.title = element_text(hjust=0.5, face = "bold"))

enter image description here

Have you tried faceting it? Something like facet_wrap(.~Type). As an aside, you don't need to call the dataframe when you're assigning aesthetics, and for most use cases it's best practise to assign them in the main ggplot command:

ggplot(data = input_data, aes(colour = Type, x = Genes, y =  Pathways) + 
  geom_point(size = 2) +
  ...

EDIT: Just reread the post and you want them in a single plot. But the other comment remains valid, so I'll just leave it.

Log in to answer this question.