Question: error in keytype performing "enrichGO" from clusterprofiler
0
gravatar for zengjia0808
8 weeks ago by
zengjia08080 wrote:

Hi,

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:

*

library(AnnotationForge)
    **## 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,
    version="0.1",
    maintainer="Some One <so@someplace.org>",
    author="Some One <so@someplace.org>",
    outputDir = ".",
    tax_id="59729",
    genus="Taeniopygia",
    species="guttata",
    goTable="go")
    ## then you can call install.packages based on the return value
    install.packages("./org.Tguttata.eg.db", repos=NULL)**

*

After this, I simply load this library "org.Tguttata.eg.db", and perform an sample test using the following command:

library("org.Tguttata.eg.db")
library(clusterProfiler)
sample_gene <- sample(keys(org.Tguttata.eg.db), 100)
sample_test <- enrichGO(sample_gene, OrgDb=org.Tguttata.eg.db, 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 • 122 views
ADD COMMENTlink modified 8 weeks ago by Guangchuang Yu1.1k • written 8 weeks ago by zengjia08080
Answer: error in keytype performing "enrichGO" from clusterprofiler
0
gravatar for Guangchuang Yu
8 weeks 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 8 weeks 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 7 weeks ago by zengjia08080

Dear Dr. Yu:

I double checked the values in org.Tguttata.eg.db. They do have the "GOALL", "ONTOLOGYALL" value, as I run the following command:

keys <- head(keys(org.Tguttata.eg.db))
select(org.Tguttata.eg.db, 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 7 weeks ago by zengjia08080
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 16.09
Traffic: 293 users visited in the last hour