[Bioperl-l] bioperl filehandles

Tony Cox avc at sanger.ac.uk
Tue Jan 28 14:23:10 EST 2003



I have just tweaked the SeqIO:scf module so that it will support
IO::String-based filehandles. I wanted to do this so that I can process a lot of
scf files without having to use intermediate disk files:

my $scf = <...binary rubbish...>
my $io = IO::String->new($scf);
my $in = Bio::SeqIO->new( '-fh' => $io, '-format' => 'scf');
my $seq = $in->next_seq();
etc,etc

To get this to work I had to choose whether to call "binmode" since this is not
supported by IO:string but I also had to change the way that the seek commands
were called. Instead of

seek ($fh, $offset, 0);

I changed it to:

$fh->seek($offset,0);

I'm thinking this is OK and it works fine. I believe that perl filehandles
implement a generic interface that include seek so it shouldn't break anything.
However, I just wanted to check that I havn't missed something before commiting
the change.

thanks

Tony



More information about the Bioperl-l mailing list