Skip to content

Commit ee36d4c

Browse files
authored
Merge pull request #30 from klamt-lab/version_202
Version 0.6.3
2 parents e115b91 + fca5bcb commit ee36d4c

File tree

61 files changed

+2652
-1528
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2652
-1528
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,5 @@ venv.bak/
109109

110110
# Visual Studio Code configuration folders
111111
.vscode
112+
113+
uv.lock

autopacmen/analysis_fva_comparison.py

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,38 @@
2424
# IMPORTS
2525
# External module for command-line interfaces
2626
import click
27+
2728
# Internal module, contains the actual FBA comparison function
2829
from .submodules.fva_comparison import fva_comparison_with_sbml
2930

3031

3132
# Set-up command-line parameters using click decorators
3233
@click.command()
33-
@click.option("--sbml_original_path",
34-
required=True,
35-
type=click.Path(exists=True, file_okay=True,
36-
dir_okay=True, readable=True),
37-
prompt="Original SBML path",
38-
help="Full SBML path of original model without protein allocation constraints")
39-
@click.option("--sbml_protein_constrained_path",
40-
required=True,
41-
type=click.Path(exists=True, file_okay=True,
42-
dir_okay=True, readable=True),
43-
prompt="SBML path of sMOMENT-enhanced model",
44-
help="Full SBML path of sMOMENT-enhanced model.")
45-
@click.option("--objective",
46-
required=True,
47-
type=str,
48-
prompt="Objective",
49-
help="Objective of the comparative FVA.")
34+
@click.option(
35+
"--sbml_original_path",
36+
required=True,
37+
type=click.Path(exists=True, file_okay=True, dir_okay=True, readable=True),
38+
prompt="Original SBML path",
39+
help="Full SBML path of original model without protein allocation constraints",
40+
)
41+
@click.option(
42+
"--sbml_protein_constrained_path",
43+
required=True,
44+
type=click.Path(exists=True, file_okay=True, dir_okay=True, readable=True),
45+
prompt="SBML path of sMOMENT-enhanced model",
46+
help="Full SBML path of sMOMENT-enhanced model.",
47+
)
48+
@click.option(
49+
"--objective",
50+
required=True,
51+
type=str,
52+
prompt="Objective",
53+
help="Objective of the comparative FVA.",
54+
)
5055
# Command-line interface function
51-
def fba_comparison_cli(sbml_original_path: str, sbml_protein_constrained_path: str, objective: str) -> None:
56+
def fba_comparison_cli(
57+
sbml_original_path: str, sbml_protein_constrained_path: str, objective: str
58+
) -> None:
5259
"""FVA (Flux Variability Analysis) comparison with the given arguments, e.g. in order to check the validity of the sMOMENTed model.
5360
5461
An FVA result summary is shown for the original SBML model as
@@ -58,11 +65,12 @@ def fba_comparison_cli(sbml_original_path: str, sbml_protein_constrained_path: s
5865
python analysis_fva_comparison.py --sbml_original_path C:\\original.xml --sbml_protein_constrained_path C:\\pac.xml --objective ACALD
5966
"""
6067
fva_comparison_with_sbml(
61-
sbml_original_path, sbml_protein_constrained_path, objective)
68+
sbml_original_path, sbml_protein_constrained_path, objective
69+
)
6270

6371

6472
# Start-up routine if script is called
65-
if __name__ == '__main__':
73+
if __name__ == "__main__":
6674
# Thanks to the click decorators, the command-line interface
6775
# function does not need to be called directly. The given
6876
# console arguments are added automatically.

