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