Error in testForValidKeytype(x, keytype) : Invalid keytype: TAIR. Please use the keytypes method to see a listing of valid arguments.
2
0
Entering edit mode
1627166123 • 0
@904bbf0b
Last seen 3.6 years ago
Taiwan

I used org.m.eg. db to do GO enrichment analysis, and the following error always appeared. I used the method in keytypes (org.m.eg. db), but it still could not be solved.

org.Mm.eg.db • 3.3k views
ADD COMMENT
0
Entering edit mode
1627166123 • 0
@904bbf0b
Last seen 3.6 years ago
Taiwan

res3$symbol <- mapIds(org.Mm.eg.db,

  • keys=res3$gene_id,
  • column="SYMBOL",
  • keytype="TAIR",
  • multiVals="first") Error in testForValidKeytype(x, keytype) : Invalid keytype: TAIR. Please use the keytypes method to see a listing of valid arguments.enter image description here
ADD COMMENT
0
Entering edit mode
Guido Hooiveld ★ 4.1k
@guido-hooiveld-2020
Last seen 7 days ago
Wageningen University, Wageningen, the …

The keytype argument basically describes the type of identifier you would like to query on; for example is it an ENTREZID, or REFSEQ, or SYMBOL. You can check these by:

keytypes(org.Mm.eg.db)
 [1] "ACCNUM"       "ALIAS"        "ENSEMBL"      "ENSEMBLPROT"  "ENSEMBLTRANS"
 [6] "ENTREZID"     "ENZYME"       "EVIDENCE"     "EVIDENCEALL"  "GENENAME"    
[11] "GO"           "GOALL"        "IPI"          "MGI"          "ONTOLOGY"    
[16] "ONTOLOGYALL"  "PATH"         "PFAM"         "PMID"         "PROSITE"     
[21] "REFSEQ"       "SYMBOL"       "UNIGENE"      "UNIPROT"     

You defined keytype="TAIR". Please note that TAIR are Arabidopsis (plant) IDs! TAIR = The Arabidopsis Information Resource. Obviously, TAIR IDs are not in a mouse annotation library, hence the error you got! Invalid keytype: TAIR.

So your query should rather be:

res3$symbol <- mapIds(org.Mm.eg.db,
    keys=res3$gene_id,
    keytype="ENSEMBL",  #gene_id are ENSEMBL IDs!
    column=c("SYMBOL"), #the annotation info you would like to retrieve
    multiVals="first")

Be sure to also check the help pages of the function mapIds:

?mapIds

Lastly, since your primary IDs are ENSEMBL ids; why don't you use an EnsDB (instead of a NCBI-based OrgDb) for annotating? This thread may be useful to get started with an EnsDb.

ADD COMMENT

Login before adding your answer.

Traffic: 587 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6