autopacmen/analysis_fva_prot_pool.py

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,44 @@
1919
(FVA) with given protein bounds on a sMOMENT-enhanced model.
2020
"""
2121

22+
from typing import List
23+
2224
# IMPORTS
2325
# External modules
2426
import click
25-
from typing import List
27+
2628
# Internal modules
2729
from .submodules.fva_prot_pool import fva_prot_pool_with_sbml
2830

2931

3032
# Set-up command-line parameters using click decorators
3133
@click.command()
32-
@click.option("--sbml_path",
33-
required=True,
34-
type=click.Path(exists=True, file_okay=True, dir_okay=True, readable=True),
35-
prompt="SBML path",
36-
help="Full path to the sMOMENT model SBML")
37-
@click.option("--protein_pool_bounds",
38-
required=True,
39-
type=str,
40-
prompt="Protein pool bounds",
41-
help="Protein pool bounds for which the FVAs are run, semicolon-separated.")
42-
@click.option("--objective",
43-
required=False,
44-
default="",
45-
type=str,
46-
prompt="Objective",
47-
help="Objective of the FVA.")
34+
@click.option(
35+
"--sbml_path",
36+
required=True,
37+
type=click.Path(exists=True, file_okay=True, dir_okay=True, readable=True),
38+
prompt="SBML path",
39+
help="Full path to the sMOMENT model SBML",
40+
)
41+
@click.option(
42+
"--protein_pool_bounds",
43+
required=True,
44+
type=str,
45+
prompt="Protein pool bounds",
46+
help="Protein pool bounds for which the FVAs are run, semicolon-separated.",
47+
)
48+
@click.option(
49+
"--objective",
50+
required=False,
51+
default="",
52+
type=str,
53+
prompt="Objective",
54+
help="Objective of the FVA.",
55+
)
4856
# Command-line interface function
49-
def fva_prot_pool_with_sbml_cli(sbml_path: str, objective: str, protein_pool_bounds: str) -> None:
57+
def fva_prot_pool_with_sbml_cli(
58+
sbml_path: str, objective: str, protein_pool_bounds: str
59+
) -> None:
5060
"""Runs an FVA (Flux Variability Analysis) and prints the result with the sMOMENT-enhanced model and the given protein pool bounds.
5161
5262
The FVA results are generated by cobrapy can give a hint how to fit the protein pool.
@@ -60,13 +70,15 @@ def fva_prot_pool_with_sbml_cli(sbml_path: str, objective: str, protein_pool_bou
6070
"""
6171
# Parse protein pool bounds given by user as string with each protein pool separated with a semicolon
6272
protein_pool_bounds_list: List[str] = protein_pool_bounds.split(";")
63-
protein_pool_bounds_float_list: List[float] = [float(x) for x in protein_pool_bounds_list]
73+
protein_pool_bounds_float_list: List[float] = [
74+
float(x) for x in protein_pool_bounds_list
75+
]
6476
# Run FVAs :D
6577
fva_prot_pool_with_sbml(sbml_path, protein_pool_bounds_float_list, objective)
6678

6779

6880
# Start-up routine if script is called
69-
if __name__ == '__main__':
81+
if __name__ == "__main__":
7082
# Thanks to the click decorators, the command-line interface
7183
# function does not need to be called directly. The given
7284
# console arguments are added automatically.

autopacmen/data_create_combined_kcat_database.py

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,37 @@
2121
# IMPORTS
2222
# External modules
2323
import click
24+
2425
# Internal modules
2526
from .submodules.create_combined_kcat_database import create_combined_kcat_database
2627

2728

2829
# Set-up command-line parameters using click decorators
2930
@click.command()
30-
@click.option("--sabio_rk_kcat_database_path",
31-
required=True,
32-
type=click.Path(exists=True, file_okay=True, dir_okay=True, readable=True),
33-
prompt="SABIO-RK JSON path",
34-
help="Full path SABIO-RK JSON created with data_parse_brenda_json_for_model.py")
35-
@click.option("--brenda_kcat_database_path",
36-
required=True,
37-
type=click.Path(exists=True, file_okay=True, dir_okay=True, readable=True),
38-
prompt="BRENDA JSON path",
39-
help="")
40-
@click.option("--output_path",
41-
required=True,
42-
type=click.Path(exists=True, file_okay=True, dir_okay=True),
43-
prompt="Output path",
44-
help="Full path to the newly created combined JSON")
45-
def parse_create_combined_kcat_database(sabio_rk_kcat_database_path: str, brenda_kcat_database_path: str, output_path: str) -> None:
31+
@click.option(
32+
"--sabio_rk_kcat_database_path",
33+
required=True,
34+
type=click.Path(exists=True, file_okay=True, dir_okay=True, readable=True),
35+
prompt="SABIO-RK JSON path",
36+
help="Full path SABIO-RK JSON created with data_parse_brenda_json_for_model.py",
37+
)
38+
@click.option(
39+
"--brenda_kcat_database_path",
40+
required=True,
41+
type=click.Path(exists=True, file_okay=True, dir_okay=True, readable=True),
42+
prompt="BRENDA JSON path",
43+
help="",
44+
)
45+
@click.option(
46+
"--output_path",
47+
required=True,
48+
type=click.Path(exists=True, file_okay=True, dir_okay=True),
49+
prompt="Output path",
50+
help="Full path to the newly created combined JSON",
51+
)
52+
def parse_create_combined_kcat_database(
53+
sabio_rk_kcat_database_path: str, brenda_kcat_database_path: str, output_path: str
54+
) -> None:
4655
"""Combines the BRENDA and SABIO-RK JSONs into one big JSON which can be used by modeling_get_reactions_kcat_mapping.py
4756
4857
The BRENDA JSON is to have been created with data_parse_brenda_json_for_model.py, the SABIO-RK JSON with
@@ -57,11 +66,13 @@ def parse_create_combined_kcat_database(sabio_rk_kcat_database_path: str, brenda
5766
python data_create_combined_kcat_database.py --sabio_rk_kcat_database_path C:\\JSONS\\brenda.json --brenda_kcat_database_path C:\\JSONS\\sabio.json --output_path C:\\JSONS\\sabio.json
5867
</pre>
5968
"""
60-
create_combined_kcat_database(sabio_rk_kcat_database_path, brenda_kcat_database_path, output_path)
69+
create_combined_kcat_database(
70+
sabio_rk_kcat_database_path, brenda_kcat_database_path, output_path
71+
)
6172

6273

6374
# Start-up routine if script is called
64-
if __name__ == '__main__':
75+
if __name__ == "__main__":
6576
# Thanks to the click decorators, the command-line interface
6677
# function does not need to be called directly. The given
6778
# console arguments are added automatically.

autopacmen/data_parse_bigg_metabolites_file.py

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,30 @@
2222
# IMPORTS
2323
# External modules
2424
import click
25+
2526
# Internal modules
2627
from .submodules.parse_bigg_metabolites_file import parse_bigg_metabolites_file
2728

2829

2930
# Set-up command-line parameters using click decorators
3031
@click.command()
31-
@click.option("--bigg_metabolites_file_path",
32-
required=True,
33-
type=click.Path(exists=True, file_okay=True, dir_okay=True, readable=True),
34-
prompt="Full path to the BIGG metabolites",
35-
help="BIGG metabolites file path")
36-
@click.option("--json_output_folder",
37-
required=True,
38-
type=click.Path(exists=True, dir_okay=True),
39-
prompt="JSON output folder",
40-
help="Path to the folder in which the newly generated JSON will be created")
41-
def parse_brenda_textfile_cli(bigg_metabolites_file_path: str, json_output_folder: str) -> None:
32+
@click.option(
33+
"--bigg_metabolites_file_path",
34+
required=True,
35+
type=click.Path(exists=True, file_okay=True, dir_okay=True, readable=True),
36+
prompt="Full path to the BIGG metabolites",
37+
help="BIGG metabolites file path",
38+
)
39+
@click.option(
40+
"--json_output_folder",
41+
required=True,
42+
type=click.Path(exists=True, dir_okay=True),
43+
prompt="JSON output folder",
44+
help="Path to the folder in which the newly generated JSON will be created",
45+
)
46+
def parse_brenda_textfile_cli(
47+
bigg_metabolites_file_path: str, json_output_folder: str
48+
) -> None:
4249
"""Converts the given BIGG metabolites text file into a machine-readable JSON file.
4350
4451
The BIGG metabolites text file can be downloaded as text file from http://bigg.ucsd.edu/data_access
@@ -57,7 +64,7 @@ def parse_brenda_textfile_cli(bigg_metabolites_file_path: str, json_output_folde
5764

5865

5966
# Start-up routine if script is called
60-
if __name__ == '__main__':
67+
if __name__ == "__main__":
6168
# Thanks to the click decorators, the command-line interface
6269
# function does not need to be called directly. The given
6370
# console arguments are added automatically.

autopacmen/data_parse_brenda_json_for_model.py

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,39 @@
2222
# IMPORTS
2323
# External modules
2424
import click
25+
2526
# Internal modules
2627
from .submodules.parse_brenda_json_for_model import parse_brenda_json_for_model
2728

2829

2930
# Set-up command-line parameters using click decorators
3031
@click.command()
31-
@click.option("--sbml_path",
32-
required=True,
33-
type=click.Path(exists=True, file_okay=True,
34-
dir_okay=True, readable=True),
35-
prompt="Path to SBML model",
36-
help="Full path to the SBML with the model of which the BRENDA JSON will be derived.")
37-
@click.option("--brenda_json_path",
38-
required=True,
39-
type=click.Path(exists=True, file_okay=True,
40-
dir_okay=True, readable=True),
41-
prompt="BRENDA JSON path",
42-
help="Full path to the BRENDA JSON created with data_parse_brenda_textfile.py")
43-
@click.option("--json_output_path",
44-
required=True,
45-
type=click.Path(file_okay=True, dir_okay=True, writable=True),
46-
prompt="JSON output path",
47-
help="The full path for the model-specific JSON file of the "
48-
"BRENDA JSON created with data_parse_brenda_textfile.py")
32+
@click.option(
33+
"--sbml_path",
34+
required=True,
35+
type=click.Path(exists=True, file_okay=True, dir_okay=True, readable=True),
36+
prompt="Path to SBML model",
37+
help="Full path to the SBML with the model of which the BRENDA JSON will be derived.",
38+
)
39+
@click.option(
40+
"--brenda_json_path",
41+
required=True,
42+
type=click.Path(exists=True, file_okay=True, dir_okay=True, readable=True),
43+
prompt="BRENDA JSON path",
44+
help="Full path to the BRENDA JSON created with data_parse_brenda_textfile.py",
45+
)
46+
@click.option(
47+
"--json_output_path",
48+
required=True,
49+
type=click.Path(file_okay=True, dir_okay=True, writable=True),
50+
prompt="JSON output path",
51+
help="The full path for the model-specific JSON file of the "
52+
"BRENDA JSON created with data_parse_brenda_textfile.py",
53+
)
4954
# Command-line interface function
50-
def parse_brenda_json_for_model_cli(sbml_path: str, brenda_json_path: str, json_output_path: str) -> None:
55+
def parse_brenda_json_for_model_cli(
56+
sbml_path: str, brenda_json_path: str, json_output_path: str
57+
) -> None:
5158
"""Converts the given BRENDA JSON created with data_parse_brenda_textfile.py into a even more easily readable model-specific JSON.
5259
5360
This conversion is needed for all subsequent AutoPACMEN steps. The model-specific JSON contains all of the model's EC number entries
@@ -65,7 +72,7 @@ def parse_brenda_json_for_model_cli(sbml_path: str, brenda_json_path: str, json_
6572

6673

6774
# Start-up routine if script is called
68-
if __name__ == '__main__':
75+
if __name__ == "__main__":
6976
# Thanks to the click decorators, the command-line interface
7077
# function does not need to be called directly. The given
7178
# console arguments are added automatically.

0 commit comments

Comments
 (0)