On Sun, Jul 19, 2009 at 4:18 AM, Michael Lawrence <mflawren@fhcrc.org>wrote:

>
>
> On Fri, Jul 17, 2009 at 12:07 AM, LiGang <luzifer.li@gmail.com> wrote:
>
>> Dear list,
>>
>> using rtracklayer, it's possible to retrieve data with functions
>> of 'ucscTableQuery' and 'getTable'.
>> however, these functions could only retrieve data given a genomic range.
>> For example, using following code could retrieve snps between 10000 to
>> 20000
>> basepair on chromosome 2.
>>
>> ####======================
>> library(rtracklayer)
>> browserSession("UCSC")->session
>> ucscTableQuery(session, "snp129",GenomicRanges(10000,20000, 2))->todo
>> tableName(todo)<-"snp129"
>> getTable(todo)
>> ####======================
>>
>> my question is how to retrieve data using identifiers(names/accessions).
>> for example, is it possible to retrieve chromosome position given the rs
>> number of several SNPs, such as
>> rs10003974
>> rs10087355
>> rs10075230
>> ...
>>
>> is there any function in 'rtracklayer' package can do this?
>>
>
> This type of query does not seem to be supported by the UCSC Table Browser.
> As suggested by another poster, you could use their MySQL server. A
> high-level interface to the UCSC database would be nice. I'm just not sure
> if it falls within the scope of rtracklayer. The original goal of the
> project was to represent tracks in R and interact with genome browsers. The
> table browser interface was added for downloading tracks and we supported
> arbitrary tables as well, because we got it almost for free. Something like
> biomaRt for UCSC might belong in its own package. Discussion welcome.
>

Well, I found that it is possible to do this type of query with the table
browser, and it didn't take much work to add it to rtracklayer. With 1.5.9
you can do this:

> library(rtracklayer)
Loading required package: RCurl
Loading required package: bitops
> browserSession("UCSC")->session
> query <- ucscTableQuery(session, "snp129", names = c("rs10003974",
"rs10087355", "rs10075230"))
> getTable(query)
   bin chrom chromStart  chromEnd       name score strand refNCBI refUCSC
1 1765  chr4  154710827 154710828 rs10003974     0      +       A       A
2  927  chr5   44862907  44862908 rs10075230     0      +       A       A
3  901  chr8   41531956  41531957 rs10087355     0      +       T       T
  observed molType  class                  valid    avHet  avHetSE    func
1      A/G genomic single by-frequency,by-hapmap 0.200927 0.245136  intron
2      A/G genomic single              by-hapmap 0.004751 0.048505 unknown
3      G/T genomic single                unknown 0.000000 0.000000 unknown
  locType weight
1   exact      1
2   exact      1
3   exact      1

Michael


>
> Thanks,
> Michael
>
>
>>
>> thanks!
>>
>> LiGang
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor@stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives:
>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>
>
>

	[[alternative HTML version deleted]]

