opencobra / cobratoolbox

The COnstraint-Based Reconstruction and Analysis Toolbox. Documentation:
https://opencobra.github.io/cobratoolbox
Other
247 stars 311 forks source link

Bugfix printRxnFormula #2266

Closed bramnap closed 1 month ago

bramnap commented 3 months ago

printRxnFormula had an update for duplicated rxnIDs. The update however made it so that the iteration became the index being extracted from the S-matrix instead of the index belonging the the reaction. I.e., If you wanted to print a formula of a 1 reaction, the function would always print the formula of the first reaction, regardless of the input. Changed the code to find index of reactions and put an error in to stop the code when duplicated reaction IDs are found. The code also tells the user which rxnabbrevation caused the error.

I hereby confirm that I have:

(Note: You may replace [ ] with [X] to check the box)

farid-zare commented 3 months ago

Hi Bram, Could you please use "ismember" or "findRxnIDs" other than "contains" function? This will prevent matching reactions that share part of their name with each other. Thanks!

bramnap commented 2 months ago

Hi Farid,

Done :)

farid-zare commented 2 months ago

Fantastic, Thanks a million!