GeneDx / phenopy

Phenotype comparison tools using semantic similarity.
Other
59 stars 10 forks source link

Does nx.ancestors return children or ancestors? #37

Closed krttrr closed 1 year ago

krttrr commented 4 years ago
    # compile list of HPO terms to include in the calculation, term plus children
    hpo_id_plus_children = [hpo_id] + list(nx.ancestors(hpo_network, hpo_id))

Related to this, what would the impact be of taking only immediate children rather than all children? That is, are we giving too much IC to less specific terms with this method?

Vincent-Ustach commented 4 years ago

The HPO is a directed graph that points from the leaf terms to the phenotype root term "HP:0000118- Phenotypic Abnormality" which points to "HP:0000001- All."

Therefore the HPO is flipped over in a way- nx.ancestors(G, source) returns all nodes having a path to the node source in the graph G which are the child terms aka farther away from root.

@arvkevi, we could look at the diseases annotated to each node and see how they populate cumulatively from leaf to root. This would give us a good idea of how to answer @krttrr 's question.

krttrr commented 4 years ago

Great, I was hoping I was wrong!

Let me know how the other question shakes out...

Vincent-Ustach commented 1 year ago

closing this.

@krttrr the IC is inherited from parents (closer to the root), not from children (closer to leaf nodes), so the answer to your first question is: no.