segrelab / cometspy

Python interface for running COMETS simulations and analyzing the results
GNU General Public License v3.0
11 stars 9 forks source link

allow objective function to be a sum of multiple reactions #51

Closed andreastallvik closed 4 months ago

andreastallvik commented 4 months ago

When loading a cobrapy model, cometspy was saving only the first reaction in the objective function as the objective attribute (https://github.com/segrelab/cometspy/blob/master/cometspy/model.py#L631-L635), despite COMETS allowing multiple reactions to be specified as objective in the .cmd file.

Two small changes were made:

  1. Changed the way that the objective function from a cobrapy model is loaded. Followed the COMETS convention of putting "-" in front of reaction id for reactions that are to be minimised and assuming all other reactions are to be maximised.
  2. Changed the way that the objective is written to a .cmd file. Multiple reaction id's are written on the same line and separated by whitespace.
dukovski commented 4 months ago

Thank you @andreastallvik! I appreciate it.