[Bioperl-l] Re: SeqIO bug report

Hilmar Lapp hlapp@gmx.net
Wed, 20 Dec 2000 01:54:59 -0800


bioperl-bug-admin@bioperl.org wrote:
> 
> 
> The following program (change the location of the test
> genbank file)
> 
> -------------- program ------------------------
> #!/usr/local/bin/perl -w
> 
> use strict;
> use Bio::SeqIO;
> 
> my $genbank_file = "/home/kris/src/cvs/bioperl/bioperl-live/t/test.genbank";
> my $seqin = Bio::SeqIO->new(-file => $genbank_file, -format => 'genbank');
> my $seqout = Bio::SeqIO->new(-file => ">pir.out", -format => 'pir');
>         while (my $seq = $seqin->next_seq() ) {
>                 $seqout->write_seq($seq);
>         }
> print STDOUT "wrote pir file\n";
> my $seqin = Bio::SeqIO->new(-file => "pir.out", -format => 'pir');

I suppose this is not the cause of the error you see but be aware that
opening a stream on a file you haven't closed yet may give unexpected
results. You should either first

	$seqout = undef;

or (cleaner) call

	$seqout->close();

With either of these in effect, does the error persist? (Probably it
does.)

	Hilmar

> my $seqout = Bio::SeqIO->new(-file => ">ttt", -format => 'gcg'); # whatever
>         while (my $seq = $seqin->next_seq() ) {
>                 $seqout->write_seq($seq);
>         }
> -------------------- end program -------------
> 
> gives the following output
> 
> [ warnings about parsing genbank file ]
> wrote pir file
> 
> -------------------- EXCEPTION --------------------
> MSG:
> CONTEXT: Error in uNKNOWN CONTEXT
> SCRIPT: seqtest_pir.pl
> STACK:
> Bio::Root::RootI::new(87)
> Bio::SeqIO::pir::next_seq(111)
> main::seqtest_pir.pl(15)
> ---------------------------------------------------
> 
> _______________________________________________
> Bioperl-guts-l mailing list
> Bioperl-guts-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-guts-l

-- 
-----------------------------------------------------------------
Hilmar Lapp                                email: hlapp@gmx.net
GNF, San Diego, Ca. 92122                  phone: +1 858 812 1757
-----------------------------------------------------------------