[BioC] rs ids Retrieval using biomaRt

Ovokeraye Achinike-Oduaran ovokeraye at gmail.com
Sat Nov 3 13:38:31 CET 2012


Thanks Vincent. You are right about the filters. One more thing: how
would this work with a batch input "values" list i.e reading the
positions from a file? For example:

CHR
1, 11182261, 11182261
1, 11264032, 11264032
1, 11264036, 11264036
1, 11282246, 11282246
1, 11292945, 11292945
1, 11306660, 11306660
1, 11314655, 11314655

Using the same code but specifying values = AFRASN$CHR gives me an
error --"Error in getBM(attributes = c("refsnp_id", "allele",
"chr_name", "chrom_strand",  :   If using multiple filters, the
'value' has to be a list...."

Thanks again.

Regards,

Avoks
On Sat, Nov 3, 2012 at 1:46 PM, Vincent Carey
<stvjc at channing.harvard.edu> wrote:
>
>
> On Sat, Nov 3, 2012 at 6:15 AM, Ovokeraye Achinike-Oduaran
> <ovokeraye at gmail.com> wrote:
>>
>> Hi all,
>>
>> I've been trying to retrieve SNP rsids using biomaRt for a number of
>> SNPs where I have their positions. My input file looks like this:
>>
>> 1 888899000 888899000
>>
>> where,
>> 1 = chromosome number and the second and third numbers are the
>> position of the SNP.
>>
>> My code looks like this:
>>
>> library(biomaRt)
>> mart2 = useMart(biomart="snp", dataset="hsapiens_snp")
>> AFRASN=read.delim("AFR_ASN_neg8P_no_rsids.txt", header = TRUE)
>> results = getBM(attributes = c("refsnp_id", "allele","chr_name",
>>         "chrom_strand","consequence_type_tv"),
>>         filters = "chromosomal_region", values = AFRASN$CHR, mart = mart2)
>>
>> I must be doing something wrong because it's not working for me. Any
>> suggestions will be greatly appreciated.
>>
>
> your filter/value spec does not seem valid.  i do not know how to determine
> validity.  but
> the following yields 23 records
>
> results = getBM(attributes = c("refsnp_id", "allele","chr_name",
>         "chrom_strand","consequence_type_tv"),
>         filters = c("chr_name", "chrom_start", "chrom_end"),
> values=list("20",
>      100000, 101000), mart=mart2)
>
>
>>
>> > sessionInfo()
>> R version 2.15.0 (2012-03-30)
>> Platform: i386-pc-mingw32/i386 (32-bit)
>>
>> locale:
>> [1] LC_COLLATE=English_.1252  LC_CTYPE=English_.1252
>> [3] LC_MONETARY=English_.1252 LC_NUMERIC=C
>> [5] LC_TIME=English_.1252
>>
>> attached base packages:
>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>
>> other attached packages:
>> [1] biomaRt_2.12.0
>>
>> loaded via a namespace (and not attached):
>> [1] RCurl_1.91-1.1 XML_3.9-4.1
>> >
>>
>> Regards,
>>
>> Avoks
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives:
>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>
>



More information about the Bioconductor mailing list