Junction#

class alphagenome.data.genome.Junction(chromosome, start, end, strand='.', name='', info=<factory>, k=None)[source]#

Represents a splice junction.

A splice junction is a point in a pre-mRNA transcript where an intron is removed and exons are joined during RNA splicing. This class inherits from Interval and adds properties and methods specific to splice junctions.

chromosome#

The chromosome name.

start#

The 0-based start position of the junction.

end#

The 0-based end position of the junction.

strand#

The strand of the junction (‘+’ or ‘-‘).

name#

An optional name for the junction.

info#

An optional dictionary to store additional information.

k#

An optional integer representing the number of reads supporting the splice junction.

negative_strand#

True if the junction is on the negative (‘-’) strand.

acceptor#

Position of the splice acceptor site.

donor#

Position of the splice donor site.

Raises:

ValueError – If the strand is unstranded.

Methods

acceptor_region([overhang])

Returns the region around the acceptor site with overhang.

as_unstranded()

Returns an unstranded copy of the interval.

binary_mask(intervals[, bin_size])

Boolean mask True if any interval overlaps the bin: coverage > 0.

binary_mask_stranded(intervals[, bin_size])

Stranded boolean mask that is True where any interval overlaps the bin.

boundary_shift([start_offset, end_offset, ...])

Extends or shrinks the interval by adjusting the positions with padding.

center([use_strand])

Computes the center of the interval.

contains(interval)

Checks if this interval completely contains another interval.

copy()

Returns a deep copy of the interval.

coverage(intervals, *[, bin_size])

Computes coverage track from sequence of intervals overlapping interval.

coverage_stranded(intervals, *[, bin_size])

Computes a coverage track from intervals overlapping this interval.

dinucleotide_region()

Returns the dinucleotide regions around acceptor and donor sites.

donor_region([overhang])

Returns the region around the donor site with overhang.

from_interval_dict(interval)

Creates an Interval from a dictionary.

from_str(string)

Creates an Interval from a string (e.g., 'chr1:100-200:+').

intersect(interval)

Returns the intersection of this interval with another interval.

overlap_ranges(intervals)

Returns overlapping ranges from intervals overlapping this interval.

overlaps(interval)

Checks if this interval overlaps with another interval.

pad(start_pad, end_pad, *[, use_strand])

Pads the interval by adding the specified padding to the start and end.

resize(width[, use_strand])

Resizes the interval to a new width, centered around the original center.

shift(offset[, use_strand])

Shifts the interval by the given offset.

swap_strand()

Swaps the strand of the interval.

to_interval_dict()

Converts the interval to a dictionary.

truncate([reference_length])

Truncates the interval to fit within the valid reference range.

within_reference([reference_length])

Checks if the interval is within the valid reference range.