Hi, I don't know if you have already encountered this kind of problem with clusterProfiler, but it seems that it doesn't recognize the keytype I indicate.
Having GIDs, indicating keyType="GID" as an argument, I get this error:
> GOenrich <- enrichGO(gene=GenesVector,
+ OrgDb="org.Cgigas.eg.db",
+ keyType="GID",
+ ont="BP",
+ pAdjustMethod="BH",
+ qvalueCutoff="0.05",
+ universe=GenesBackground,
+ readable=FALSE,
+ pool=FALSE)
Error in testForValidKeytype(x, keytype) :
Invalid keytype: GOALL. Please use the keytypes method to see a listing of valid arguments.
When I display the list of possible arguments, I get the following result:
> keytypes(org.Cgigas.eg.db)
[1] "EVIDENCE" "GID" "GO"
However, the same error is displayed for keyType="GO" or keyType="EVIDENCE", even though these arguments are not relevant to my study.
If you are using clusterProfiler and have any advice, I am listening.
For precision: I generated my Org.db using the makeOrgPackage() function of AnnotationForge.
For now it would be helpful if you could show the result of:
... in order to get a 'feeling' on how your gene ids look like.
Also, are you working with data from an oyster? Crassostrea gigas, taxonomty ID: 29159? https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=29159
Also cross-posted... https://stackoverflow.com/questions/71921737/use-of-clusterprofiler-error-in-testforvalidkeytypex-keytype
Hi, thanks for your interest, Here is what GenesVector and GenesBackground objects contain for me, respectively the list of my genes of interest (annotated by GOs) and the list of genes in the C.gigas genome (annotated by GOs) :
I am indeed working on C.gigas. I saw that there was already an org.db made from v9, however I work from the Roslin.
Aha, I see.
I am no expert at all on oyster, but apparently there are multiple genome assemblies for this organism: https://www.ncbi.nlm.nih.gov/assembly/?term=txid29159
I deduce that you used
cgigas_uk_roslin_v1
for your work (and notoyster_v9
), but it seems that this Roslin assembly has not been annotated (at least, not by NCBI). Therefore NCBI has no annotation info available, and as a consequence theAnnotationHub
cannot be used... And considering the answer of James below (lack ofGOALL
column), it seems that 'self-made'OrgDbs
unfortunately cannot be used withclusterProfiler
.Yet, since you have gene-to-GO mapping info, you may want to perform GO overrepresentation analysis using the generic
enricher()
function fromclusterProfiler
.enricher()
does not require anOrgDb
, but rather a simpleTERM2GENE
andTERM2NAME
mapping file. In this context you may want to check this previous post of mine (specifically 'option 2' and links): clusterProfiler-GO enrichment Error, and Chapter 12 of the 'clusterProfiler-book' (here).