trim

trim(tree, ranges)[source]

Return an IntervalTree trimmed to the specified ranges.

Ranges are specified as tuples of (begin, end).

Parameters:
  • tree -- the IntervalTree to trim

  • ranges -- a list of range tuples

Returns:

the trimmed IntervalTree