[BioC] extracting sequence from a genome

Steve Lianoglou mailinglist.honeypot at gmail.com
Thu Mar 15 18:42:00 CET 2012


Howdy,

On Thu, Mar 15, 2012 at 1:10 PM, Tim Triche, Jr. <tim.triche at gmail.com> wrote:
> what you want to do is create a Ranges object and then get a View of the
> sequences.
>
>
> library(Biostrings)
> library(GenomicRanges)
> mirs <- GRanges( paste('chr', mirInfo[i,1], sep=''),
>                 IRanges(start=mirInfo[i,4], width=1),
>                 strand=whereverYouKeepTheStrand )
> upstream <- flank(mirs, 200)
> upseqs <- Views(Rnorvegicus, mirs)
> show(upseqs)
>
> Untested because I am lazy as hell, but it should work, and be a LOT faster.

Maybe in R 2.16 ...

R> Views(Hsapiens, GRanges(c('chr1', 'chr2'), IRanges(c(6e6, 6e6),
width=10), '+'))
Error in function (classes, fdef, mtable)  :
  unable to find an inherited method for function "Views", for
signature "BSgenome"

;-)

-steve

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact



More information about the Bioconductor mailing list