Sort clusterProfiler result
2
1
Entering edit mode
horcsct ▴ 10
@horcsct-7344
Last seen 9.0 years ago
Iran, Islamic Republic Of

Hi,

How can I sort the clusterProfiler package results (groupGOResult object) for instance according GeneRatio in groupGO?

Thanks.

clusterProfiler sort • 4.4k views
ADD COMMENT
2
Entering edit mode
Guangchuang Yu ★ 1.2k
@guangchuang-yu-5419
Last seen 16 days ago
China/Guangzhou/Southern Medical Univer…

If for visualization, just pass order=TRUE to barplot. It will sort result based on count which is similar to geneRatio (since geneRatio = count/geneNum, and geneNum is identical).

 

You can use summary(groupGO_object) to export the result as a data.frame and sort it yourself if you want to do other things.

 

ADD COMMENT
0
Entering edit mode

Thanks Guangchuang Yu,

But this only sort displayed category (showCategory) not all category. I want plot 10 category with max count.

ADD REPLY
0
Entering edit mode

I use showCategory to subset the result first.

 

Will change to order result first, follow by subsetting. Then your question can be resolved by barplot(x, showCategory=10, order=T)

 

In current implementation, you can use the following script:

> df = summary(x)

> term=df$ID[order(df$Count, decreasing=T)]

> barplot(x, showCategory=term[1:10], order=T)

 

 

ADD REPLY
0
Entering edit mode
sghoshucla • 0
@sghoshucla-13462
Last seen 7.4 years ago

How do I subset groupGO objects?

ADD COMMENT

Login before adding your answer.

Traffic: 350 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6