gnomad.utils.intervals
|
Sort an array of intervals by start contig, then start position, then end contig, then end position. |
|
Generate a list with the union of all intervals in the input list by merging overlapping intervals. |
|
Return the total number of bases in an Interval. |
- gnomad.utils.intervals.sort_intervals(intervals)[source]
Sort an array of intervals by start contig, then start position, then end contig, then end position.
- Parameters:
intervals (
List
[Interval
]) – Intervals to sort- Returns:
Sorted interval list
- gnomad.utils.intervals.union_intervals(intervals, is_sorted=False)[source]
Generate a list with the union of all intervals in the input list by merging overlapping intervals.
- Parameters:
intervals (
List
[Interval
]) – Intervals to mergeis_sorted (
bool
) – If set, assumes intervals are already sorted, otherwise will sort.
- Returns:
List of merged intervals