bioperl / bioperl-live

Core BioPerl 1.x code
http://bioperl.org
299 stars 182 forks source link

Error thrown in OBO file parsing #341

Open AndyMenzies opened 4 years ago

AndyMenzies commented 4 years ago

When parsing OBO ontology files the following block is causing issues

https://github.com/bioperl/bioperl-live/blob/757470f70f0cc64a53576762d47ca88cbfb2f703/lib/Bio/OntologyIO/obo.pm#L248

The error message states that a term has no ID or name, and that the term will be ignored. However it does this via a $self->throw call which raises an exception and causes the parsing to be unavoidably interrupted. The throw call is followed by a next which would skip the term if it could get there.

Which behaviour is intended? Is the malformed term supposed to be skipped, or is the parser supposed to error out?

cjfields commented 4 years ago

@AndyMenzies can you point to an example file throwing the error so this could be tested?

AndyMenzies commented 4 years ago

@cjfields I think I was trying to parse Uberon at the time, its quite large and I don't have a concise file that triggers the problem.

http://purl.obolibrary.org/obo/uberon/ext.obo