RelationsMatrix
¶
Class to store and save ontology relations matrices.
| Attributes: |
|
|---|
RelationsLazyFrame
¶
Loader for the MetaHQ setup package ontology relations DataFrames.
Performs fast lookup of precomputed ancestor/descendant relationships of nodes within the ontology graph.
Relations DataFrame structure¶
The values of a collected frame answers the following questions with a 1 for 'yes' and 0 for 'no': Is a particular row an ancestor of a particular column? Is a particular column a descendant of a particular row?
get_ancestors(subset=None, rm_self=False)
¶
Extract relationships of terms to their ancestors.
Note that terms queried for their ancestors are included in the output mapping.
| Parameters: |
|
|---|
| Returns: |
|
|---|
get_descendants(subset=None, rm_self=True)
¶
Extract relationships of terms to their descendants.
Note that terms queried for their ancestors are included in the output mapping.
| Parameters: |
|
|---|
| Returns: |
|
|---|
from_parquet(file)
classmethod
¶
Load and format the relations dataframe.
This loads in a base pl.LazyFrame to extract ancestor relationstips, descendant relationships, or both within using a single RelationLoader instance.
| Returns: |
|
|---|
| Raises: |
|
|---|