hpotk.util.sort package
The hpotk.util.sort package sorts term IDs in a meaningful way. See Sorting term IDs section for more info.
- class hpotk.util.sort.TermIdSorting[source]
Bases:
object
TermIdSorting computes indices for sorting a sequence of identifiers/identified items.
- class hpotk.util.sort.HierarchicalEdgeTermIdSorting(hpo: OntologyGraph | GraphAware)[source]
Bases:
HierarchicalSorting
HierarchicalEdgeTermIdSorting uses hierarchical clustering to sort the term IDs. The clustering uses edge distance as a proxy to the term similarity.
Notes:
Does not maintain order if the input is already sorted.
- Parameters:
hpo – HPO ontology graph or a graph aware instance.
- class hpotk.util.sort.HierarchicalIcTermIdSorting(hpo: OntologyGraph | GraphAware, ic_source: Callable[[TermId], float])[source]
Bases:
HierarchicalSorting
HierarchicalIcTermIdSorting uses hierarchical clustering to sort the term IDs. The clustering uses Resnik term similarity to assess term similarity.
Notes:
Does not maintain order if the input is already sorted.
- Parameters:
hpo – HPO ontology graph or a graph aware instance.
ic_source – a callable for getting the information content (IC) as a float for a term ID.
- class hpotk.util.sort.HierarchicalSimilaritySorting(hpo: OntologyGraph | GraphAware, ic_source: Callable[[TermId], float])[source]
Bases:
HierarchicalIcTermIdSorting
HierarchicalSimilaritySorting uses hierarchical clustering to sort the term IDs. The clustering uses Resnik term similarity to assess term similarity.
Notes:
Does not maintain order if the input is already sorted.
- Parameters:
hpo – HPO ontology graph or a graph aware instance.
ic_source – a callable for getting the information content (IC) as a float for a term ID.