Closed
Description
This is an idea from @dalloliogm
it would be better if compareCluster would return a dataframe with multiple columns, instead of merging them into a single column called Cluster. This would be make it possible to plot the results using facets or something more fancy.
see http://bioinfoblog.it/2015/02/a-formula-interface-for-geneontology-analysis/.
data(geneList, package="DOSE")
mydf <- data.frame(Entrez=names(geneList), FC=geneList)
mydf <- mydf[abs(mydf$FC) > 1,]
mydf$group <- "upregulated"
mydf$group[mydf$FC < 0] <- "downregulated"
mydf$othergroup <- "A"
mydf$othergroup[abs(mydf$FC) > 2] <- "B"
require(clusterProfiler)
xx <- compareCluster(Entrez~group+othergroup, data=mydf, fun="enrichGO")
require(ggplot2)
## plot(xx), since the parameter x was already taken as input object,
## we can't use `x` to specify x variable.
## now we prefer using `dotplot` function to produce the same figure.
dotplot(xx)
## we can specify other x variable instead of the default `Cluster` variable.
dotplot(xx,x=~group) + facet_grid(~othergroup)
Activity
GuangchuangYu commentedon Nov 3, 2015
see a8fe7b9.
dalloliogm commentedon Nov 4, 2015
I think it is much better now, thank you for implementing it :-)
huerqiang commentedon Sep 17, 2021
@Psequencer
dotplot(ComGO)
huerqiang commentedon Sep 17, 2021
@Psequencer What(which column of your compareCluster result) do you want to use for the facet? In your example, you may not be able to find the suitable column.