Return list of HPO links
PabloBotas opened this issue · comments
Users are requesting to be able to get/download a list of links from the HPO ontology. This is currently not implemented.
The following functions should be included in the https://github.com/foundation29org/RareCrowds/blob/main/rarecrowds/utils/ontograph.py file. The functionality could be based on https://networkx.org/documentation/stable/reference/classes/generated/networkx.DiGraph.edges.html?highlight=edges#networkx.DiGraph.edges.
def get_edges(starting_term=None):
# If starting_term is provided, then the search should start there
# Then just rely on self.Graph.edges.data() to do the trick
# Return set of edges: {('HP:0000118', 'HP:0040064'), (...), ...}
def save_edges(out_file, starting_term=None):
l = self.get_edges(starting_term)
# Write list to out_file. Format:
# HP:0000118\tHP:0040064
# HP:0000118\tHP:0040064
# HP:0000118\tHP:0040064
# ...