Skip to content

Commit

Permalink
Addressing issues #4, #5, #6 and #7
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulocracy committed Oct 13, 2020
1 parent 786ad0c commit fb58137
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
4 changes: 2 additions & 2 deletions autopacmen/data_parse_brenda_textfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright 2019 PSB
# Copyright 2019-2020 PSB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,7 +42,7 @@
"must not have been changed.")
@click.option("--json_output_path",
required=True,
type=click.Path(exists=True, dir_okay=True),
type=click.Path(file_okay=True, dir_okay=True, writable=True),
prompt="JSON output path",
help="The full path for the more machine-readable JSON file of the"
" BRENDA database text file shall be placed. The resulting JSON "
Expand Down
6 changes: 4 additions & 2 deletions autopacmen/modeling_get_reactions_kcat_mapping.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright 2019 PSB
# Copyright 2019-2020 PSB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -56,9 +56,11 @@
@click.option("--protein_kcat_database_path",
required=True,
type=click.Path(exists=True, file_okay=True, dir_okay=True),
default="",
prompt="protein kcat database path",
help="Full path to the custom user-defined kcat<->protein JSON. It must be a dictionary containing the protein names"
"(as given in the metabolic network's gene rules) as keys and associated kcats as children. See this script's description for more.")
"(as given in the metabolic network's gene rules) as keys and associated kcats as children. See this script's description for more."
"Default is '', which means that no user-defined database is given.")
@click.option("--type_of_kcat_selection",
required=True,
type=str,
Expand Down
20 changes: 16 additions & 4 deletions autopacmen/submodules/create_combined_kcat_database.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright 2019 PSB
# Copyright 2019-2020 PSB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -65,9 +65,21 @@ def create_combined_kcat_database(sabio_rk_kcat_database_path: str, brenda_kcat_
combined_database: Dict[str, Dict[str, Any]] = {}
# Go through each EC number :D...
for ec_number_key in ec_number_keys:
# Get the wildcard status (i.e., found with a * wildcard?)
is_sabio_rk_from_wildcard: bool = sabio_rk_database[ec_number_key]["WILDCARD"]
is_brenda_from_wildcard: bool = brenda_database[ec_number_key]["WILDCARD"]
# Get the wildcard status (i.e., found with a * wildcard?) and check if the EC number occurs anywhere...
# ...for SABIO-RK
if ec_number_key not in sabio_rk_database.keys():
print(f"WARNING: EC number {ec_number_key} could not be found in SABIO-RK, even with wildcards")
print("Possible reasons: The EC number format is invalid or there was an SABIO-RK API error")
is_sabio_rk_from_wildcard = True # Let the combined database ignore this entry
else:
is_sabio_rk_from_wildcard = sabio_rk_database[ec_number_key]["WILDCARD"]
# ...and for BRENDA
if ec_number_key not in brenda_database.keys():
print(f"WARNING: EC number {ec_number_key} could not be found in SABIO-RK, even with wildcards")
print("Possible reason: The EC number format is invalid")
is_brenda_from_wildcard = True # Let the combined database ignore this entry
else:
is_brenda_from_wildcard = brenda_database[ec_number_key]["WILDCARD"]

# If both are from wildcards, ignore them :3
if (is_sabio_rk_from_wildcard) and (is_brenda_from_wildcard):
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@

setuptools.setup(
name="autopacmen-Paulocracy",
version="0.5.5",
version="0.5.6",
author="Paulocracy",
author_email="[email protected]",
description="The AutoPACMEN package",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/Paulocracy/autopacmen",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
Expand Down

0 comments on commit fb58137

Please sign in to comment.