Skip to content

Commit

Permalink
fix bug with MISSING enzymes in module_paths output
Browse files Browse the repository at this point in the history
  • Loading branch information
ivagljiva committed Oct 12, 2023
1 parent 68422db commit a85c4f9
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions anvio/kegg.py
Original file line number Diff line number Diff line change
Expand Up @@ -5327,11 +5327,20 @@ def generate_output_dict_for_modules(self, kegg_superdict, headers_to_include=No
if "annotated_enzymes_in_path" in headers_to_include:
annotated = []
for accession in p:
if (accession in self.all_modules_in_db and mod_dict[accession]["pathwise_is_complete"]) or \
(accession in c_dict['kofam_hits'].keys()):
annotated.append(accession)
# handle enzyme components
if '+' in accession or '-' in accession:
components = re.split(r'\+|\-', accession)
for c in components:
if c in c_dict['kofam_hits'].keys():
annotated.append(c)
else:
annotated.append(f"[MISSING {c}]")
else:
annotated.append(f"[MISSING {accession}]")
if (accession in self.all_modules_in_db and mod_dict[accession]["pathwise_is_complete"]) or \
(accession in c_dict['kofam_hits'].keys()):
annotated.append(accession)
else:
annotated.append(f"[MISSING {accession}]")
d[self.modules_unique_id]["annotated_enzymes_in_path"] = ",".join(annotated)

# add path-level redundancy if requested
Expand Down

0 comments on commit a85c4f9

Please sign in to comment.