This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to plot the result of compareCluster using ggplot

Hello,

I am trying to plot the result of compareCluster.

ck = compareCluster(geneCluster = data, fun = enrichGO, OrgDb = "org.At.tair.db", keyType = "TAIR", ont = "BP", pAdjustMethod = "BH", pvalueCutoff = 0.05, qvalueCutoff = 0.05, readable = TRUE)

After this code, I get the result, but there is another step to calculate rich factor as below.

rich = mutate(ck, richFactor = Count / as.numeric(sub("/\d+", "", BgRatio)))

Then, I have rich factor data which contains GO analysis between 2 groups. I would like to visualize this two group using ggplot function. when I analyze only 1 data this code works well.. the code is:

ggplot(rich, showCategory = 30, aes(richFactor,fct_reorder(Description, richFactor))) + geom_segment(aes(xend=0, yend=Description)) + geom_point(aes(color=p.adjust, size = Count)) + scale_color_gradientn(colours = c("#f7ca64", "#46bac2", "#7e62a3"), trans="log10", guide=guide_colorbar(reverse=TRUE, order=1)) + scale_size_continuous(range=c(2, 10)) + theme_dose(12) + xlab("Rich Factor") + ylab(NULL)

But when I try to compare 2 group, this code is not working. How could I show 2 different group of GO results?

ggplot comparecluster

0 answers

No answers yet.

Log in to answer this question.