gnomad.utils.intervals

gnomad.utils.intervals.sort_intervals(intervals)

Sort an array of intervals by start contig, then start position, then end contig, then end position.

gnomad.utils.intervals.union_intervals(intervals)

Generate a list with the union of all intervals in the input list by merging overlapping intervals.

gnomad.utils.intervals.interval_length(interval)

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 merge

  • is_sorted (bool) – If set, assumes intervals are already sorted, otherwise will sort.

Returns:

List of merged intervals

gnomad.utils.intervals.interval_length(interval)[source]

Return the total number of bases in an Interval.

Parameters:

interval (Interval) – Input interval

Return type:

int

Returns:

Total length of the interval