opencobra / cobratoolbox

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

writeCbModel not writing model.b and model.c correctly #1500

Open dayena opened 5 years ago

dayena commented 5 years ago

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:

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

tpfau commented 5 years ago

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.

dayena commented 5 years ago

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

tpfau commented 5 years ago

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.