error in keytype performing "enrichGO" from clusterprofiler
1
0
Entering edit mode
@zengjia0808-20007
Last seen 2.7 years ago

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")
## 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 <- 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 • 1.1k views
0
Entering edit mode
#solved
sample_test <- enrichGO(sample_gene, OrgDb=org.Tguttata.eg.db, pvalueCutoff=1, qvalueCutoff=1, keyType = "GID")

0
Entering edit mode
Guangchuang Yu ★ 1.2k
@guangchuang-yu-5419
Last seen 8 months ago
China/Guangzhou/Southern Medical Univer…

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.

0
Entering edit mode

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.

0
Entering edit mode

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.