Hi,
I was trying to make a list of SNPs and names of genes they are related to. So I used the VariantAnnotation package
locateVariants(target, TxDb.Hsapiens.UCSC.hg19.knownGene, AllVariants())
and got a list of the respective geneids. As far as I understood VariantAnnotation gets the geneids from the TxDb.Hsapiens.UCSC.hg19.knownGene package and these are ENTREZIDs, which can directly be used as keys by the org.Hs.eg.db package. When I do this,
select(org.Hs.eg.db,keys=gid, columns=c("GENENAME"),keytype="ENTREZID")
it works for some of the entries, then I obtain the error:
Fehler in .testForValidKeys(x, keys, keytype, fks) : None of the keys entered are valid keys for 'ENTREZID'. Please use the keys method to see a listing of valid arguments.
I checked the geneid causing the error on the ncbi page and found that the id has been replaced by another one. So it seems TxDb.Hsapiens.UCSC.hg19.knownGene is providing an outdated geneid org.Hs.eg.db cannot deal with. I checked package version of TxDb.Hsapiens.UCSC.hg19.knownGene, it should be the latest version.
Now my question: Am I doing anything wrong or is this an inconsistency of the two packages I have to deal with? Is there a simple solution to solve this problem?
Thanks for any help!