[Bioperl-l] question about in-between overlapping exact location
cjfields at illinois.edu
Wed May 6 10:26:35 EDT 2009
We should definitely come up with some test cases and expected results
for this; e.g. whether 2^3 should overlap with 1..2 or 3..5, etc (I
would guess, in the latter example, they shouldn't).
Also, as these are LocationI-specific, I'm not sure we should make
changes to RangeI methods. Maybe fix LocationI-specific bits within
LocationI and delegate to RangeI::overlaps/etc in simple cases?
On May 6, 2009, at 6:54 AM, Hilmar Lapp wrote:
> This sounds like a bug to me - the location type should be taken
> into account, shouldn't it?
> Would you mind submitting this (and a patch if you have one :) to
> On May 6, 2009, at 12:17 AM, George Hartzell wrote:
>> Jason Stajich writes:
>>> George -
>>> I don't think the location type is taken into account in the overlap
>>> code testing code. Would you expect 2..3 and 3..5 to overlap?
>>> On May 5, 2009, at 2:42 PM, George Hartzell wrote:
>>>> I was surprised to see that:
>>>> $ins = Bio::Location::Simple->new(-start => 2,
>>>> -end => 3,
>>>> -location_type => 'IN-BETWEEN',
>>>> $start = Bio::Location::Simple->new(-start => 3,
>>>> -end => 5);
>>>> print "Wow!\n" if $start->overlaps($ins);
>>>> To my mind they would only overlap if the insertion were 3^4 or
>>>> Is my mental model of in-between's overlapping exact's wrong, or
>>>> the code be improved (I'm happy to make a change, but...)?
>> Yep, I'd expect them to overlap.
>> 1 2 3 4 5
>> A T
>> T A A
>> I'm trying to ask a question like the following. Given a location
>> that describes an e.g. start codon (3..5) and a description of a
>> mutation, does the mutation cause a change in the ATG. Substitutions
>> are described with exact locations (change bases 3..4 from AT to TA)
>> and insertions are modeled as in-between locations (insert G at 3^4).
>> 1 2 3 4 5 6
>> A T G
>> T G C C
>> Given 3..5, I can just ask if 3..4 overlaps it (yes), if 3 overlaps
>> (yes) and if 3^4 overlaps it (yes). For things to work out this
>> easily, 2^3 shouldn't overlap (an insertion there wouldn't change the
>> I can get the in-between to work by using RangeI->contains, but
>> then I
>> end up with 1..4 not "causing a change".
>> I've ended up with a two part if() that checks the location_type and
>> uses ->overlap() or ->contains() so that it works out.
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
> : Hilmar Lapp -:- Durham, NC -:- hlapp at gmx dot net :
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
More information about the Bioperl-l