6. Reconstructing a ME-model from the OSM

The organism-specific matrix is a XLSX structure that contains all the mappings necessary to build a ME-model (see Architecture of coralME).

In this tutorial we will reconstruct a Bacillus subtilis ME-model from the OSM. This is useful once you have already run builder.generate_files() which performs the Synchronize and Complement steps (see Architecture of coralME).

This way is quicker but make sure not to overwrite your OSM re-running the reconstruction as in Tutorial 1, because all you manual curation will be lost.

6.1. Import libraries

[ ]:
from IPython.display import display, HTML, Math, Markdown
display(HTML("<style>.container { width:95% !important; }</style>"))

from coralme.builder.main import MEBuilder

6.2. Path to configuration files

[ ]:
organism = './bsubtilis/organism.json'
inputs = './bsubtilis/input.json'

6.3. Create MEBuilder instance

This time you create it from the yaml configuration file which is already generated and filled. This file condenses the configuration in one place, see an example here.

[ ]:
builder = MEBuilder(*['./bsubtilis/coralme-config.yaml'])

6.4. Build ME-model

This corresponds to Build in Architecture of coralME

[ ]:
builder.build_me_model(overwrite=False)

6.5. Troubleshoot ME-model

This corresponds to Find gaps in Architecture of coralME

[ ]:
builder.troubleshoot(growth_key_and_value = { builder.me_model.mu : 0.001 }, solver="qminos")

Note: We set 0.001 as a standard value for feasibility checking, but feel free to modify it! Sometimes too high a value could put a significant strain on the model and give too many gaps to start with. Too low a value might not show you all the gaps needed.

[ ]:
import coralme
coralme.io.json.save_json_me_model(builder.me_model,"./bsubtilis/MEModel-step3-bsubtilis-TS.json")