diff --git a/src/specimen/cmpb/workflow.py b/src/specimen/cmpb/workflow.py index 9325a14..9438647 100644 --- a/src/specimen/cmpb/workflow.py +++ b/src/specimen/cmpb/workflow.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -__author__ = "Tobias Fehrenbach, Famke Baeuerle and Gwendolyn O. Döbel" +__author__ = "Tobias Fehrenbach, Famke Baeuerle, Gwendolyn O. Döbel and Carolin Brune" ################################################################################ # requirements @@ -14,6 +14,7 @@ import pandas as pd import matplotlib.pyplot as plt from datetime import date +from pathlib import Path from ..util.set_up import save_cmpb_user_input @@ -33,14 +34,14 @@ def run(configpath=None): config = save_cmpb_user_input(configpath) today = date.today().strftime("%Y%m%d") - log_file = f'{config["out_path"]}rg_{str(today)}.log' + log_file = Path(config["out_path"],f'rg_{str(today)}.log') # check if the output directory is already present, if not create it if not os.path.isdir(config['out_path']): logging.info('Given out_path is not yet a directory, creating ' + config['out_path']) os.makedirs(config['out_path']) if config['visualize']: - dir = os.path.join(config['out_path'] + 'visualization/') + dir = Path(config['out_path'],'visualization') if not os.path.isdir(dir): os.makedirs(dir) @@ -64,13 +65,14 @@ def run(configpath=None): if config['multiple']: logging.info('Growth simulation for multiple models: ') models_cobra = rg.utility.io.load_model(config['multiple_paths'], 'cobra') - # ..................................... - # @TODO: - growth_all = rg.comparison.simulate_all(models_cobra, config['media'], config['growth_basis'], config['anaerobic_growth']) - growth_prefix = 'anaerobic_growth_' if config['anaerobic_growth'] else 'growth_' - growth_all.to_csv(config['out_path'] + growth_prefix + str(today) + '_' + config['growth_basis'] + '.csv', index=False) - logging.info('Multiple model growth simulation results are saved to ' + growth_prefix + str(today) + '_' + config['growth_basis'] + '.csv') - # ..................................... + growth_all = rg.analysis.growth.growth_analysis(model_cobra, + config['mediapath'], + namespace = config['namespace'], + retrieve='report') + growth_all.save(Path(config['out_path'])) + logging.info('Multiple model growth simulation results are saved to ' + str(Path(config['out_path'], 'GrowthSimReport'))) + + ########### # visualizations # ..................................... diff --git a/src/specimen/data/config/cmpb_config.yaml b/src/specimen/data/config/cmpb_config.yaml index af211af..cceb572 100644 --- a/src/specimen/data/config/cmpb_config.yaml +++ b/src/specimen/data/config/cmpb_config.yaml @@ -16,11 +16,11 @@ Settings for scripts that investigate the model: > # Set to TRUE if you want pngs that aid in model investigation, will be saved to a folder called 'visualization' visualize: TRUE -# Set the basis medium to simulate growth from -growth_basis: 'minimal_uptake' # 'default_uptake' or 'minimal_uptake' +# Set the path to a medium config for growth simulation +mediapath: 'media_config.yaml' -# Set to TRUE if you want to simulate anaerobic growth -anaerobic_growth: FALSE +# Namespace to use for the model +namespace: 'BiGG' # Settings if you want to compare multiple models multiple: FALSE @@ -30,18 +30,6 @@ multiple_paths: # enter as many paths as you need below - '' single: TRUE # set to False if you only want to work with the multiple models -# media to simulate growth from, just comment the media you do not want with a # -media: - - 'LB' - - 'RPMI' - - 'M9' - - 'SNM3' - - 'CGXII' - - 'CasA' - - 'Blood' - - 'dGMM' - - 'MP-AU' - # Determine whether the biomass function should be checked & normalised biomass: TRUE