[Bioperl-l] How to get rid of warnings

Jérémy JUST jeremy_just at netcourrier.com
Fri Aug 18 13:51:41 UTC 2006


    Hello,

  I can't manage to get rid of all warnings during a query from GenBank
with BioPerl 1.4. When the query doesn't give any result, I catch the
exception, but there is still a warning that is issued to STDERR.

  This is my code:

<<<<<<<<
#!/usr/bin/perl

use strict ;
use warnings ;

use Bio::DB::GenBank ;

my $gb = Bio::DB::GenBank->new( -verbose => -1 ) ;

my $query = Bio::DB::Query::GenBank->new
               (-query   => "FooBar",
                -db      => 'nuccore',
                -verbose => -1
               ) ;

my $seqio ;
eval
  {$seqio = $gb->get_Stream_by_query( $query ) ;
  } ;

if ( $@ )
  {print STDERR "Cannot find a sequence for FooBar\n" ;
  }

exit 0 ;
>>>>>>>>

and the unwanted warning is:
<<<<<
Warning(s) from GenBank: 
                <PhraseNotFound>FooBar</PhraseNotFound>
>>>>>

  How could I set verbosity so that I don't get this warning?


  Thanks,

-- 
Jérémy JUST  <jeremy_just at netcourrier.com>



More information about the Bioperl-l mailing list