Author: | Andreas Heger |
---|---|
Release: | $Id$ |
Date: | December 09, 2013 |
Tags: | Python |
combine intervals.
Overlapping intervals are concatenated into larger intervals.
truncates all intervals that are extending beyond first or last.
Empty intervals are deleted.
complement a list of intervals with intervals not in list.
complement a list of intervals with intervals not in list and return both.
combine a list intervals and merge those that are less than a certain distance apart.
combine a list of non-overlapping intervals, and delete those that are too small.
combine intervals.
Overlapping intervals are reduced to their intersection.
remove intervals that are fully contained in another.
[(10, 100), (20, 50), (70, 120), (130, 200), (10, 50), (140, 210), (150, 200)]
results:
[(10, 100), (70, 120), (130, 200), (140, 210)]
remove intervals that are full covering another, i.e. always keep the smallest.
[(10, 100), (20, 50), (70, 120), (40,80), (130, 200), (10, 50), (140, 210), (150, 200)]
result:
[(20, 50), (40, 80), (70, 120), (150, 200)]
shorten intervals, so that there is no overlap with another set of intervals.
assumption: intervals are not overlapping
iterate over the combination of two intervals.
returns the truncated intervals delineating the ranges of overlap between intervals1 and intervals2.
intersect two interval sets.
Return a set of intervals that is spanned by intervals in both sets. Returns the union of the two intervals.
return sum of intervals.
truncate intervals in intervals1 by intervals2
Example: truncate( [(0,5)], [(0,3)] ) = [(3,5)]
calculate overlap between intervals.
The intervals within each set should not be overlapping.
get intervals from a binary array.