Hi all,
I am using R. I have a dataframe that has 3 columns - chromosome number, chromosome start position, chromosome end position - for 483 genes of interest.
I'm trying to use biomart to get all the rs numbers associated with each gene. Right now, my code looks like this:
require(biomaRt)
hg19.snpmart <- useMart(biomart="ENSEMBL_MART_SNP", host="
grch37.ensembl.org", path="/biomart/martservice", dataset="hsapiens_snp")
get.rs <- function(chr, start, end) {
getBM(c("refsnp_id", "allele", "chrom_start", "chrom_strand"), filters=c("chr_name", "start", "end"),
values=list(chr, start, end), mart=hg19.snpmart)
}
rsid <- with(dataframe, Map(get.rs,
chr.name, chr_start, chr_end))
dataframe is the dataframe referred to in the beginning,
chr.name, chr_start, chr_end are the columns.
The last line runs for a long time, then it says:
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.
I've tried using a different host (
feb2014.archive.ensembl.org) as well as a different function: useEnsembl(biomart="snp", dataset="hsapiens_snp", GRCh=37). Both give the same result.
Does it have something to do with the fact that this function probably takes a long time to run so there's a web time out? Is there a way to circumvent this issue?
Thanks in advance.