opencobra / cobratoolbox

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

.mat model doesn't have "rules" structure #1603

Open AgustinPardo opened 4 years ago

AgustinPardo commented 4 years ago

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:

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

edkerk commented 4 years ago

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).

AgustinPardo commented 4 years ago

Thanks for the answer.

I solve the issue reading the model using this function:

""" readCbModel() """