Skip to content

Commit

Permalink
fixed bug in terms replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
valearna committed Jun 2, 2018
1 parent a8a4d4f commit f8c5a5a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions genedescriptions/descriptions_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,10 @@ def generate_sentences(annotations: List[dict], ontology, evidence_groups_priori
replace = True
if terms_replacement_dict and replace:
for regex_to_substitute, regex_target in terms_replacement_dict.items():
go_term_names = [re.sub(regex_to_substitute, regex_target, ontology.query_term(term_id).name) for
term_id in merged_ids]
term_ids_dict = {re.sub(regex_to_substitute, regex_target, ontology.query_term(term).name):
ontology.query_term(term).id for term in merged_ids}
go_term_names = [re.sub(regex_to_substitute, regex_target, term_name) for term_name in
go_term_names]
term_ids_dict = {re.sub(regex_to_substitute, regex_target, term_name):
term_id for term_name, term_id in term_ids_dict.items()}
sentences.set_sentence(_get_single_sentence(term_names=go_term_names,
term_ids_dict=term_ids_dict,
aspect=go_aspect,
Expand Down

0 comments on commit f8c5a5a

Please sign in to comment.