Question: error in keytype performing "enrichGO" from clusterprofiler
gravatar for zengjia0808
3 months ago by
zengjia08080 wrote:


I am working on a non-model organism that I can't download the annotation package from the annotationhub. So I need to build an orgDb from scratch in order to perform the GO enrichment analysis. For this organism, I already have the mapping of the gene ID (internal) to the GO ID. So I used the R package called "AnnotationForge" to build the orgDb. In this package, I followed this example to built:


    **## Makes an organism package for Zebra Finch data.frames:
    finchFile <- system.file("extdata","finch_info.txt",package="AnnotationForge")
    finch <- read.table(finchFile,sep="\t")
    ## not that this is how it should always be, but that it *could* be this way.
    fSym <- finch[,c(2,3,9)]
    fSym <- fSym[fSym[,2]!="-",]
    fSym <- fSym[fSym[,3]!="-",]
    colnames(fSym) <- c("GID","SYMBOL","GENENAME")
    fChr <- finch[,c(2,7)]
    fChr <- fChr[fChr[,2]!="-",]
    colnames(fChr) <- c("GID","CHROMOSOME")
    finchGOFile <- system.file("extdata","GO_finch.txt",package="AnnotationForge")
    fGO <- read.table(finchGOFile,sep="\t")
    fGO <- fGO[fGO[,2]!="",]
    fGO <- fGO[fGO[,3]!="",]
    colnames(fGO) <- c("GID","GO","EVIDENCE")
    makeOrgPackage(gene_info=fSym, chromosome=fChr, go=fGO,
    maintainer="Some One <>",
    author="Some One <>",
    outputDir = ".",
    ## then you can call install.packages based on the return value
    install.packages("./", repos=NULL)**


After this, I simply load this library "", and perform an sample test using the following command:

sample_gene <- sample(keys(, 100)
sample_test <- enrichGO(sample_gene,, pvalueCutoff=1, qvalueCutoff=1)

However, this gave me error message as: "Error in getGOdata(OrgDb, ont, keyType) : keytype is not supported..."

Can anyone help me to establish a orgDb that I can perform the enrichGO analysis? Thank you so much for the help.

Best, Jia

clusterprofiler • 175 views
ADD COMMENTlink modified 3 months ago by Guangchuang Yu1.1k • written 3 months ago by zengjia08080
Answer: error in keytype performing "enrichGO" from clusterprofiler
gravatar for Guangchuang Yu
3 months ago by
Guangchuang Yu1.1k
China/Guangzhou/Southern Medical University
Guangchuang Yu1.1k wrote:

get_GO_data need to query "GOALL", "ONTOLOGYALL" from OrgDb and it seems your OrgDb doesn't contain such information.

BTW: You can use enricher to perform GO analysis without using OrgDb.

ADD COMMENTlink written 3 months ago by Guangchuang Yu1.1k

Thank you so much for the answer. I wonder is there any example to build a OrgDb from scratch that can be used in clusterprofiler? I really appreciate your help.

ADD REPLYlink written 3 months ago by zengjia08080

Dear Dr. Yu:

I double checked the values in They do have the "GOALL", "ONTOLOGYALL" value, as I run the following command:

keys <- head(keys(
select(, keys=keys, columns = c("GOALL","ONTOLOGYALL"))

This give you the results as: GID GOALL ONTOLOGYALL 1 751582 GO:0032496 BP 2 751582 GO:0042493 BP 3 751582 GO:0043524 BP 4 751582 GO:0006919 BP 5 751582 GO:0048168 BP 6 751582 GO:0033138 BP 7 751582 GO:0042417 BP

Besides, I also tried the enricher function. However, I tried several gene sets but none of them gave me significant results. I wonder whether it is because how I set the TERM2GENE argument. Basically I used the "GO ID" as the first column, and gene ID as the second column. Is this good for enricher? Thank you so much for the help.

ADD REPLYlink written 3 months ago by zengjia08080
Please log in to add an answer.


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