[Bioperl-l] proposed changes to RangeI.pm

Chris Mungall cjm at fruitfly.org
Tue Sep 30 21:42:45 EDT 2003


I have committed this. hopefully it shouldn't break anyone's code

note that CoordinateMapper.t fails, but this seems to fail with or without
this change

cheers
Chris

On Wed, 17 Sep 2003, Chris Mungall wrote:

>
> both intersection() and union() are documented as returning a (start, end,
> strand) triple. in actual fact, intersection returns a RangeI compliant
> object, and union() returns either a RangeI object or a triple depending
> on wantarray()
>
> I have fixed things so that both intersection() and union() return either
> RangeI or triple depending on wantarray() - following the principle of
> least surprise - and documented this. The test suite passes.
>
> This will break code like this:
>
>  $h = { 'range' => $sf->intersection($sf2) }
>
> since wantarray will be true here; however, this code violates the
> previously documented interface anyway.
>
> I have also added a new method disconnected_ranges() to RangeI
>
> I could easily migrate this method somewhere else, but it seems to belong
> with other geometrical methods such as intersection and union
>
> here is the pod docs:
>
>
>     Title   : disconnected_ranges
>     Usage   : my @disc_ranges = Bio::Range->disconnected_ranges(@ranges);
>
>     Function: finds the minimal set of ranges such that each input range
>               is fully contained by at least one output range, and none of
>               the output ranges overlap
>     Args    : a list of ranges
>     Returns : a list of objects of the same type as the input (conforms to
> RangeI)
>
> =cut
>
>
> is this a good time to check these changes in?
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>




More information about the Bioperl-l mailing list