[Bioperl-l] LocationI and CoordinatePolicy

Heikki Lehvaslaiho heikki@ebi.ac.uk
Mon, 19 Feb 2001 14:18:55 +0000


Hilmar Lapp wrote:
> 
> I added the interface Bio::LocationI::CoordinatePolicyI and
> provided 3 implementations: WidestCoordPolicy,
> NarrowestCoordPolicy, and AvWidestCoordPolicy, implementing the
> widest possible and narrowest possible range, respectively. The
> third implements Ewan's suggestion, namely the average for BETWEEN
> (10.15) and WITHIN (10^15) positions, and the widest range for all
> others.

The CoordinatePolicy looks pretty solid now.

I had to check that the example WITHIN (10^15) is really valid. One
learns something every day!

http://www.ebi.ac.uk/embl/Documentation/FT_definitions/feature_table.html#location:

145^177       Points to a site between two adjacent bases anywhere 
              between bases 145 and 177 

> I also changed Bio::LocationI and all implementations to delegate
> start()/end() computation to the currently active
> CoordinatePolicyI object. By default all instances use the same
> instance of CoordinatePolicyI, so the object penalty memory-wise
> should be inexistant.
> 
> For clarity I reiterate the requirements for the various start/end
> methods on LocationI:
> 
>         o start() and end() return a positive integer number, unless
>         a location has never been set (like in the old model)
>         o {min,max}_{start,end} may return undef, 0, or a valid number
>         o it is the task of the CoordinatePolicyI object to come up
>         with a sensible and valid number out of a Location's min/max
> 
> Changing the policy by which start/end are calculated is a matter
> of a single line of code (see the POD of CoordinatePolicyI).
> Implementing your own policy isn't hard; there are only two
> methods.
> 
> After fixing all the bugs I introduced all tests pass (the
> different policies still need their own tests, anyone willing to
> contribute that?). Unfortunately, there's again one exception:
> LiveSeq.t. Heikki, I tried to find out what goes wrong, but I'm
> relatively clueless. E.g. in line 411 of LiveSeq::IO::Loader
> $start is undefined, but it is not crystal clear to me where that
> comes from. I'm afraid you'll have to have a look at it :o

No problem. It was my bug causing errors. I could have fixed it by
tweaking the code but now that ->start and -> end work as before I
could revert back to previous, functional code.


	-Heikki

> I hope the new Location model is hereby fully in place and settled
> down.
> 
>         Hilmar
> --
> -----------------------------------------------------------------
> Hilmar Lapp                              email: hlapp@gmx.net
> GNF, San Diego, Ca. 92122                phone: +1 858 812 1757
> -----------------------------------------------------------------
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l

-- 
______ _/      _/_____________________________________________________
      _/      _/                      http://www.ebi.ac.uk/mutations/
     _/  _/  _/  Heikki Lehvaslaiho          heikki@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
___ _/_/_/_/_/________________________________________________________