This is a test version of Biostars. For the public version, visit https://www.biostars.org.
ClusterProfiler fails to find GO terms

Hi all,

I need to assign GO terms to DE genes in R. ClusterProfiler seems to be a popular package for that. But for some reason it either fails to detect GO terms or its GO terms do not coincide with other tools.

library(clusterProfiler)
library(org.Hs.eg.db)

###mtDNA genes
genes<-c("ENSG00000198886","ENSG00000198888","ENSG00000198763","ENSG00000198840","ENSG00000212907","ENSG00000198786","ENSG00000198695","ENSG00000198727","ENSG00000198804","ENSG00000198712","ENSG00000198938","ENSG00000198899","ENSG00000228253")


ego<-enrichGO(genes, OrgDb = org.Hs.eg.db, keytype ="ENSEMBL",ont = "CC",pAdjustMethod = "fdr",pvalueCutoff  = 0.1,  qvalueCutoff  = 0.5)

dotplot(ego, showCategory=30)

The same genes with Panther as expected show mtDNA related GO terms. Other genes from my dataset get enrichments, so apparently the problem is not in gene IDs. What am I doing wrong?

Cheers,

rna-seq go clusterprofiler

2 answers



> genes<-c("ENSG00000198886","ENSG00000198888","ENSG00000198763","ENSG00000198840","ENSG00000212907","ENSG00000198786","ENSG00000198695","ENSG00000198727","ENSG00000198804","ENSG00000198712","ENSG00000198938","ENSG00000198899","ENSG00000228253")
> 
> 
> ego<-enrichGO(genes, OrgDb = org.Hs.eg.db, keyType ="ENSEMBL",ont = "CC",pAdjustMethod = "fdr",pvalueCutoff  = 0.1,  qvalueCutoff  = 0.5)
> 
> head(ego)
                   ID                                  Description GeneRatio   BgRatio       pvalue     p.adjust
GO:0098800 GO:0098800 inner mitochondrial membrane protein complex     12/13 164/21794 2.828287e-25 8.767691e-24
GO:0070469 GO:0070469                            respiratory chain     11/13 119/21794 6.189305e-24 9.593423e-23
GO:0044455 GO:0044455                  mitochondrial membrane part     12/13 258/21794 7.538998e-23 7.790298e-22
GO:0098798 GO:0098798                mitochondrial protein complex     12/13 302/21794 5.173544e-22 4.009497e-21
GO:0098803 GO:0098803                    respiratory chain complex     10/13 104/21794 1.109666e-21 6.879930e-21
GO:0005746 GO:0005746              mitochondrial respiratory chain     10/13 108/21794 1.645447e-21 8.501478e-21
                 qvalue
GO:0098800 1.786287e-24
GO:0070469 1.954517e-23
GO:0044455 1.587157e-22
GO:0098798 8.168754e-22
GO:0098803 1.401683e-21
GO:0005746 1.732050e-21
                                                                                                                                                                                                    geneID
GO:0098800 ENSG00000198886/ENSG00000198888/ENSG00000198763/ENSG00000198840/ENSG00000212907/ENSG00000198786/ENSG00000198727/ENSG00000198804/ENSG00000198712/ENSG00000198938/ENSG00000198899/ENSG00000228253
GO:0070469                 ENSG00000198886/ENSG00000198888/ENSG00000198763/ENSG00000198840/ENSG00000212907/ENSG00000198786/ENSG00000198695/ENSG00000198727/ENSG00000198804/ENSG00000198712/ENSG00000198938
GO:0044455 ENSG00000198886/ENSG00000198888/ENSG00000198763/ENSG00000198840/ENSG00000212907/ENSG00000198786/ENSG00000198727/ENSG00000198804/ENSG00000198712/ENSG00000198938/ENSG00000198899/ENSG00000228253
GO:0098798 ENSG00000198886/ENSG00000198888/ENSG00000198763/ENSG00000198840/ENSG00000212907/ENSG00000198786/ENSG00000198727/ENSG00000198804/ENSG00000198712/ENSG00000198938/ENSG00000198899/ENSG00000228253
GO:0098803                                 ENSG00000198886/ENSG00000198888/ENSG00000198763/ENSG00000198840/ENSG00000212907/ENSG00000198786/ENSG00000198727/ENSG00000198804/ENSG00000198712/ENSG00000198938
GO:0005746                                 ENSG00000198886/ENSG00000198888/ENSG00000198763/ENSG00000198840/ENSG00000212907/ENSG00000198786/ENSG00000198727/ENSG00000198804/ENSG00000198712/ENSG00000198938
           Count
GO:0098800    12
GO:0070469    11
GO:0044455    12
GO:0098798    12
GO:0098803    10
GO:0005746    10

Thanks! I am using R v. 3.4.4 and thus clusterProfiler v 3.4.4. So I guess the problem is coming from there. How can I fix the issue in my current version of the package? Or its better to update R?

Dear Prof. Yu, I also have some problems with cluster profile.

hub <- AnnotationHub()
CaDb <- query(hub, "Candida albicans")[["AH74040"]]
sample_gene <- sample(CaDb$ID, 100, replace = TRUE)
library(clusterProfiler)
sample_test <- enrichGO(sample_gene, OrgDb=CaDb, pvalueCutoff=1, qvalueCutoff=1, keyType = "ID")

--> I receved "Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘keytypes’ for signature ‘"GRanges"’"

I tried to change to enricher:
res <- enricher(sample_gene, TERM2GENE=term2gene, TERM2NAME=term2name, pvalueCutoff = 1, pAdjustMethod = "BH", qvalueCutoff = 1)

--> error: Error in build_Anno(TERM2GENE, TERM2NAME) : object 'term2gene' not found

Please help me when you have time.

Thank you very much!

With the hint from @Guangchuang in the post above, I resolved the problem by updating clusteProfiler to the latest version.

For that I had to update R to v. 3.5 for my Ubuntu 16.04 https://www.r-bloggers.com/updating-r-on-ubuntu/

Then install the latest bioconductor version https://www.bioconductor.org/install/

And resolve the igragh fortrat4 dependancy issue https://ashokragavendran.wordpress.com/2017/10/24/error-installing-rigraph-unable-to-load-shared-object-igraph-so-libgfortran-so-4-cannot-open-shared-object-file-no-such-file-or-directory/

Hope this will save several hours for people with the same problem

Log in to answer this question.