From 74757e6f8433ee48851c136e361fb025bcb2da1b Mon Sep 17 00:00:00 2001 From: Valerio Arnaboldi Date: Wed, 3 Jan 2024 23:10:37 -0800 Subject: [PATCH] fixed ontology functions --- genedescriptions/data_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/genedescriptions/data_manager.py b/genedescriptions/data_manager.py index 2e4f806..dc624f6 100644 --- a/genedescriptions/data_manager.py +++ b/genedescriptions/data_manager.py @@ -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":