SysBioChalmers / ecModels

A container for all enzyme constrained models created by GECKO.
Creative Commons Attribution 4.0 International
10 stars 6 forks source link

feat: automate version retrieving from models #21

Closed IVANDOMENZAIN closed 3 years ago

IVANDOMENZAIN commented 4 years ago

It has been agreed that all original models' structures (version controlled or not) should be loaded from their corresponding SBML file. Currently, the version of the model can be obtained in several ways by the ecModels pipeline (e.g. read from a MATLAB structure or provided by the user).

A generalized way to read the model's version is to parse it from the <name> or <id> fields in the SBML file. As an example, the model name and Ids lines for the Kmx and iYali models are provided here:

As a solution, a python script can be developed in which the version is parsed from this file, trying it on both fields <name> or <id> and, if absent a default v1.0.0 string is introduced

IVANDOMENZAIN commented 3 years ago

This issue has been partially addressed by PR#113 in GECKO. Model version can be parsed directly by GECKO either from the name, id or version fields for non version-controlled models with an available MATLAB file.

IVANDOMENZAIN commented 3 years ago

Temporarily, for non-version controlled models, it is intended that the python runner script (for the automated pipeline) assigns a dummy version to the model.

mihai-sysbio commented 3 years ago

Is there a specific reason we load the .mat file instead of the .xml? I'm consider of using the xml_load function in the pipeline. Does this have something to do with fetching the version?

IVANDOMENZAIN commented 3 years ago

@mihai-sysbio, not really, .xml files be the ones that are loaded preferably, if available. Just use the importModel function in RAVEN instead of xml_load.

mihai-sysbio commented 3 years ago

Alright, switching from .mat to .xml is quite straighforward. I've done a preliminary test and it seems to work. For now, I'll revert the changes. Whenever we decide to start using SBML I can reimplement this.

IVANDOMENZAIN commented 3 years ago

The pipeline has switched to .xml files for non version-controlled models, instead of handling .mat files, in order to stick to standard good practices. Check script run.py in this merge commit.