RDlady
RDlady

Reputation: 407

retrieve SNP location in biomaRt, command hangs

I was trying to retrieve information on a SNP location. I tried to follow the instructions of an answer from this website, but the command doesn't work anymore:

library(biomaRt) # biomaRt_2.30.0

snp_mart = useMart("ENSEMBL_MART_SNP", dataset="hsapiens_snp")

snp_ids = c("rs16828074", "rs17232800")
snp_attributes = c("refsnp_id", "chr_name", "chrom_start")

snp_locations = getBM(attributes=snp_attributes, filters="snp_filter", 
                      values=snp_ids, mart=snp_mart)

I get the following error after waiting for a long time:

Error in value[[3L]](cond) : 
  Request to BioMart web service failed. Verify if you are still connected to the internet.  Alternatively the BioMart web service is temporarily down.

Did anything change in biomaRt commands since the last version? Or am I doing something wrong?

Upvotes: 2

Views: 370

Answers (1)

RDlady
RDlady

Reputation: 407

This is more like a workaround then a definitive answer to this problem. But now Ensembl is in its version 90. If I use an archived host from the previous version (v89, from http://may2017.archive.ensembl.org), the SNP datasets is working again. So here is my temporary solution while v90 is not working for SNPs:

library("biomaRt")
snp_mart = useMart(biomart = "ENSEMBL_MART_SNP", dataset="hsapiens_snp", host='may2017.archive.ensembl.org')

snp_ids = c("rs16828074", "rs17232800")

snp_attributes = c("refsnp_id", "chr_name", "chrom_start")

snp_locations = getBM(attributes=snp_attributes, filters="snp_filter", 
                       values=snp_ids, mart=snp_mart)

The result should look like this:

snp_locations
   refsnp_id chr_name chrom_start
1 rs16828074        2   231454043
2 rs17232800       18    68625022

Upvotes: 4

Related Questions