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.
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
.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.