Skip to content

facet compareCluster result #32

Closed
Closed
@GuangchuangYu

Description

@GuangchuangYu
Member

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)

screenshot 2015-11-03 19 13 06

## we can specify other x variable instead of the default `Cluster` variable.
dotplot(xx,x=~group) + facet_grid(~othergroup)

screenshot 2015-11-03 19 08 31

Activity

GuangchuangYu

GuangchuangYu commented on Nov 3, 2015

@GuangchuangYu
MemberAuthor

see a8fe7b9.

dalloliogm

dalloliogm commented on Nov 4, 2015

@dalloliogm
Contributor

I think it is much better now, thank you for implementing it :-)

huerqiang

huerqiang commented on Sep 17, 2021

@huerqiang
Contributor

@Psequencer

dotplot(ComGO)
huerqiang

huerqiang commented on Sep 17, 2021

@huerqiang
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @dalloliogm@GuangchuangYu@huerqiang

        Issue actions

          facet compareCluster result · Issue #32 · YuLab-SMU/clusterProfiler