[Bioperl-l] skip "exception"

Qunfeng qfdong at iastate.edu
Sun Sep 26 16:26:35 EDT 2004

In my case, if I simply want to ignore the exception and proceed with the 
next seq object in my input file, the following code seems to be working 
for me:

                 $seq_object = $seqio_object->next_seq;
                 print STDERR "EXCEPTION FOUND; SKIP THIS OBJECT\n";

However, it might be nice if I can still work on the bad object and parse 
out the good part out of it.


At 01:18 PM 9/26/2004 -0400, Stefan Kirov wrote:
>Sometimes it is not reasonable to continue after an error, but Qunfeng has 
>a point. Maybe we can add to at least some parsers an option like 
>-ignore=>{number of allowed exceptions}, warn if the parser generates less 
>errors than tne number requested by the user, die if the number becomes 
>Any thoughts on this?
>Qunfeng wrote:
>>When I try to use Bioperl to parse genbank sequence file downloaded from 
>>NCBI, I am getting the following "exception" with sequence (acc# 
>>AJ635582). It seems to be the format problem in this genbank file.
>>My question is: is there any way in bioperl for users to test if there is 
>>any format problem in the sequence object and then decide by the users if 
>>they want to throw an exception or simply skips to the next object? Thanks!
>>-------------------- WARNING ---------------------
>>MSG: exception while parsing location line [1163^1163] in reading 
>>EMBL/GenBank/SwissProt, ignoring feature variation (seqid=AJ6355
>>------------- EXCEPTION  -------------
>>MSG: Only adjacent residues when location type is IN-BETWEEN. Not [1163] 
>>and [1163]
>>STACK Bio::Location::Simple::location_type 
>>STACK Bio::Location::Simple::new 
>>STACK Bio::Factory::FTLocationFactory::_parse_location 
>>STACK Bio::Factory::FTLocationFactory::from_string 
>>STACK (eval) /usr/lib/perl5/site_perl/5.8.0/Bio/SeqIO/FTHelper.pm:124
>>STACK Bio::SeqIO::FTHelper::_generic_seqfeature 
>>STACK Bio::SeqIO::genbank::next_seq 
>>Bioperl-l mailing list
>>Bioperl-l at portal.open-bio.org
>Stefan Kirov, Ph.D.
>University of Tennessee/Oak Ridge National Laboratory
>1060 Commerce Park, Oak Ridge
>TN 37830-8026
>tel +865 576 5120
>fax +865 241 1965
>e-mail: skirov at utk.edu
>sao at ornl.gov

More information about the Bioperl-l mailing list