Skip to content

Commit

Permalink
fixed ontology functions
Browse files Browse the repository at this point in the history
  • Loading branch information
valearna committed Jan 4, 2024
1 parent 481262c commit 74757e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions genedescriptions/data_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ def set_ontology(self, ontology_type: DataType, ontology: Ontology, config: Gene
else:
self.expression_ontology = ontology
module = get_module_from_data_type(ontology_type)
ontology = self.get_ontology(data_type=ontology_type)
ontology: Ontology = self.get_ontology(data_type=ontology_type)
terms_replacement_regex = config.get_module_property(module=module, prop=ConfigModuleProperty.RENAME_TERMS)
if terms_replacement_regex:
self.rename_ontology_terms(ontology=ontology, terms_replacement_regex=terms_replacement_regex)
root_nodes = [n for n in ontology.nodes() if len(
list(ontology.predecessors(n))) == 0 and len(list(ontology.successors(n))) > 0]
list(ontology.parents(n))) == 0 and len(list(ontology.children(n))) > 0]
set_all_depths(ontology=ontology, root_node_ids=root_nodes, relations=self.get_relations(ontology_type))
if config.get_module_property(module=module,
prop=ConfigModuleProperty.TRIMMING_ALGORITHM) == "ic":
Expand Down

0 comments on commit 74757e6

Please sign in to comment.