by Daniel Cuevas
In this notebook, we will present the steps to generate a genome-scale metabolic model from RAST annotations, save the model on your computer, and load the model from your computer.
The required files and information for this notebook:
In [1]:
import sys
import os
import PyFBA
In [2]:
model_functions_file = "data/citrobacter.assigned_functions"
org_name = "Citrobacter sedlakii"
org_id = "Citrobacter sedlakii"
In [3]:
model = PyFBA.model.roles_to_model(model_functions_file, org_id, org_name)
The model has been generated and is now ready to use for flux-balance analysis simulations.
Note: model should not grow because it has not been gap-filled
In [4]:
# status := optimization status of FBA simplex solver
# flux_value := biomass flux value (objective function)
# growth := boolean whether the model was able to grow or not
# Note: model should not grow because it has not been gap-filled
status, flux_value, growth = model.run_fba("ArgonneLB.txt")
print("Growth:", growth)
In [5]:
model_directory = "save_citrobacter_sedlakii"
PyFBA.model.save_model(model, model_directory)
Model has been stored. Here is a directory listing of the files that were created.
Note: files for gfmedia and gfreactions will be 0 Bytes in size because gap-filling was not performed.
In [6]:
for f in os.listdir(model_directory):
fp = os.path.join(model_directory, f)
print(f, ": ", os.path.getsize(fp), "B", sep="")
In [7]:
loaded_model = PyFBA.model.load_model(model_directory, org_name)
The model has been loaded and is ready for use in flux-balance analysis simulations.
Note: model should not grow because it has not been gap-filled
In [8]:
# status := optimization status of FBA simplex solver
# flux_value := biomass flux value (objective function)
# growth := boolean whether the model was able to grow or not
# Note: model should not grow because it has not been gap-filled
status, flux_value, growth = loaded_model.run_fba("ArgonneLB.txt")
print("Growth:", growth)