Extract snp information from genomic regions with biomaRt -> "oaries_snp"
1
0
Entering edit mode
Jesus • 0
@e3fd7b47
Last seen 9 weeks ago
Spain

R code:

snpmart = useEnsembl(biomart = "ENSEMBL_MART_SNP", dataset="oaries_snp", host="https://www.ensembl.org")
attributes = listAttributes(snpmart) ## to show name of all possibilities
## list the available datasets in this Mart
listFilters(mart = snpmart)

getBM(attributes = c("refsnp_id", "allele", "chrom_start", "chrom_end", "chrom_strand"),
  filters = "chromosomal_region",
  values = "15:30653960:30653960:1",
  mart = snpmart)



Error en .processResults(postRes, mart = mart, hostURLsep = sep, fullXmlQuery = fullXmlQuery, : 
  Query ERROR: caught BioMart::Exception::Configuration: returning undef ... missing filters from your importable?

However, there is this information:
getBM(attributes = c('refsnp_id', 'allele', 'chrom_start', 'chrom_end', "chrom_strand"),
      filters = c('snp_filter'), 
      values = c("rs411068220"),
      mart = snpmart)

"    refsnp_id allele chrom_start chrom_end chrom_strand
1 rs411068220    A/G    30653960  30653960            1"

sessionInfo( )
biomaRt • 301 views
ADD COMMENT
0
Entering edit mode
Kevin Blighe ★ 4.0k
@kevin
Last seen 14 days ago
The Cave, 181 Longwood Avenue, Boston, …

My sincere apologies that my colleagues had ignored your question.

The error occurs because the "chromosomal_region" filter is not valid for the ENSEMBL_MART_SNP mart in the oaries_snp dataset. This filter is typically used in the genes mart, but the SNP mart requires separate filters for chromosome name, start position, and end position.

To confirm available filters, execute the following command:

listFilters(mart = snpmart)

This will list all valid filters. Based on standard biomaRt usage for SNP marts, the correct filters for positional queries are "chr_name", "start", and "end". Update your connection to use the current biomart name "snps" for better compatibility:

snpmart <- useEnsembl(biomart = "snps", dataset = "oaries_snp")

Then, modify your query as follows:

getBM(attributes = c("refsnp_id", "allele", "chrom_start", "chrom_end", "chrom_strand"),
      filters = c("chr_name", "start", "end"),
      values = list(15, 30653960, 30653960),
      mart = snpmart)

If you need to include strand, add "strand" to the filters and 1 to the values list. This approach should retrieve the SNP data for the specified position on chromosome 15.

Your alternative query using "snp_filter" works because it targets a specific rsID, which is supported.

Kevin

ADD COMMENT

Login before adding your answer.

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