1. Getting started
1.1. Reconstruct with coralME
Here we show an example to reconstruct a dME-model of B. subtilis.
1.1.1. Import packages
[1]:
from coralme.builder.main import MEBuilder
from importlib.resources import files
1.1.2. Define path to inputs
Define the paths to inputs and desired outputs. For more information about these files see Description of inputs.
[2]:
input = {
# Inputs
"m-model-path": "./helper_files/inputs/m_model.json", # Path to model file
"genbank-path": "./helper_files/inputs/genome.gb", # Path to genome genbank file
# Outputs
"df_gene_cplxs_mods_rxns": "./helper_files/building_data/OSM.xlsx", # Desired output path of OSM
"out_directory": "./helper_files/", # Output directory
"log_directory": "./helper_files/", # Log directory
"locus_tag": "old_locus_tag", # What IDs were used in the M-model? e.g. locus_tag, old_locus_tag
"ME-Model-ID" : "EXAMPLE-BACILLUS-ME" # Name of the ME-model
}
Load organism setup. For now we can use the minimal setup with biological numbers from E. coli.
[3]:
organism = str(files("coralme") / "iJL1678b") + "-ME/minimal-organism.json"
1.1.3. Create builder
For more information about this class see Architecture of coralME
[4]:
builder = MEBuilder(*[organism], **input)
1.1.4. Generate files
This corresponds to Synchronyze and Complement steps in Architecture of coralME
[5]:
builder.generate_files(overwrite=True)
Initiating file processing...
~ Processing files for EXAMPLE-BACILLUS-ME...
Set parameter Username
Academic license - for non-commercial use only - expires 2025-09-03
Checking M-model metabolites... : 100.0%|██████████| 990/ 990 [00:00<00:00]
Checking M-model genes... : 100.0%|██████████| 844/ 844 [00:00<00:00]
Checking M-model reactions... : 100.0%|██████████| 1250/ 1250 [00:00<00:00]
Syncing optional genes file... : 0.0%| | 0/ 0 [00:00<?]
Looking for duplicates within datasets... : 100.0%|██████████| 5/ 5 [00:00<00:00]
Gathering ID occurrences across datasets... : 100.0%|██████████| 1250/ 1250 [00:00<00:00]
Solving duplicates across datasets... : 0.0%| | 0/ 0 [00:00<?]
Pruning GenBank... : 100.0%|██████████| 1/ 1 [00:01<00:00]
Updating Genbank file with optional files... : 0.0%| | 0/ 0 [00:00<?]
Syncing optional files with genbank contigs... : 100.0%|██████████| 1/ 1 [00:08<00:00]
Modifying metabolites with manual curation... : 0.0%| | 0/ 0 [00:00<?]
Modifying metabolic reactions with manual curation... : 0.0%| | 0/ 0 [00:00<?]
Adding manual curation of complexes... : 0.0%| | 0/ 0 [00:00<?]
Getting sigma factors... : 100.0%|██████████| 17/ 17 [00:00<00:00]
Getting generics from Genbank contigs... : 100.0%|██████████| 1/ 1 [00:00<00:00]
Getting TU-gene associations from optional TUs file... : 0.0%| | 0/ 0 [00:00<?]
Gathering ribosome stoichiometry... : 100.0%|██████████| 63/ 63 [00:00<00:00]
Adding protein location... : 100.0%|██████████| 4238/ 4238 [00:00<00:00]
Purging M-model genes... : 100.0%|██████████| 844/ 844 [00:00<00:00]
Getting enzyme-reaction associations... : 100.0%|██████████| 1250/ 1250 [00:04<00:00]
Reading EXAMPLE-BACILLUS-ME done.
Gathering M-model compartments... : 100.0%|██████████| 2/ 2 [00:00<00:00]
Fixing compartments in M-model metabolites... : 100.0%|██████████| 990/ 990 [00:00<00:00]
Fixing missing names in M-model reactions... : 100.0%|██████████| 1250/ 1250 [00:00<00:00]
Updating enzyme reaction association... : 100.0%|██████████| 902/ 902 [00:00<00:00]
Getting tRNA to codon dictionary from NC_000964.3 : 100.0%|██████████| 4449/ 4449 [00:03<00:00]
Checking defined translocation pathways... : 0.0%| | 0/ 0 [00:00<?]
Getting reaction Keffs... : 100.0%|██████████| 902/ 902 [00:00<00:00]
Writting the Organism-Specific Matrix...
Organism-Specific Matrix saved to ./helper_files/building_data/OSM.xlsx file.
File processing done.
1.1.5. Build ME-model
This corresponds to Build in Architecture of coralME
[6]:
builder.build_me_model(overwrite=False)
Initiating ME-model reconstruction...
Adding biomass constraint(s) into the ME-model... : 100.0%|██████████| 11/ 11 [00:00<00:00]
Read LP format model from file /tmp/tmp6wx5hvsz.lp
Reading time = 0.00 seconds
: 990 rows, 2500 columns, 10478 nonzeros
Read LP format model from file /tmp/tmp053a6_ir.lp
Reading time = 0.00 seconds
: 990 rows, 2496 columns, 10342 nonzeros
Adding Metabolites from M-model into the ME-model... : 100.0%|██████████| 990/ 990 [00:00<00:00]
Adding Reactions from M-model into the ME-model... : 100.0%|██████████| 1248/ 1248 [00:00<00:00]
Adding Transcriptional Units into the ME-model from user input... : 0.0%| | 0/ 0 [00:00<?]
Adding features from contig NC_000964.3 into the ME-model... : 100.0%|██████████| 4449/ 4449 [00:08<00:00]
Updating all TranslationReaction and TranscriptionReaction... : 100.0%|██████████| 9232/ 9232 [00:21<00:00]
Removing SubReactions from ComplexData... : 100.0%|██████████| 4340/ 4340 [00:00<00:00]
Adding ComplexFormation into the ME-model... : 100.0%|██████████| 4340/ 4340 [00:00<00:00]
Adding Generic(s) into the ME-model... : 100.0%|██████████| 5/ 5 [00:00<00:00]
Processing StoichiometricData in ME-model... : 100.0%|██████████| 1020/ 1020 [00:00<00:00]
ME-model was saved in the ./helper_files/ directory as MEModel-step1-EXAMPLE-BACILLUS-ME.pkl
Adding tRNA synthetase(s) information into the ME-model... : 100.0%|██████████| 306/ 306 [00:00<00:00]
Adding tRNA modification SubReactions... : 0.0%| | 0/ 0 [00:00<?]
Associating tRNA modification enzyme(s) to tRNA(s)... : 0.0%| | 0/ 0 [00:00<?]
Adding SubReactions into TranslationReactions... : 100.0%|██████████| 4238/ 4238 [00:00<00:00]
Adding RNA Polymerase(s) into the ME-model... : 100.0%|██████████| 17/ 17 [00:00<00:00]
Associating a RNA Polymerase to each Transcriptional Unit... : 0.0%| | 0/ 0 [00:00<?]
Processing ComplexData in ME-model... : 100.0%|██████████| 1/ 1 [00:00<00:00]
Adding ComplexFormation into the ME-model... : 100.0%|██████████| 4365/ 4365 [00:00<00:00]
Adding SubReactions into TranslationReactions... : 100.0%|██████████| 4238/ 4238 [00:00<00:00]
Adding Transcription SubReactions... : 100.0%|██████████| 4449/ 4449 [00:00<00:00]
Processing StoichiometricData in SubReactionData... : 0.0%| | 0/ 0 [00:00<?]
Adding reaction subsystems from M-model into the ME-model... : 100.0%|██████████| 1248/ 1248 [00:00<00:00]
Processing StoichiometricData in ME-model... : 100.0%|██████████| 1020/ 1020 [00:00<00:00]
Updating ME-model Reactions... : 100.0%|██████████| 16069/16069 [01:11<00:00]
Updating all FormationReactions... : 100.0%|██████████| 4365/ 4365 [00:00<00:00]
Recalculation of the elemental contribution in SubReactions... : 100.0%|██████████| 82/ 82 [00:00<00:00]
Updating all FormationReactions... : 100.0%|██████████| 4365/ 4365 [00:00<00:00]
Updating FormationReactions involving a lipoyl prosthetic group... : 0.0%| | 0/ 0 [00:00<?]
Updating FormationReactions involving a glycyl radical... : 0.0%| | 0/ 0 [00:00<?]
Estimating effective turnover rates for reactions using the SASA method... : 100.0%|██████████| 2658/ 2658 [00:00<00:00]
Mapping effective turnover rates from user input... : 0.0%| | 0/ 0 [00:00<?]
Setting the effective turnover rates using user input... : 100.0%|██████████| 2424/ 2424 [00:00<00:00]
Pruning unnecessary ComplexData reactions... : 100.0%|██████████| 4365/ 4365 [00:04<00:00]
Pruning unnecessary FoldedProtein reactions... : 0.0%| | 0/ 0 [00:00<?]
Pruning unnecessary ProcessedProtein reactions... : 100.0%|██████████| 4239/ 4239 [00:00<00:00]
Pruning unnecessary TranslatedGene reactions... : 100.0%|██████████| 4239/ 4239 [00:08<00:00]
Pruning unnecessary TranscribedGene reactions... : 100.0%|██████████| 4450/ 4450 [00:04<00:00]
Pruning unnecessary Transcriptional Units... : 100.0%|██████████| 4449/ 4449 [00:03<00:00]
Pruning unnecessary ComplexData reactions... : 100.0%|██████████| 776/ 776 [00:00<00:00]
Pruning unnecessary FoldedProtein reactions... : 0.0%| | 0/ 0 [00:00<?]
Pruning unnecessary ProcessedProtein reactions... : 100.0%|██████████| 948/ 948 [00:00<00:00]
Pruning unnecessary TranslatedGene reactions... : 100.0%|██████████| 948/ 948 [00:00<00:00]
Pruning unnecessary TranscribedGene reactions... : 100.0%|██████████| 1064/ 1064 [00:01<00:00]
Pruning unnecessary Transcriptional Units... : 100.0%|██████████| 1063/ 1063 [00:01<00:00]
Pruning unnecessary ComplexData reactions... : 100.0%|██████████| 760/ 760 [00:00<00:00]
Pruning unnecessary FoldedProtein reactions... : 0.0%| | 0/ 0 [00:00<?]
Pruning unnecessary ProcessedProtein reactions... : 100.0%|██████████| 932/ 932 [00:00<00:00]
Pruning unnecessary TranslatedGene reactions... : 100.0%|██████████| 932/ 932 [00:00<00:00]
Pruning unnecessary TranscribedGene reactions... : 100.0%|██████████| 1048/ 1048 [00:01<00:00]
Pruning unnecessary Transcriptional Units... : 100.0%|██████████| 1047/ 1047 [00:01<00:00]
ME-model was saved in the ./helper_files/ directory as MEModel-step2-EXAMPLE-BACILLUS-ME.pkl
ME-model reconstruction is done.
Number of metabolites in the ME-model is 3808 (+284.65%, from 990)
Number of reactions in the ME-model is 7031 (+462.48%, from 1250)
Number of genes in the ME-model is 1046 (+23.93%, from 844)
Number of missing genes from reconstruction cannot be determined.
1.1.6. Troubleshoot ME-model
This corresponds to Find gaps in Architecture of coralME
[7]:
builder.troubleshoot(growth_key_and_value = { builder.me_model.mu : 0.001 })
The MINOS and quad MINOS solvers are a courtesy of Prof Michael A. Saunders. Please cite Ma, D., Yang, L., Fleming, R. et al. Reliable and efficient solution of genome-scale models of Metabolism and macromolecular Expression. Sci Rep 7, 40863 (2017). https://doi.org/10.1038/srep40863
~ Troubleshooting started...
Checking if the ME-model can simulate growth without gapfilling reactions...
Original ME-model is not feasible with a tested growth rate of 0.001000 1/h
Step 1. Gapfill reactions to provide components of type 'ME-Deadends' using brute force.
Finding gaps in the ME-model...
Finding gaps from the M-model only...
0 metabolites were identified as deadends.
Adding sink reactions for 0 metabolites...
Provided metabolites through sink reactions cannot recover growth. Proceeding to next set of metabolites.
Step 2. Gapfill reactions to provide components of type 'Cofactors' using brute force.
Adding sink reactions for 2 metabolites...
Sink reactions shortlisted to 2 metabolites.
Processed: 1/2, Gaps: 0. The ME-model is feasible if TS_mg2_c is closed.
Processed: 2/2, Gaps: 1. The ME-model is not feasible if TS_zn2_c is closed.
~ Troubleshooter added the following sinks: TS_zn2_c.
~ Final step. Fully optimizing with precision 1e-6 and save solution into the ME-model...
Gapfilled ME-model is feasible with growth rate 0.102178 (M-model: 0.117966).
ME-model was saved in the ./helper_files/ directory as MEModel-step3-EXAMPLE-BACILLUS-ME-TS.pkl
1.2. Understanding the file structure
For a detailed explanation of the inputs, see For more information about these files see Description of inputs

1.3. Curate manually
Copy all of the generated reference files in building_data/reference_files and replace accordingly in building_data/
Go one by one through the files in building_data/ curating as needed! Important flags are risen in curation_notes.json to further guide you through curation.
Everytime you make a change, run the model through the troubleshooter! It will show you remaining gaps to look at, and the new curation notes might show new warnings.
Keep iterating! You will have finished when no gaps are present, and all remaining warnings in curation notes are irrelevant.