[Bioperl-l] searchio scripts
Lincoln Stein
lstein at cshl.edu
Wed Feb 18 07:57:24 EST 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Or do this:
my $in = Bio::SearchIO->new(-format=>'blast',-fh=>\*ARGV);
while (my $result = $in->next_result()) {
...
}
That might even be easier.
Lincoln
On Wednesday 18 February 2004 12:27 pm, Steve Chervitz wrote:
> Looks like there was a change in the Root::IO.pm module that
> affects the way these scripts process command-line arguments. As of
> bioperl-1.303, the SearchIO::blast module appears to be unable to
> read data from STDIN or files listed in @ARGV. This affects the
> scripts in examples/searchio and scripts/searchio.
>
> As a workaround, I'd recommend you iterate over @ARGV in your
> script and initialize the SearchIO object using the -file option to
> new(), as in:
>
> while (my $file = shift @ARGV) {
> my $in = Bio::SearchIO->new( -format => 'blast',
> -file => $file
> );
> while ( my $result = $in->next_result() ) {
> # process result...
> }
> }
>
> As far as tracking down the cause, I've pinpointed the following
> change in Bio::Root::IO::_readline():
>
> my $fh = $self->_fh or return; # revision 1.50
> (bioperl-1.303)
>
> formerly this was:
>
> my $fh = $self->_fh || \*ARGV; # revision 1.49
> (bioperl-1.302)
>
> This also appears to break SeqIO reading from STDIN. Try executing
> this at the top-level distribution dir for the 1.302 and 1.303
> releases:
>
> perl -I. ./scripts/seq/translate_seq.PLS -format fasta <
> t/data/dna1.fa
>
> According to Lincoln's commit log, the Root::IO::_readline() change
> was necessary to get the GFF, SeqFeature, and Registry regression
> tests working. I tested these tests with the 1.49 version of IO.pm
> and the only one that was affected was SeqFeature.t. Specifically,
> test #6 which calls SeqFeature::Generic::gff_string() hangs and
> waits for input before proceeding. I'm not sure why this is...
> (getting late).
>
> BTW, platforms tested: Perl 5.6.1 and 5.8.0 on Linux (RH9) and Perl
> 5.8.1-RC3 on MacOS X (10.3.2).
>
> Steve
>
> On Feb 17, 2004, at 3:14 PM, Richard Rouse wrote:
> > I recent installed bioperl-1.4 and am having problems with the
> > blast report
> > parsers in /examples/searchio/
> >
> >
> > When I run:
> > perl hitwriter.pl blastreport
> > I get:
> >
> > Using SearchIO->new()
> >
> > 0 Blast report(s) processed.
> > Output sent to file: >hitwriter.out
> >
> > I get the same result with rawwriter.pl, hspwriter.pl and
> > custom_writer.pl
> > although the htmlwriter.pl and the blast_example.pl work fine.
> >
> > Has anyone else encountered this problem and figured out how to
> > fix it?
> >
> > Thanks,
> >
> > Richard
> >
> >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at portal.open-bio.org
> > http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
- --
Lincoln D. Stein
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQFAM2E00CIvUP7P+AkRAurTAJ9gwb4Os0M5uDWhlE40JphLRIAG+gCfQ5Ji
zXHLGwtfDAB2Np2nKBZkuw0=
=IsKs
-----END PGP SIGNATURE-----
More information about the Bioperl-l
mailing list