I am trying to map some ensembl gene IDs and LRG regions to position on the genome. I got the gene IDs and LRG regions by mapping transcript IDs to gene IDs with
mapping <- getBM(attributes = c("ensembl_transcript_id","ensembl_gene_id","hgnc_symbol",'chromosome_name','start_position','end_position'),filters = "ensembl_transcript_id", values = rownames(tpm_transcripts), mart = mart)
tpm_transcripts$ensembl_gene_id <- mapping[match(rownames(tpm_transcripts),mapping$ensembl_transcript_id),]$ensembl_gene_id
Then to map from gene ID to gene position I do:
mapping <- getBM(attributes = c("ensembl_gene_id",'chromosome_name','start_position','end_position'),filters "ensembl_transcript_id", values = rownames(tpm_transcripts), mart = mart)
And then get the position with
mapping[mapping$ensembl_gene_id=="LRG_195",]
Which for this particular LRG region ives me:
ensembl_gene_id chromosome_name start_position end_position
LRG_195 LRG_195 5001 10472
So it doesn't give me a chromosome, and when I look at http://www.ensembl.org/Homo_sapiens/LRG/Summary?lrg=LRG_195 it says the position is: Chromosome 16: 30,178,605-30,191,076, so the start/end position are also wrong. Is there a different way of doing this?