[Bioperl-l] a PerlIO layer for Bio::SeqIO

Mark A. Jensen maj at fortinbras.us
Thu Oct 22 19:03:52 EDT 2009

Because it's fun! Also:

use CGI;
use PerlIO::via::SeqIO;
use strict;
use warnings;
my $q = new CGI;
my ($seqfh, $dup);
open($seqfh, "<:via(SeqIO)", 'test.fas');
open(STDOUT, ">:via(SeqIO::fasta)");

my $s = <$seqfh>;

print (
    "Copy the desired format from the boxes below:<br><br>",
    $q->div({-style=>"border:solid 1px black"},
(tied *STDOUT)->set_write_format('embl');
print (
    $q->div({-style=>"border:solid 1px black"},
(tied *STDOUT)->set_write_format('gcg');
print (
    $q->div({-style=>"border:solid 1px black"},

----- Original Message ----- 
From: "Smithies, Russell" <Russell.Smithies at agresearch.co.nz>
To: "'Mark A. Jensen'" <maj at fortinbras.us>; "'BioPerl List'" 
<bioperl-l at bioperl.org>
Sent: Thursday, October 22, 2009 6:57 PM
Subject: RE: [Bioperl-l] a PerlIO layer for Bio::SeqIO

Why anyone would want to do it this way is the only thing that's bugging me  ;-)
Maybe I'm a bit dense this morning but what's the advantage?

(I need more coffee)

> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
> bounces at lists.open-bio.org] On Behalf Of Mark A. Jensen
> Sent: Friday, 23 October 2009 11:24 a.m.
> To: BioPerl List
> Subject: [Bioperl-l] a PerlIO layer for Bio::SeqIO
> Hi All:
> Have you ever wanted to do this?
>  open($f, "<:via(SeqIO)", "my.fas");
>  open($g, ">:via(SeqIO::embl)", "my.fas.embl");
>  while (<$f>) { print $g $_; }
> Or this?
>  open($f, "<:via(SeqIO)", "my.fas");
>  open(STDOUT, ">:via(SeqIO::fasta)");
>  $seq = <$f>;
>  print "The following is an example of FASTA format:", $seq;
> Or even this?
>  (tied *STDOUT)->set_write_format('gcg');
>  print "While this is an example of GCG:", $seq;
> Now you can, and much more. See
> http://search.cpan.org/search?query=PerlIO::via::SeqIO
> Send me the bugs.
> cheers,
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.

More information about the Bioperl-l mailing list