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

CHALFANT_CHRIS_M@Lilly.com CHALFANT_CHRIS_M@Lilly.com
Thu, 23 May 2002 14:03:08 -0500


Use IO::String to fake a file handle.

use IO::String;
use Bio::SeqIO;

$fh = IO::String->new($fasta_string);
$io = Bio::SeqIO->new(-fh => $fh, -format => 'Fasta');

This is a nice trick that is useful any time you have a function that 
takes a file handle as an argument but you want to hand it a string.

Chris Chalfant
Bioinformatics
Eli Lilly and Company
317-433-3407




Cory Spencer <cspencer@sprocket.org>
Sent by: bioperl-l-admin@bioperl.org
05/23/2002 01:11 PM

 
        To:     bioperl-l@bioperl.org
        cc: 
        Subject:        [Bioperl-l] Creating a Bio::SeqIO with a string




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