cobratoolbox icon indicating copy to clipboard operation
cobratoolbox copied to clipboard

writeCbModel not writing model.b and model.c correctly

Open dayena opened this issue 4 years ago • 3 comments

Hello @tpfau

When using writeCbModel and then readCbModel, there are two issues that appear:

  1. if no objective function is set (find(model.c) is empty) then model.c is not written.
  2. model.b is sometimes not all zeros (e.g., when using a relaxedModel after relaxed FBA), but the SBML writes all zeros.

Thank you,

Diana

I hereby confirm that I have:

  • [X] Tried to solve the issue on my own
  • [X] Retried to run my code with the latest version of The COBRA Toolbox
  • [X] Checked that a similar issue has not already been opened

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

dayena avatar Sep 08 '19 11:09 dayena

Hi @dayena wrt 1. I'm not sure what you mean.. If there is no objective set, there is no objective. and we can't really set one. Does this become a problem somewhere?

wrt 2. You are right, model.b is not written to SBML as SBML does not yet have a suitable mechanism to encode right hand side arguments. We are currently in the process of trying to define something for fbc v3, but until thats out we don't have a suitable mechanism.

tpfau avatar Sep 09 '19 08:09 tpfau

Hi @tpfau

Thank you for your response. Wrt. 1, I mean that if model.c is all false, then the written SBML model does not include model.c at all. In other words, after writing and then reading the Cb Model, the field model.c is missing.

Best wishes,

Diana

dayena avatar Sep 09 '19 09:09 dayena

Ahh ok, I see. That should not hurt, since the default value for model.c is a all-zero vector but I agree it looks odd. However I would like to only go into this once fbc v3 is finalised and we can actually build models based on the new definitions.

tpfau avatar Sep 09 '19 10:09 tpfau