|
1 |
| -from tkinter.messagebox import NO |
2 |
| -import matplotlib.pyplot as plt |
| 1 | +"""This module contains the function for the Concentration Variability Analysis (CVA).""" |
| 2 | + |
| 3 | +# IMPORT SECTION # |
| 4 | +# External |
3 | 5 | import cobra
|
4 | 6 | import copy
|
| 7 | +import matplotlib.pyplot as plt |
5 | 8 | import os
|
6 | 9 | import pulp
|
7 | 10 | from math import exp
|
8 |
| -from cosa_get_all_tcosa_reaction_ids import get_all_tcosa_reaction_ids |
9 |
| -from cosa_get_model_with_nadx_scenario import cosa_get_model_with_nadx_scenario |
10 |
| -from cosa_get_suffix import cosa_get_suffix |
11 |
| -from helper import json_load, json_write, json_zip_load |
12 |
| -from typing import List |
| 11 | +from typing import Dict, List |
| 12 | +# Internal |
13 | 13 | from optmdfpathway import (
|
14 | 14 | STANDARD_R, STANDARD_T, get_optmdfpathway_base_problem,
|
15 | 15 | add_differential_reactions_constraints, get_z_variable_status,
|
|
18 | 18 | from cosa_load_model_data import (
|
19 | 19 | MIN_OPTMDF, load_model_data
|
20 | 20 | )
|
21 |
| -from typing import Dict |
22 |
| -from helper import ensure_folder_existence |
| 21 | +from cosa_get_all_tcosa_reaction_ids import get_all_tcosa_reaction_ids |
| 22 | +from cosa_get_model_with_nadx_scenario import cosa_get_model_with_nadx_scenario |
| 23 | +from cosa_get_suffix import cosa_get_suffix |
| 24 | +from helper import ensure_folder_existence, json_load, json_write, json_zip_load |
23 | 25 |
|
24 | 26 |
|
| 27 | +# PUBLIC FUNCTIONS SECTION # |
25 | 28 | def cosa_cva(metabolites: List[str], anaerobic: bool, expanded: bool, growth_epsilon: float = 0.01) -> None:
|
| 29 | + """Performs a concentration variability analysis (CVA). |
| 30 | +
|
| 31 | + As a results, it writes JSON files with the CVA results in the 'cosa' subfolder' |
| 32 | +
|
| 33 | + ### Arguments |
| 34 | + * metabolites: List[str] ~ List of metabolite IDs for all metabolites for which a CVA shall be performed. |
| 35 | + * anaerobic: bool ~ Whether or not anaerobicity is the case. |
| 36 | + * expanded: bool ~ Whether (True) 3 or 2 (False) redox cofactors are used. |
| 37 | + * growth_epsilon: float = 0.01 ~ The numeric stability factor to go below µ. |
| 38 | + """ |
26 | 39 | suffix = cosa_get_suffix(anaerobic, expanded)
|
27 | 40 | figures_path = f"./cosa/results{suffix}/figures/"
|
28 | 41 | ensure_folder_existence(figures_path)
|
|
0 commit comments