This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Trying to annotate M. musculus SNPs but getting: Error in martCheck(mart)

Hi,

I'm trying to get information about some SNPs from BioMart but I'm getting and error with the mart and haven't been able to figure out how to fix it. This is what I've written:

data = read.csv("SNP_positions.csv")

snpmart = useMart("ENSEMBL_MART_SNP", dataset="mmusculus_snp")

out = getBM(attributes=c("refsnp_id","chr_name","chrom_start","chrom_strand","allele","consequence_type_tv","ensemble_gene_stable_id","ensembl_type","reg_feature_stable_id","reg_consequence_types"), filters=c("chr_name","chrom_start","chrom_end", values=data, mart=snpmart))

 Error in martCheck(mart) : 
  You must provide a valid Mart object. To create a Mart object use the function: useMart.  Check ?useMart for more information.

I can view all the attributes and filters in the mart so I know I selected what I needed, I just don't know why I'm getting this error. Any help is greatly appreciated!

r snp biomart

2 answers

In your getBM() function, the values and mart parameters are inside the filters parameter.

Thanks for finding my mistake!

Thanks! I can't believe I missed that :)

This should have gone under @igor's answer (using "Add Comment") instead of a new answer.

Log in to answer this question.