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":