[Bioperl-l] Hilmar and Ewan debate SeqFeatures some more...

Mark Dalphin mdalphin@amgen.com
Fri, 19 Jan 2001 14:27:19 -0800

Ewan Birney wrote:

> On Fri, 19 Jan 2001, Hilmar Lapp wrote:
> Hilmar. I agree with all your statements basically, but I'm still sticking
> to my claims. I think we need to hear more feedback - I'd be really
> interested in david's call on the defaultness of ->start not throwing an
> exception.

I would rather NOT have an exception thrown.  It is too hard to recover from
that.  In fact, for much code, either the maximum, minimum or average really
doesn't matter (for example, on many displays, the same set of pixels will be
lit up) and the client program will need to make that choice in anycase.  As a
"compromise", I wonder about having ->start() return 'a value' in a SCALAR
context, basically continuing what it now does, while in an ARRAY context, it
might return something like:
    ($start, $fuzzy_type, $fuzzy_value) = $obj->start().

This way, the client can obtain the data, if desired, or ignore it.

I don't know how to defined "fuzzy_type", but it would be something like { '<' |
'>' | '.' } representing the NCBI types '<', '>' and '.' (ie extends-5-prime,
extends-3-prime and between-two-values).  Then $start would be either the
lowest, highest or average value and $fuzzy_value would represent the distance
around it. (BTW, I tried using the average +- $fuzzy_value and found the code
messy. It seems to be tidier to use: $start is the most extreme point (5' or 3')
and $fuzzy value brings you inwards).

Finally, the code could be written to make a SCALAR $start return one of the
above (min, max, avg) OR throw and exception as a parameter.  But I don't think
it is worth the trouble.

Just my $0.02.


Mark Dalphin                          email: mdalphin@amgen.com
Mail Stop: 29-2-A                     phone: +1-805-447-4951 (work)
One Amgen Center Drive                       +1-805-375-0680 (home)
Thousand Oaks, CA 91320                 fax: +1-805-499-9955 (work)