[Bioperl-l] difference in opening file from @ARGV and STDIN?

Dave Messina David.Messina at sbc.su.se
Thu Sep 11 07:21:51 EDT 2008


Hi Felipe,

Specifying STDIN via a '-' argument to the -file parameter is not valid.
While that is a convention with some UNIX tools, it's not, as far as I know,
something you should be able to count on.

In BioPerl, one can specify STDIN by passing the \*STDIN filehandle glob to
the -fh parameter (NOT to -file).

In other words,

my $align = Bio::AlignIO->new(-fh => \*STDIN)->next_aln;

That is a convention in BioPerl, so the -file and -fh parameters should work
the same way in AlignIO, SearchIO, SeqIO, etc.

Take a look at the beginners' HOWTO for some examples.
http://www.bioperl.org/wiki/HOWTO:Beginners


Dave


More information about the Bioperl-l mailing list