bioMart help - snp IDs in useMart
1
0
Entering edit mode
Elena • 0
@elena-11616
Last seen 8.1 years ago

Hi,

I am using bioMart to convert rsIDs to chromosome and positions. I also need to keep the rsIDs in the final dataset but I cannot find this option in the attributes.

I am showing my code here and specifically the one with the attributes. Could you please advise?

 

library(biomaRt);

human <- useMart(host="www.ensembl.org", "ENSEMBL_MART_ENSEMBL", dataset="hsapiens_gene_ensembl");

listMarts(host="www.ensembl.org");

 

attributes = listAttributes(human);

attributes[1:30,];

 

snp_ids = data$rsidonly;

snp_attributes = c("ensembl_gene_id", "chromosome_name", "start_position", "end_position", "transcript_start", "transcript_end");

snp_locations = getBM(attributes=snp_attributes, filters="chromosomal_region", values=snp_ids, mart=human);

 

Thank you,

Elena

 

rsid useMart • 2.6k views
ADD COMMENT
1
Entering edit mode
Mike Smith ★ 6.6k
@mike-smith
Last seen 4 hours ago
EMBL Heidelberg

I'm not sure you can query the genes database with rsIDs, but you should be able to get the information from the variation database.

 

library(biomaRt)
human_variation = useMart(biomart = "ENSEMBL_MART_SNP", dataset = "hsapiens_snp") 

snp_ids = "rs746229459"

snp_attributes = c("refsnp_id", 
                   "ensembl_gene_stable_id", 
                   "chr_name", 
                   "chrom_start", 
                   "chrom_end", 
                   "ensembl_transcript_stable_id");

snp_locations = getBM(attributes = snp_attributes, 
                      filters = "snp_filter", 
                      values = snp_ids, 
                      mart = human_variation);
snp_locations
    refsnp_id ensembl_gene_stable_id         chr_name chrom_start chrom_end
1 rs746229459        ENSG00000201015                6    67541718  67541718
2 rs746229459        ENSG00000252303 CHR_HG2128_PATCH    67541718  67541718
  ensembl_transcript_stable_id
1              ENST00000364145
2              ENST00000516494

 

ADD COMMENT
0
Entering edit mode

That's great, thank you! It looks like I should change the host.  

ADD REPLY

Login before adding your answer.

Traffic: 655 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