Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

facet compareCluster result #32

Closed
GuangchuangYu opened this issue Nov 3, 2015 · 4 comments
Closed

facet compareCluster result #32

GuangchuangYu opened this issue Nov 3, 2015 · 4 comments

Comments

@GuangchuangYu
Copy link
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

@GuangchuangYu
Copy link
Member Author

see a8fe7b9.

@dalloliogm
Copy link
Contributor

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

@huerqiang
Copy link
Contributor

@Psequencer

dotplot(ComGO)

@huerqiang
Copy link
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
Projects
None yet
Development

No branches or pull requests

4 participants
@dalloliogm @GuangchuangYu @huerqiang and others