[Biojava-l] Remote location exception

Thomas Down td2@sanger.ac.uk
Wed, 22 Aug 2001 10:54:14 +0100


On Wed, Aug 22, 2001 at 09:54:14AM +0100, Keith James wrote:
> 
>     Michael> <p>I can live with this, but I would like to catch the
>     Michael> exception in my code so that I can skip further
>     Michael> calculations. The exception is apparently caught
>     Michael> somewhere in biojava. I've tried working backwards from
>     Michael> the EmblLikeLocationParser class, but I can't find
>     Michael> it. Does anyone have any clues?
> 
> >From memory this is happening in EmblProcessor (SwissprotProcessor
> does the same), allowing reading past unsupported features.
> 
> I think what we need is a SeqIOErrorHandler analagous to the XML
> ErrorHandler so that a choice could be made between swallowing the
> errors and throwing Exceptions?
> 
> I'll do this if there is some general support for the idea.
> 
> To avoid breaking existing code I'm thinking of registering a default
> error handler which emulates current behaviour.

This has come up serveral times before -- I guess it might
be the single biggest open issue in BioJava.  We've spent
a lot of time arguing over the `right thing' to do in these
cases -- one suggestion which came up was to have special
RemoteFeatures for this case.  Matthew wrote an interface for
these, which looks okay, but there doesn't seem to have been
much enthusiasm about implementing them.

I think Keith may well have a point here -- about the only
thing that everyone can agree about these split locations
is that they're a real pain.  Maybe it's better to just
abstract out their processing, and let the user choose.
Certainly, there are a number of reasonable behaviours,
depending on what you're doing:

  - Skip the sequence

  - Skip just that feature
  
  - Abort the whole job (screaming exception)

  - Create a RemoteFeature

  - Create a truncated feature, with the correct type, but only
    covering the `local' segments of the actual location.

  - (Anybody think of anything else?)

If you do implement this, it would be good to try out the
RemoteFeatures in anger at the same time, and see how well
they actually do work.


   Thomas.