alphagenome.data.junction_data.JunctionData#

class alphagenome.data.junction_data.JunctionData(junctions, values, metadata, interval=None, uns=None)[source]#

Container for storing splice junction data.

junctions#

A numpy array representing the splice junctions.

values#

A numpy array of floats representing the values associated with each junction for each track.

metadata#

A pandas DataFrame containing metadata for each track.

interval#

An optional Interval object representing the genomic region containing the junctions.

uns#

An optional dictionary to store additional unstructured data.

Raises:

ValueError – If the number of tracks in values does not match the number of rows in metadata, or if metadata contains duplicate names.

Attributes#

Table

interval

names

Returns a list of track names (not necessarily unique).

num_tracks

Returns the number of tracks.

ontology_terms

Returns a list of ontology terms (if available).

possible_strands

All possible strands.

strands

Returns a list of track strands.

uns

junctions

values

metadata

JunctionData.interval: Interval | None = None#
JunctionData.names#

Returns a list of track names (not necessarily unique).

JunctionData.num_tracks#

Returns the number of tracks.

JunctionData.ontology_terms#

Returns a list of ontology terms (if available).

JunctionData.possible_strands#

All possible strands.

JunctionData.strands#

Returns a list of track strands.

JunctionData.uns: dict[str, Any] | None = None#
JunctionData.junctions: Shaped[ndarray, 'num_junctions']#
JunctionData.values: Float[ndarray, 'num_junctions num_tracks']#
JunctionData.metadata: DataFrame#

Methods#

Table

filter_by_name(name)

Filters tracks by name.

filter_by_ontology(ontology_curie)

Filters tracks by ontology term.

filter_by_tissue(tissue)

Filters tracks by GTEx tissue type.

filter_to_negative_strand()

Filters junctions to the negative DNA strand.

filter_to_positive_strand()

Filters junctions to the positive DNA strand.

filter_to_strand(strand)

Filters junctions to a specific DNA strand.

filter_tracks(mask)

Filters tracks by a boolean mask.

intersect_with_interval(interval)

Returns the intersection of the junctions and the interval.

normalize_values([total_k])

Normalizes the values by the k value.

JunctionData.filter_by_name(name)[source]#

Filters tracks by name.

Return type:

JunctionData

JunctionData.filter_by_ontology(ontology_curie)[source]#

Filters tracks by ontology term.

Parameters:

ontology_curie (str) – The ontology term CURIE to filter by.

Return type:

JunctionData

Returns:

A new JunctionData object with tracks associated with the specified

ontology term.

Raises:

ValueError – If the metadata does not contain an ‘ontology_curie’ column.

JunctionData.filter_by_tissue(tissue)[source]#

Filters tracks by GTEx tissue type.

Parameters:

tissue (str) – The GTEx tissue type to filter by.

Return type:

JunctionData

Returns:

A new JunctionData object with tracks from the specified tissue.

Raises:

ValueError – If the metadata does not contain a ‘gtex_tissue’ column.

JunctionData.filter_to_negative_strand()[source]#

Filters junctions to the negative DNA strand.

Return type:

JunctionData

JunctionData.filter_to_positive_strand()[source]#

Filters junctions to the positive DNA strand.

Return type:

JunctionData

JunctionData.filter_to_strand(strand)[source]#

Filters junctions to a specific DNA strand.

Parameters:

strand (str) – The strand to filter by (‘+’ or ‘-‘).

Return type:

JunctionData

Returns:

A new JunctionData object with junctions on the specified strand.

JunctionData.filter_tracks(mask)[source]#

Filters tracks by a boolean mask.

Parameters:

mask (ndarray | list[bool]) – A boolean mask to select tracks.

Return type:

JunctionData

Returns:

A new JunctionData object with the filtered tracks.

JunctionData.intersect_with_interval(interval)[source]#

Returns the intersection of the junctions and the interval.

Return type:

JunctionData

JunctionData.normalize_values(total_k=10.0)[source]#

Normalizes the values by the k value.

Return type:

JunctionData