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 inmetadata
, or ifmetadata
contains duplicate names.
Attributes#
Table
Returns a list of track names (not necessarily unique). |
|
Returns the number of tracks. |
|
Returns a list of ontology terms (if available). |
|
All possible strands. |
|
Returns a list of track strands. |
|
- 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.junctions:
Shaped[ndarray, 'num_junctions']
#
-
JunctionData.values:
Float[ndarray, 'num_junctions num_tracks']
#
Methods#
Table
|
Filters tracks by name. |
|
Filters tracks by ontology term. |
|
Filters tracks by GTEx tissue type. |
Filters junctions to the negative DNA strand. |
|
Filters junctions to the positive DNA strand. |
|
|
Filters junctions to a specific DNA strand. |
|
Filters tracks by a boolean mask. |
|
Returns the intersection of the junctions and the interval. |
|
Normalizes the values by the k value. |
- 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:
- Returns:
- A new
JunctionData
object with tracks associated with the specified ontology term.
- A new
- 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:
- 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.filter_to_positive_strand()[source]#
Filters junctions to the positive DNA strand.
- Return type:
- JunctionData.filter_to_strand(strand)[source]#
Filters junctions to a specific DNA strand.
- Parameters:
strand (
str
) – The strand to filter by (‘+’ or ‘-‘).- Return type:
- Returns:
A new
JunctionData
object with junctions on the specified strand.
- JunctionData.filter_tracks(mask)[source]#
Filters tracks by a boolean mask.
- JunctionData.intersect_with_interval(interval)[source]#
Returns the intersection of the junctions and the interval.
- Return type: