Skip to content

Commit

Permalink
removed parent-child relationships resolution for key-nonkey terms
Browse files Browse the repository at this point in the history
  • Loading branch information
valearna committed May 23, 2019
1 parent b7ec086 commit 14f7bb1
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions genedescriptions/descriptions_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,21 +233,8 @@ def get_trimmed_terms_by_common_ancestor(self, terms: Set[str], terms_already_co
elif trimming_threshold <= 0 < len(terms_low_priority):
add_others_lowp = True
terms = terms_high_priority
terms_low_priority_orig = terms_low_priority[:]
# remove exact overlap
terms_low_priority = list(set(terms_low_priority) - set(terms_high_priority))
# remove possible children of terms in the high priority list
terms_low_priority = list(set(terms_low_priority) | set(terms_high_priority))
terms_low_priority = OntologySentenceGenerator.remove_children_if_parents_present(
terms=terms_low_priority, ontology=self.ontology,
ancestors_covering_multiple_children=ancestors_covering_multiple_children if add_mul_common_anc else None)
# remove possible parents of terms in the high priority list
terms_low_priority = list(set(terms_low_priority) | set(terms_high_priority))
terms_low_priority = OntologySentenceGenerator.remove_parents_if_child_present(
terms_low_priority, self.ontology)
terms_low_priority = list(set(terms_low_priority) - set(terms_high_priority))
if len(terms_low_priority) < len(terms_low_priority_orig):
add_others_lowp = True
terms.extend(terms_low_priority)
# cutoff terms - if number of terms with high priority is higher than max_num_terms
terms = terms[0:max_terms]
Expand Down

0 comments on commit 14f7bb1

Please sign in to comment.