[Bioperl-l] Parsing sequence records in memory

Jason Stajich jason@cgt.mc.duke.edu
Sun, 15 Dec 2002 17:50:00 -0500 (EST)


This is also in the FAQ.

-jason
On Sun, 15 Dec 2002, Ewan Birney wrote:

> On Sun, 15 Dec 2002, Peter Schattner wrote:
>
> > Hi folks
> >
> > A question.
> >
> > If I have, say, a fasta sequence or Genbank record stored in a perl variable
> > in memory (either the complete record in a scalar or each line as an entry in
> > an array), is it possible to have SeqIO parse that record and create a Seq
> > object directly?  That is, without printing the record to a file first and
> > then reading it back in with SeqIO.  (I guess writing records to a file is
> > not such a big deal, but I would prefer not to be creating and destroying
> > lots of temporary files)
> >
>
> use  IO::String, the syntax is in the Bio::SeqIO documentation
>
> my $stringio = IO::String->new($string);
> my $out =bBio::SeqIO->new('-fh' => $stringio,
>                           '-format' => 'fasta');
>
>
>
>
>
>
> > TIA
> >
> > Peter
> >
> >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l@bioperl.org
> > http://bioperl.org/mailman/listinfo/bioperl-l
> >
>
> -----------------------------------------------------------------
> Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
> <birney@ebi.ac.uk>.
> -----------------------------------------------------------------
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu