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



Source link