Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion minedatabase/pickaxe.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,12 +807,13 @@ def _remove_cofactor_redundancy(self) -> None:
# Loop through identified compounds and update
# reactions/compounds accordingly
rxns_to_del = set()
cofactor_rxn_ids = set()
for cpd_id in cofactors_as_cpds:
rxn_ids = set(
self.compounds[cpd_id]["Product_of"]
+ self.compounds[cpd_id]["Reactant_in"]
)
rxns_to_del = rxns_to_del.union(rxn_ids)
rxns_to_del = rxns_to_del.union(rxn_ids).difference(cofactor_rxn_ids)
# Check and fix reactions as needed
for rxn_id in rxn_ids:
rxn = self.reactions[rxn_id]
Expand All @@ -832,6 +833,7 @@ def _remove_cofactor_redundancy(self) -> None:
products.append((s, self.compounds[product]))

cofactor_rxn_id, rxn_text = utils.get_reaction_hash(reactants, products)
cofactor_rxn_ids.add(cofactor_rxn_id)

# Check to see if reaction makes changes
# Reactions such as
Expand Down