Search
Question: Sort clusterProfiler result
0
gravatar for horcsct
2.2 years ago by
horcsct0
Iran, Islamic Republic Of
horcsct0 wrote:

Hi,

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

Thanks.

ADD COMMENTlink modified 4 months ago by sghoshucla0 • written 2.2 years ago by horcsct0
2
gravatar for Guangchuang Yu
2.2 years ago by
Hong Kong
Guangchuang Yu800 wrote:

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 COMMENTlink modified 2.2 years ago • written 2.2 years ago by Guangchuang Yu800

Thanks Guangchuang Yu,

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

ADD REPLYlink written 2.2 years ago by horcsct0

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 REPLYlink written 2.2 years ago by Guangchuang Yu800
0
gravatar for sghoshucla
4 months ago by
sghoshucla0
sghoshucla0 wrote:

How do I subset groupGO objects?

ADD COMMENTlink written 4 months ago by sghoshucla0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 377 users visited in the last hour