cobratoolbox icon indicating copy to clipboard operation
cobratoolbox copied to clipboard

.mat model doesn't have "rules" structure

Open AgustinPardo opened this issue 5 years ago • 2 comments

Please include a short description of problem here

Hello, I am using a COBRA model (.mat) from Palsson 2018 (https://bmcsystbiol.biomedcentral.com/articles/10.1186/s12918-018-0557-y), also it is in the BIGG database in .json format, so I think it is well formatted.

I am trying to run the PROM aproximation from Chandrasekaran (2010). This scrip uses the "rules" Matlab structure. This structure has values like: "( x(454) | x(570) ) " and is not included in the model.

This is the data that came in the model: Screenshot from 2020-08-28 12-02-56

Question: Do you think the "rules" Matlab structure could be generated from the actual data model?

I hereby confirm that I have:

  • [X] Tried to solve the issue on my own
  • [ ] 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)

AgustinPardo avatar Aug 28 '20 16:08 AgustinPardo

The model seems to contain a grRules field. The model you have might be in RAVEN format, you could then use the RAVEN provided function ravenCobraWrapper to convert the model COBRA format, which includes the transformation of the grRules field to rules. Note that this also makes some other changes to the model.

If you don't want any other changes applied to the model, you could also take the grrulesToRules subfunction, copy-paste this in a function of it's own; run on your model with model.rules=grrulesToRules(iEK1008).

edkerk avatar Aug 28 '20 20:08 edkerk

Thanks for the answer.

I solve the issue reading the model using this function:

""" readCbModel() """

AgustinPardo avatar Aug 28 '20 20:08 AgustinPardo