[Bioperl-l] Creating a Bio::SeqIO with a string

Jason Stajich jason@cgt.mc.duke.edu
Thu, 23 May 2002 14:51:29 -0400 (EDT)


I will add this to the FAQ.  Eventually we'll have the FAQ webified
or linked from the bio.perl.org webpage.

Basically:
use IO::String;
use Bio::SeqIO;
my $stringfh = new IO::String($string);

my $seqio = new Bio::SeqIO(-fh => $stringfh, -format => 'fasta');

while( my $seq = $seqio->next_seq ) {
}

-jason

On Thu, 23 May 2002, Cory Spencer wrote:

>
> Hi folks -
>
> Is there any way to create a Bio::SeqIO object that reads successive
> sequences from a string?  (ie. The string contains one or more FASTA
> formatted sequences, and I'd like to be able to create a Bio::SeqIO object
> (or something like it) directly from the string, as opposed to writing out
> the string to a temporary file, and then opening that.)
>
> --
> Cory Spencer <cspencer@sprocket.org>
>
> _______________________________________________
> 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