Interval#
- class alphagenome.data.genome.Interval(chromosome, start, end, strand='.', name='', info=<factory>)[source]#
Represents a genomic interval.
A genomic interval is a region on a chromosome defined by a start and end position. This class provides methods for manipulating and comparing intervals, and for calculating coverage and overlap.
- chromosome#
The chromosome name (e.g., ‘chr1’, ‘1’).
- start#
The 0-based start position.
- end#
The 0-based end position (must be greater than or equal to start).
- strand#
The strand of the interval (‘+’, ‘-’, or ‘.’). Defaults to ‘.’ (unstranded).
- name#
An optional name for the interval.
- info#
An optional dictionary to store additional information.
- negative_strand#
True if the interval is on the negative strand, False otherwise.
- width#
The width of the interval (end - start).
Methods
Returns an unstranded copy of the interval. |
|
|
Boolean mask True if any interval overlaps the bin: coverage > 0. |
|
Stranded boolean mask that is True where any interval overlaps the bin. |
|
Extends or shrinks the interval by adjusting the positions with padding. |
|
Computes the center of the interval. |
|
Checks if this interval completely contains another interval. |
|
Returns a deep copy of the interval. |
|
Computes coverage track from sequence of intervals overlapping interval. |
|
Computes a coverage track from intervals overlapping this interval. |
|
Creates an Interval from a dictionary. |
|
Creates an Interval from a string (e.g., 'chr1:100-200:+'). |
|
Returns the intersection of this interval with another interval. |
|
Returns overlapping ranges from intervals overlapping this interval. |
|
Checks if this interval overlaps with another interval. |
|
Pads the interval by adding the specified padding to the start and end. |
|
Resizes the interval to a new width, centered around the original center. |
|
Shifts the interval by the given offset. |
Swaps the strand of the interval. |
|
Converts the interval to a dictionary. |
|
|
Truncates the interval to fit within the valid reference range. |
|
Checks if the interval is within the valid reference range. |