Implemented removal of reagents of zero coefficient#93
Conversation
JamesJeffryes
left a comment
There was a problem hiding this comment.
Big ask here is looking into merging the logic in Adjust_Reaction_Protons.py and Rebalance_Reactions.py
| for rxn in sorted(Reactions_Dict.keys()): | ||
| # if(rxn != "rxn00013"): | ||
| # continue | ||
|
|
|
|
||
| old_stoichiometry=Reactions_Dict[rxn]["stoichiometry"] | ||
| Rxn_Cpds_Array=ReactionsHelper.parseStoich(old_stoichiometry) | ||
| print "1: ",Rxn_Cpds_Array |
There was a problem hiding this comment.
Could be wordy. Is it needed?
| Rxn_Cpds_Array=ReactionsHelper.parseStoich(old_stoichiometry) | ||
| print "1: ",Rxn_Cpds_Array | ||
| ReactionsHelper.adjustCompound(Rxn_Cpds_Array,"cpd00067",float(number)) | ||
| print "2: ",Rxn_Cpds_Array |
There was a problem hiding this comment.
Could be wordy. Is it needed?
| Update_Reactions=0 | ||
| for rxn in sorted(Reactions_Dict.keys()): | ||
| # if(rxn != "rxn00013"): | ||
| # continue |
There was a problem hiding this comment.
This code seems to duplicate logic in Adjust_Reaction_Protons.py. Can we consolidate it?
There was a problem hiding this comment.
No, it started off like that, but it got tricky. There is an internal self-reference between status and stoichiometry when attempting to add/remove compounds, and it got more complex when considering whether users would add new compounds with an incorrectly stated number of protons. It was easier for me to separate it out into two scripts.
|
Can you merge, I want to pull it into the other branch. |
I tested this by artificially modifying a compound's formula.