Skip to content

Commit

Permalink
Fix some bugs, primarily addressing issue #3
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulocracy committed Jul 27, 2020
1 parent 8a2fec5 commit 30d3807
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion autopacmen/submodules/get_initial_spreadsheets.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def get_initial_spreadsheets(model: cobra.Model, project_folder: str, project_na
worksheet.write(1, 0, "Fraction of masses of model-included enzymes in comparison to all enzymes (0.0 to 1.0):")
worksheet.write(1, 1, 1.0)
worksheet.write(2, 0, "Average saturation level (0.0 to 1.0):")
worksheet.write(2, 0, 1.0)
worksheet.write(2, 1, 1.0)
worksheet2 = workbook.add_worksheet("Single protein data")
worksheet2.write(0, 0, "Protein ID (as in SBML model)")
worksheet2.write(0, 1, "Protein concentration [mmol/gDW]")
Expand Down
4 changes: 2 additions & 2 deletions autopacmen/submodules/get_reactions_kcat_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def _get_kcat_list(searched_metabolites: List[str], complete_entry: Dict[str, An
species_to_search: List[str] = []
taxonomy_dict_cache: Dict[str, List[str]] = {}
for species in all_species:
cache_filename = species + "_taxonomy"
cache_filename = species.replace("/", "") + "_taxonomy"
if cache_filename in cache_files:
cache_filepath = cache_basepath + cache_filename
taxonomy_dict_cache[species] = pickle_load(cache_filepath)
Expand All @@ -149,7 +149,7 @@ def _get_kcat_list(searched_metabolites: List[str], complete_entry: Dict[str, An
taxonomy_dict_search[searched_species] = ["NOT FOUND"]

for species in list(taxonomy_dict_search.keys()):
cache_filename = species + "_taxonomy"
cache_filename = species.replace("/", "") + "_taxonomy"
if taxonomy_dict_search[species] == ["NOT FOUND"]:
cache_filename += "_NA"
cache_filepath = cache_basepath + cache_filename
Expand Down
11 changes: 8 additions & 3 deletions autopacmen/submodules/parse_brenda_textfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,14 @@ def parse_brenda_textfile(brenda_textfile_path: str, bigg_metabolites_json_folde
for ec_number in ec_numbers:
if "(transferred to " in ec_number:
actual_ec_number = ec_number.split(" (transferred")[0]
brenda_kcat_database[actual_ec_number] = {}
brenda_kcat_database[actual_ec_number]["TRANSFER"] = \
ec_number.lower().split("(transferred to ec")[1].replace(")", "").lstrip()
try:
brenda_kcat_database[actual_ec_number] = {}
brenda_kcat_database[actual_ec_number]["TRANSFER"] = \
ec_number.lower().replace(" ", " ").split("(transferred to ec")[1].replace(")", "").lstrip()
except Exception:
# Some transfers go to general subgroups instead of single EC numbers so that
# no kcat database can be built from it D:
print("WARNING: BRENDA text file line " + ec_number + " is not interpretable!")
continue

brenda_kcat_database[ec_number] = {}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="autopacmen-Paulocracy",
version="0.5.4",
version="0.5.5",
author="Paulocracy",
author_email="bekiaris@mpi-magdeburg.mpg.de",
description="The AutoPACMEN package",
Expand Down

0 comments on commit 30d3807

Please sign in to comment.