project_folder = "./ec_model_2019_06_25_output/" project_name = "psb_orth" organism = "Escherichia coli" kcat_database_path = "./ec_model_2019_06_25_output/kcat_database_combined.json" protein_kcat_database_path = "ec_model_2019_06_25_input_keff_paper/gene_id_data_mapping.json" get_reactions_kcat_mapping(sbml_path, project_folder, project_name, organism, kcat_database_path, protein_kcat_database_path) # Step 7 input_sbml = "./ec_model_2019_06_25_input/iJO1366.xml" project_folder = "./ec_model_2019_06_25_output/" project_name = "psb_orth" get_initial_spreadsheets_with_sbml(input_sbml, project_folder, project_name) # Step 8 input_sbml = "./ec_model_2019_06_25_input/iJO1366.xml" project_folder = "./ec_model_2019_06_25_output/" project_name = "psb_orth" get_protein_mass_mapping_with_sbml(input_sbml, project_folder, project_name) # Step 9 input_sbml = "./ec_model_2019_06_25_input/iJO1366.xml" output_sbml = "iJO1366_sMOMENT_2019_06_25_GECKO_ANALOGON.xml" project_folder = "./ec_model_2019_06_25_output/" project_name = "psb_orth" excluded_reactions = ["CO2tex", "O2tex", "H2tex"] create_smoment_model_reaction_wise_with_sbml(input_sbml, output_sbml, project_folder, project_name, excluded_reactions) # Step 10 - Generate model with standard exchanges scenario model = set_up_ec_model_with_sbml("ec_model_2019_06_25_output/iJO1366_sMOMENT_2019_06_25.xml", .25) cobra.io.write_sbml_model(model, "ec_model_2019_06_25_output/iJO1366_sMOMENT_2019_06_25_STANDARD_EXCHANGE_SCENARIO.xml")
print("Variability of formate" + ";" + ";".join([str(x) for x in values["formate_var"]])) print("Variability of lactate" + ";" + ";".join([str(x) for x in values["lactate_var"]])) print("Variability of succinate" + ";" + ";".join([str(x) for x in values["succinate_var"]])) print("Variability of CO2" + ";" + ";".join([str(x) for x in values["co2_var"]])) print("Variability of O2" + ";" + ";".join([str(x) for x in values["o2_var"]])) print("Variability of protein pool" + ";" + ";".join([str(x) for x in values["prot_pool_var"]])) print("Minimal O2" + ";" + ";".join([str(x) for x in values["o2_min"]])) print("Maximal O2" + ";" + ";".join([str(x) for x in values["o2_max"]])) model = set_up_ec_model_with_sbml( "./iJO1366star/ec_model_2019_06_25_output_optimization/iJO1366_sMOMENT_2019_06_25_STANDARD_EXCHANGE_SCENARIO_MANUAL_CHANGES_FMINCON_CHANGE_FACTOR_50.xml", 0.095) aerobic_space = list(np.linspace(.14, 9.53, 25)) + list( np.linspace(9.54, 13.829, 25)) fba_with_glucose_levels(model, aerobic_space, "Aerobe") """ print("===") model.reactions.EX_o2_e.lower_bound = 0 anaerobic_space = list(np.linspace(1.26, 16.69, 25)) + list(np.linspace(16.7, 24.987, 25)) fba_with_glucose_levels(model, anaerobic_space, "Anaerobe") """
"Max prot pool?:", fba_solution.fluxes.ER_pool_TG_ == model_smoment.reactions.ER_pool_TG_.upper_bound) print( "Max glucose?:", fba_solution.fluxes.EX_glc__D_e == model_smoment.reactions.EX_glc__D_e.lower_bound) model_smoment.summary(fva=1.0) print("Used protein pool:", fba_solution.fluxes.ER_pool_TG_) print("Used glucose uptake:", fba_solution.fluxes.EX_glc__D_e) print("=======") print("") print("") print("") model_gecko = set_up_ec_model_with_sbml( "./iJO1366star/ec_model_2019_06_25_output/iJO1366_2019_06_25_GECKO.xml", 0.095) model_smoment = set_up_ec_model_with_sbml( "./iJO1366star/ec_model_2019_06_25_output/iJO1366_sMOMENT_2019_06_25_GECKO_ANALOGON.xml", 0.095) print(len(model_gecko.reactions)) print(len(model_smoment.reactions)) print("***") print(len(model_gecko.metabolites)) print(len(model_smoment.metabolites)) fba_with_glucose_levels(model_gecko, model_smoment, [1000, 50, 13.9, 9.53, 8.5, 5, 2.5][::-1], "Aerobe") print("===") model_gecko.reactions.EX_o2_e.lower_bound = 0
import cobra # Internal modules from ec_model_2019_06_25_data_scenarios_for_optimization import ec_model_scenarios_for_optimization from ec_model_2019_06_25_data_set_up_model import set_up_ec_model_with_sbml from autopacmen.submodules.reaction_flux_control_by_scenario import reaction_flux_control_by_scenario from autopacmen.submodules.get_differential_reactions import get_differential_reactions from autopacmen.submodules.helper_general import json_write # Set-up of project flux_control_folder = "iJO1366star/ec_model_2019_06_25_output_optimization/flux_control_data_2019_06_25_manual_changes/" project_name = "psb_orth" # Read SBML model print("Reading SBML model...") original_thermogecko_sbml_path: str = "./iJO1366star/ec_model_2019_06_25_output_optimization/iJO1366_sMOMENT_2019_06_25_STANDARD_EXCHANGE_SCENARIO_MANUAL_CHANGES.xml" model: cobra.Model = set_up_ec_model_with_sbml(original_thermogecko_sbml_path, .095) # Set protein bound model.reactions.get_by_id("ER_pool_TG_").upper_bound = .095 # Get flux controlling proteins print("Getting flux control files...") reaction_flux_control_by_scenario(model, flux_control_folder, project_name, ec_model_scenarios_for_optimization) # Get differential proteins print("Getting differential reactions (Growth)...") unique_differential_reactions_of_scenarios, _ = \ get_differential_reactions(list(ec_model_scenarios_for_optimization.keys()), flux_control_folder, project_name, ec_model_scenarios_for_optimization, threshold=(.1) / 1000, print_result=True)
import ec_model_2019_06_25_data_set_up_model import cobra model = ec_model_2019_06_25_data_set_up_model.set_up_ec_model_with_sbml( "ec_model_2019_06_25_output_optimization/iJO1366_sMOMENT_2019_06_25_STANDARD_EXCHANGE_SCENARIO_MANUAL_CHANGES.xml", .095) reactions_to_change = [ # Acetate "FLDR2", "ACKr_TG_forward", "ACtex_TG_forward", "POR5_TG_reverse", "PTAr_TG_reverse", # Glycerol "GLYK", "TRDR", "G3PD2_TG_forward", "GLYCtex_TG_forward", "GTHOr_TG_forward", # Oxoglutarate "AKGt2rpp_TG_forward", "AKGtex_TG_forward", # L-Alanine "ASPT", "DAAD", "PROD2", "ALAR_TG_forward", "ALATA_L_TG_forward", "ALAtex_TG_forward", "GLUDy_TG_forward",
# you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ec_model_original_generate_comparable_model.py""" import cobra from ec_model_2019_06_25_data_set_up_model import set_up_ec_model_with_sbml from autopacmen.submodules.helper_create_model import get_irreversible_model model = set_up_ec_model_with_sbml( "./iJO1366star/ec_model_2019_06_25_input/iJO1366.xml", .225) model = get_irreversible_model(model, "_TG_") cobra.io.write_sbml_model( model, "./iJO1366star/ec_model_2019_06_25_input/iJO1366_saved_by_cobrapy_and_separated_reversible_reactions.xml" ) model = set_up_ec_model_with_sbml( "./iJO1366star/ec_model_2019_06_25_input/iJO1366_saved_by_cobrapy_and_separated_reversible_reactions.xml", .225) cobra.io.write_sbml_model( model, "./iJO1366star/ec_model_2019_06_25_input/iJO1366_saved_by_cobrapy_and_separated_reversible_reactions_SHUT_DOWN_SCENARIO.xml" )
# # Copyright 2019 PSB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ec_model_analysis_fva_prot_pool.py """ from autopacmen.submodules.fva_prot_pool import fva_prot_pool from ec_model_2019_06_25_data_set_up_model import set_up_ec_model_with_sbml model = set_up_ec_model_with_sbml( "./iJO1366star/ec_model_2019_06_25_output_optimization/iJO1366star.xml", .225) model.reactions.EX_glc__D_e.lower_bound = -1000 prot_pools = [.3] prot_pool_metabolite = model.metabolites.prot_pool fva_prot_pool(model, prot_pools, "")