[Bioperl-l] Parsing sequence records in memory
Ewan Birney
birney@ebi.ac.uk
Sun, 15 Dec 2002 22:38:21 +0000 (GMT)
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>.
-----------------------------------------------------------------