SNP names Biomart error: Invalid filters(s): snp_filter
1
1
Entering edit mode
5 weeks ago
PeterKW ▴ 30

Hi everyone,

I have seen a similar question (here) but I can't figure out how the issue was solved.

I have a list (> 500k) of SNPs rs numbers and would like to get their corresponding stable snp names. The code that I am running to test for one snp before I have a go with the whole list is:

library(biomaRt)
ensembl = useDataset("btaurus_gene_ensembl", mart = ensembl)    
getBM(attributes=c("ensembl_gene_id","variation_name"),filters = c("snp_filter"),
      values="rs17870417", mart=ensembl, uniqueRows=TRUE)

But I get this error:

Error in getBM(attributes = c("ensembl_gene_id", "variation_name"), filters = c("snp_filter"),  : 
  Invalid filters(s): snp_filter 
Please use the function 'listFilters' to get valid filter names

How can I solve this error or is there another filter option for "snp_filter"? I can find the snp name on the ensembl website. Thanks in advance.

R biomaRt rsid snpname • 266 views
ADD COMMENT
1
Entering edit mode

Error is clear, "snp_filter" is not a valid filter name, check the output of listFilters(ensembl).

ADD REPLY
0
Entering edit mode

Thanks for the feedback. I have gone through the listFilters(ensembl) and listAttributes(ensembl) and I am not sure what I should set for both to get the stable snp IDs for the rs numbers.

Please help.

ADD REPLY
3
Entering edit mode
5 weeks ago

Hi,

You are using the incorrect dataset, which is why that filter cannot be found; In addition, ensembl_gene_id is not an attribute in the SNP biomaRt.

Here is a reproducible solution:

require(biomaRt)

ensembl <- useMart('ENSEMBL_MART_SNP', dataset = 'btaurus_snp')

getBM(
  attributes = c('refsnp_id',
    'chr_name', 'chrom_start','chrom_end',
    'allele', 'mapweight', 'validated', 'allele_1', 'minor_allele',
    'minor_allele_freq', 'minor_allele_count',
    'synonym_name', 'ensembl_gene_stable_id'),
  filters = c('snp_filter'),
  values = 'rs17870417',
  mart = ensembl,
  uniqueRows = TRUE)


   refsnp_id chr_name chrom_start chrom_end allele mapweight
1 rs17870417        1    78737731  78737731    A/G         1
                        validated allele_1 minor_allele minor_allele_freq
1 Frequency,Multiple_observations       NA           NA                NA
  minor_allele_count synonym_name ensembl_gene_stable_id
1                 NA           NA     ENSBTAG00000044001

Example for Homo sapeins SNP biomaRt here: How to retrieve Gene name from SNP ID using biomaRt

Kevin

ADD COMMENT

Login before adding your answer.

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