Huh, that was easy. Worked right off the bat - thanks!
Hi,
I am getting problems when trying to convert refseq_rna ids (for example, NM_001300384.1) to flybase_gene_id using biomaRt (in R and online), despite the fact that when I put this rna id to ensembl it gives me the right record (http://www.ensembl.org/Multi/Search/Results?q=NM_001300384.1;site=ensembl) (ensembl is using the same gene and transcript ids as FlyBase).
library(biomaRt)
ensembl<-useMart("ensembl", dataset="dmelanogaster_gene_ensembl")
getBM(attributes="flybase_gene_id", filters="refseq_mrna", values="NM_001300384.1", mart=ensembl)
[1] flybase_gene_id
<0 rows> (or 0-length row.names)
This is a part of my analysis where I annotate probes by local blast (which only produces NCBI accession numbers) and convert them to ensembl gene ids. But I am stuck at this conversion and don't understand what's going on. I also note that if I have several transcripts/transcript variants each with a different NCBI ID, the shortest ID (i.e. with fewest digits) usually gives me a hit in biomaRt. But long IDs like the above (of which I have many thousands) don't work.
I would very appreciate the explanation for this behaviour and tips on how to get the conversion done.
Cheers
1 answer
The number after the period refers to the version of the refseq entry. What you're looking for is the base accession #, which is the number that precedes the period: NM_001300384
Using this number:
ens <- useMart("ensembl", dataset="dmelanogaster_gene_ensembl")
getBM(attributes="flybase_gene_id", filters="refseq_mrna", values="NM_001300384", mart=ens)
flybase_gene_id
1 FBgn0027610
If you post your input file or dataframe in R, I'm sure a quick method to remove the trailing version number from your IDs can be suggested if you don't already know how to do it.
Log in to answer this question.