[Bioperl-l] Skipping invalid entries in GenBank

Heikki Lehvaslaiho heikki at ebi.ac.uk
Tue Mar 30 05:26:07 EST 2004


Peter,

You can wrap your calls in eval statements to recover from error, e.g in a 
loop:

eval {
    $seq = $gb->get_Seq_by_acc('J00522');
};  # the ';' character is needed here
next if $@;
# proceed working with $seq ...


It would be cleaner for modules to do this automatically. Anyone care to start 
refactoring Bio::DB modules? One way would be make them to follow 
Bio::SimpleAnalysisI rules.

	-Heikki


On Tuesday 30 Mar 2004 00:31, Peter Jun wrote:
> I'm trying to create a script that will take a list of sequence names, and
> pull the fasta sequence.  Occasionally, I will get an error message like
> this when the sequence that I'm trying to retrieve doesn't exist:
>
> ------------- EXCEPTION  -------------
> MSG: WebDBSeqI Error - check query sequences!
>
> STACK Bio::DB::WebDBSeqI::get_seq_stream
> C:/Perl/site/lib/Bio/DB/WebDBSeqI.pm:476
> STACK Bio::DB::NCBIHelper::get_Stream_by_query
> C:/Perl/site/lib/Bio/DB/NCBIHelper.pm:249
> STACK toplevel E:\perlprogs\pullseq\Search.pl:32
>
> --------------------------------------
>
> Anyway to get around this?
>
> Thanks!
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l

-- 
______ _/      _/_____________________________________________________
      _/      _/                      http://www.ebi.ac.uk/mutations/
     _/  _/  _/  Heikki Lehvaslaiho    heikki_at_ebi ac uk
    _/_/_/_/_/  EMBL Outstation, European Bioinformatics Institute
   _/  _/  _/  Wellcome Trust Genome Campus, Hinxton
  _/  _/  _/  Cambs. CB10 1SD, United Kingdom
     _/      Phone: +44 (0)1223 494 644   FAX: +44 (0)1223 494 468
___ _/_/_/_/_/________________________________________________________


More information about the Bioperl-l mailing list