[BioC] How to get sequences corresponding to a GRanges?

Cei Abreu-Goodger cei at langebio.cinvestav.mx
Mon Oct 29 01:10:29 CET 2012

Thanks Martin, that's exactly what I was looking for! (missed the 
showMethods("getSeq"), sorry)

On 10/28/12 5:49 PM, Martin Morgan wrote:
> On 10/28/2012 11:28 PM, Cei Abreu-Goodger wrote:
>> Hello all,
>> I was wondering if there was a simple way to get the sequences
>> corresponding to
>> the ranges stored in a GRanges object. If you have the original
>> sequences in a
>> BSgenome object, you can use 'getSeq'. But what if you just have the
>> fasta file,
>> imported as a DNAStringSet object?
>> I want to avoid having to forge a new BSgenome object each time, since
>> I'm
>> dealing with unfinished assemblies, with thousands of sequences that I
>> don't
>> want to split into individual fasta files, etc.
> Rsamtools has FaFile and FaFileList to represent (indexed, via indexFa)
> fasta files, and a getSeq method that takes an FaFile and a GRanges (or
> similar) object. This is built on top of scanFa. See
>    library(Rsamtools)
>    method?"getSeq,FaFile"
> Martin
>> Many thanks,
>> Cei

Dr. Cei Abreu-Goodger
Profesor Investigador
Tel: (52) 462 166 3006
cei at langebio.cinvestav.mx

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

More information about the Bioconductor mailing list