Skip to content

Commit

Permalink
Upload of actual program
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavlos Bekiaris committed Nov 7, 2019
1 parent 520695d commit 5531666
Show file tree
Hide file tree
Showing 3,434 changed files with 2,767,422 additions and 8 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
20 changes: 12 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so
# AutoPACMEN-custom gitignores:
autopacmen/ec_model_2019_06_25_input/brenda_download.txt

# Default GitHub Python .gitignore file content:
# Distribution / packaging
.Python
build/
Expand All @@ -25,6 +21,14 @@ wheels/
*.egg
MANIFEST

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
Expand Down Expand Up @@ -101,4 +105,4 @@ venv.bak/
/site

# mypy
.mypy_cache/
.mypy_cache/
85 changes: 85 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# AutoPACMEN (Automatic integration of Protein Allocation Constraints for stoichiometric MEtabolic Networks)


## General Description

AutoPACMEN allows one to apply the sMOMENT method of automatically expanding a stoichiometric metabolic
model with protein allocation constraints (Bekiaris & Klamt, in submission).
AutoPACMEN consists of 2 parts:
1) A Python 3 Model Generator which primarily uses [cobrapy](https://github.com/opencobra/cobrapy) and which applies the sMOMENT
method on a stoichiometric metabolic model.
2) An optional mixed Python 3/MATLAB Model Calibrator whose MATLAB parts primarily use [CellNetAnalyzer](https://www2.mpi-magdeburg.mpg.de/projects/cna/cna.html)
and which allows one to optimize given protein allocation constraints in order to get a better fit
with <i>in vivo</i> data.


## Documentation

AutoPACMEN's manual can be found as "manual.pdf" or "manual.odt" in the "docs" subfolder of the "autopacmen" folder.
It explains the manual installation process (without pip, see next chapter for the installation with pip) and usage of AutoPACMEN in detail.

An HTML documentation of the source code of AutoPACMEN's Python modules can be found under the main folder's subfolder "html".
This HTML documentation was automatically generated using [pdoc3](https://pdoc3.github.io/pdoc/) (link accessed on Oct 30, 2019).
The HTML documentation's starting point is "index.html" in the "./html/autopacmen" subfolder.

In addition, the exemplary usage of AutoPACMEN with iJO1366* is explained in AutoPACMEN's publication Supplementary File 1.

<b>Note:</b> As it has a huge file size, the downloaded complete BRENDA text file brenda_downloads.txt (as described in
AutoPACMEN's manual) is not included here.

If you are particularily interested in the generation of k<sub>cat</sub> databases from BRENDA and SABIO-RK, look up
the scripts "data_parse_brenda_textfile.py", "data_parse_sabio_rk_for_model.py" as well as the combining
script "data_create_combined_kcat_database.py". These scripts create JSON files with the k<sub>cat</sub> data from these
databases with EC number, organism and substrate information. An exemplary created database with BRENDA is
"kcat_database_brenda" in the main folder's subfolder "ec_model_2019_06_25_output", a database with SABIO-RK is
"kcat_database_sabio_rk" in the same subfolder.

AutoPACMEN requires Python >=3.7 for its Python parts, and MATLAB >=2017a for its optional Model Calibrator
MATLAB scripts.



## Installation of Python parts using pip

You can install the Python parts of AutoPACMEN's latest release [from PyPI]() using pip as follows:
<pre>
pip install autopacmen-Paulocracy
</pre>


## Structure of AutoPACMEN's source code

<b>All relevant scripts are in the "autopacmen" main folder.</b>

In this main folder, the scripts which start with "analysis_", "data_" and "modeling_" are command-line interfaces (CLI)
for AutoPACMEN's Python modules. These Python modules can be found the main folder's "submodules" subfolder.

The main folder's subfolder "AutoPACMEN_Model_Calibrator_MATLAB" contains the Model Calibrator's MATLAB parts.

All scripts and folders starting with "ec_model_2019_06_25" are part of the generation and analysis of iJO1366* (see AutoPACMEN's publication for more on it). From these scripts, these ones
starting with "ec_model_2019_06_25_figure" create either a full figure or data for a figure used in AutoPACMEN's publication.

The main script for the generation of the uncalibrated iJO1366* model is "ec_model_2019_06_25_sMOMENT_iJO_CREATION.py" in the main folder. This
main script uses AutoPACMEN's functionalities as Python modules. The commented steps in this script correspond to the steps described in supplementary
File 1 of (Bekiaris & Klamt, in submission).


The main folder's subfolder "iJOstar_MCS_analysis_scripts" contains the scripts used for the computation and the analysis of the published Minimal Cut Set enumeration
with iJO1366 and iJO1366*.

AutoPACMEN creates a cache of SABIO-RK, NCBI TAXONOMY and UniProt data in the "_cache" main folder's subfolder. In the current state, the cache is the one
from AutoPACMEN's run for iJO1366* around the 25th of June 2019.


## AutoPACMEN's Publication

* Bekiaris PS & Klamt S; "Automatic Construction of Metabolic Models with Enzyme Constraints"; in submission

## License

This project is free and open-source, using the Apache License Version 2.0.


## External sources

External sources which are included in this package are given in the respective SOURCES.txt files.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
These are the MATLAB scripts of AutoPACMEN's Model Calibrator. Read AutoPACMEN's
manual for more information on them, and/or look at "kcat_optimization_run_fmincon_ec_model_2019_06_25.m"
for an example of the Model Calibrator's kcat optimization method usage.

NOTE: You have to change the paths to the iJO1366*C model (see Supplementary File 1) to its location on your
system in order to rerun "kcat_optimization_run_fmincon_ec_model_2019_06_25.m".

MATLAB scripts starting with "p_" are considered "private" scripts which are not intended for a direct
usage by the user and are therefore not documented in the manual.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
% 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.

function [best_kcats, start_kcats] = kcat_optimization_run_fmincon_ec_model_2019_06_25()
% This is the optimization run of iJO1366*C (iJO1366* with manually changes protein pool
% and manual changes for anaerobic conditions) for the scenarios given in "optimization_scenarios.json".

% Load Orth model with kcats :D
[cna_model, ~] = CNAsbmlModel2MFNetwork('/.../iJO1366_sMOMENT_2019_06_25_STANDARD_EXCHANGE_SCENARIO_MANUAL_CHANGES.xml');
% Fitted for 25 growth scenarios
cna_model.reacMax(strmatch('R_ER_pool_TG_', cna_model.reacID, 'exact')) = .095;

% Set arguments for optimization \o/
% Reactions of which the kcats shall be changed :-)
reactions_to_change = [
% Acetate
"R_FLDR2",
"R_ACKr_TG_forward",
"R_ACtex_TG_forward",
"R_POR5_TG_reverse",
"R_PTAr_TG_reverse",
% Glycerol
"R_GLYK",
"R_TRDR",
"R_G3PD2_TG_forward",
"R_GLYCtex_TG_forward",
"R_GTHOr_TG_forward",
% Oxoglutarate
"R_AKGt2rpp_TG_forward",
"R_AKGtex_TG_forward",
% L-Alanine
"R_ASPT",
"R_DAAD",
"R_PROD2",
"R_ALAR_TG_forward",
"R_ALATA_L_TG_forward",
"R_ALAtex_TG_forward",
"R_GLUDy_TG_forward",
"R_VALTA_TG_forward",
% Pyruvate
"R_PYRtex_TG_forward",
% Fructose
"R_FRUK",
"R_FRUpts2pp",
"R_FRUptspp",
"R_FRUtex_TG_forward",
% Guanosine
"R_ALLTAMH",
"R_ALLTN",
"R_GMPR",
"R_GSNK",
"R_GSNt2pp",
"R_GUAD",
"R_UGLYCH",
"R_XAND",
"R_GSNtex_TG_forward",
"R_PPM_TG_forward",
"R_PRPPS_TG_reverse",
"R_PUNP3_TG_forward",
% N-acetylglucosamine
"R_ACGAptspp",
"R_AGDC",
"R_ACGAtex_TG_forward",
% Fumarate
"R_FUMt2_2pp",
"R_FUMt2_3pp",
"R_FUMtex_TG_forward",
% Ribose
"R_PGCD",
"R_PSP_L",
"R_RBK",
"R_RIBabcpp",
"R_GHMT2r_TG_forward",
"R_MTHFD_TG_forward",
"R_RIBtex_TG_forward",
% L-Lactate
"R_L_LACt2rpp_TG_forward",
"R_L_LACtex_TG_forward",
% Gluconate
"R_GLCNt2rpp_TG_forward",
"R_GLCNtex_TG_forward",
% Sorbitol
"R_SBTptspp",
"R_SBTPD_TG_forward",
"R_SBTtex_TG_forward",
% Glucosamine
"R_GAMptspp",
"R_GAMtex_TG_forward",
% L-Malate
"R_MALt2_2pp",
"R_MALt2_3pp",
"R_MALtex_TG_forward",
% Succinate
"R_SUCCt2_2pp",
"R_SUCCt2_3pp",
"R_SUCCtex_TG_forward",
% Maltose
"R_AMALT2",
"R_AMALT3",
"R_AMALT4",
"R_MALTabcpp",
"R_MALTtexi",
"R_MLTP1_TG_forward",
"R_MLTP2_TG_forward",
"R_MLTP3_TG_forward",
% Glucose 6-Phosphate
"R_G6Pt6_2pp",
"R_G6Ptex_TG_forward",
"R_PItex_TG_reverse",
% Mannitol
"R_MNLptspp",
"R_M1PD_TG_forward",
"R_MNLtex_TG_forward",
% Trehalose
"R_TRE6PH",
"R_TREHpp",
"R_TREtex_TG_forward",
% Xylose
"R_XYLK",
"R_XYLt2pp",
"R_RPE_TG_reverse",
"R_RPI_TG_reverse",
"R_XYLI1_TG_forward",
"R_XYLtex_TG_forward",
% Mannose
"R_MANptspp",
"R_MAN6PI_TG_forward",
"R_MANtex_TG_forward",
% Galactose
"R_GALt2pp",
"R_GALKr_TG_forward",
"R_GALtex_TG_forward",
"R_UDPG4E_TG_reverse",
"R_UGLT_TG_forward"
];

% Read scenarios JSON
text = fileread('./0FminconOptimization/optimization_scenarios.json');
scenarios = jsondecode(text);
% Get scenarios maximization/minimization matrix
scenarios_matrix = {
"Glucose_Aerobic_Growth", "NA";
"Glucose_Anaerobic_Growth", "NA";
"Acetate", "NA";
"Glycerol", "NA";
"Oxoglutarate", "NA";
"L_Alanine", "NA";
"Pyruvate", "NA";
"Fructose", "NA";
"Guanosine", "NA";
"N_acetylglucosamine", "NA";
"Fumarate", "NA";
"Ribose", "NA";
"L_Lactate", "NA";
"Gluconate", "NA";
"Sorbitol", "NA";
"Glucosamine", "NA";
"L_Malate", "NA";
"Succinate", "NA";
"Maltose", "NA";
"Glucose_6_Phosphate", "NA";
"Mannitol", "NA";
"Trehalose", "NA";
"Xylose", "NA";
"Mannose", "NA";
"Galactose", "NA";
};

max_change_factor = 50;
[best_kcats, start_kcats] = moment_optimization_fmincon(cna_model, reactions_to_change, scenarios, scenarios_matrix, max_change_factor);
disp(best_kcats)
best_kcats = best_kcats';
save('./0FminconOptimization/best_values_2019_06_25_manual_changes_change_factor_50.mat','best_kcats');
start_kcats = start_kcats';
save('./0FminconOptimization/start_values_2019_06_25_manual_changes_change_factor_50.mat','start_kcats');
end
Loading

0 comments on commit 5531666

Please sign in to comment.