From 5a069a26df2dfcb6f6df29e3f224af32c355520a Mon Sep 17 00:00:00 2001 From: Jakob Peder Pettersen Date: Fri, 20 Nov 2020 09:57:40 +0100 Subject: [PATCH 1/2] Hopefully solved an issue with protein mapping raising error when there ambigious amino acids --- .../submodules/get_protein_mass_mapping.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/autopacmen/submodules/get_protein_mass_mapping.py b/autopacmen/submodules/get_protein_mass_mapping.py index f1ec370..2d622b6 100644 --- a/autopacmen/submodules/get_protein_mass_mapping.py +++ b/autopacmen/submodules/get_protein_mass_mapping.py @@ -23,7 +23,6 @@ import cobra import requests import time -from Bio.SeqUtils.ProtParam import ProteinAnalysis from typing import Dict, List # Internal modules from .helper_general import ensure_folder_existence, get_files, json_write, pickle_write, pickle_load, standardize_folder @@ -33,7 +32,7 @@ def get_protein_mass_mapping(model: cobra.Model, project_folder: str, project_name: str) -> None: """Returns a JSON with a mapping of protein IDs as keys, and as values the protein mass in kDa. - The protein masses are calculated using the amino acid sequence from UniProt (retrieved using + The protein masses are taken from UniProt (retrieved using UniProt's REST API). Arguments @@ -114,7 +113,7 @@ def get_protein_mass_mapping(model: cobra.Model, project_folder: str, project_na # With 'OR', all given IDs are searched, and subsequently in this script, # the right associated masses are being picked. query = " OR ".join(batch) - uniprot_query_url = f"https://www.uniprot.org/uniprot/?query={query}&format=tab&columns=id,sequence" + uniprot_query_url = f"https://www.uniprot.org/uniprot/?query={query}&format=tab&columns=id,mass" print(f"UniProt batch search for: {query}") # Call UniProt's API :-) @@ -127,18 +126,20 @@ def get_protein_mass_mapping(model: cobra.Model, project_folder: str, project_na if line == "": continue uniprot_id = line.split("\t")[0] - sequence = line.split("\t")[1] - # Get the protein mass using biopython's associated function for amino acid sequences + mass_string = line.split("\t")[1] try: - mass = ProteinAnalysis(sequence, monoisotopic=False).molecular_weight() - except ValueError: # e.g. if an "X" is in a sequence + # Note that the mass entry from UniProt uses a comma as a thousand separator, so it has to be removed before parsing + mass = float(mass_string.replace(",","")) + except ValueError: # We may also risk the entry is missing + # print(f"No protein mass obtainable for protein ID {uniprot_id}") continue uniprot_id_protein_mass_mapping[uniprot_id] = float(mass) # Create the pickled cache files for the searched protein masses for uniprot_id in batch: - cache_filepath = cache_basepath + uniprot_id - pickle_write(cache_filepath, uniprot_id_protein_mass_mapping[uniprot_id]) + if uniprot_id in uniprot_id_protein_mass_mapping: # Takes into account that we may fail to obtain a UniProt ID + cache_filepath = cache_basepath + uniprot_id + pickle_write(cache_filepath, uniprot_id_protein_mass_mapping[uniprot_id]) # Continue with the next batch :D batch_start += batch_size From 58683c89c8e9a4c00cbc843f8149ea926021c539 Mon Sep 17 00:00:00 2001 From: Jakob Peder Pettersen Date: Fri, 20 Nov 2020 12:09:53 +0100 Subject: [PATCH 2/2] Updated html documentation after fixing protein mapping bug --- .../autopacmen/analysis_fva_comparison.html | 8 +- .../autopacmen/analysis_fva_prot_pool.html | 8 +- .../data_create_combined_kcat_database.html | 8 +- .../data_parse_bigg_metabolites_file.html | 8 +- .../data_parse_brenda_json_for_model.html | 8 +- .../data_parse_brenda_textfile.html | 8 +- .../data_parse_sabio_rk_for_model.html | 8 +- autopacmen/html/autopacmen/index.html | 38 +++---- .../modeling_create_gecko_model.html | 8 +- .../modeling_create_smoment_model.html | 8 +- .../modeling_get_initial_spreadsheets.html | 8 +- .../modeling_get_protein_mass_mapping.html | 8 +- .../modeling_get_reactions_kcat_mapping.html | 8 +- .../optimization_apply_manual_changes.html | 8 +- .../submodules/apply_manual_changes.html | 20 ++-- .../create_combined_kcat_database.html | 22 ++-- .../create_gecko_model_reaction_wise.html | 18 +-- .../create_smoment_model_reaction_wise.html | 18 +-- .../autopacmen/submodules/fva_comparison.html | 20 ++-- .../autopacmen/submodules/fva_prot_pool.html | 18 +-- .../get_differential_reactions.html | 20 ++-- .../submodules/get_initial_spreadsheets.html | 20 ++-- .../submodules/get_protein_mass_mapping.html | 64 ++++++----- .../get_reactions_kcat_mapping.html | 30 ++--- .../submodules/helper_create_model.html | 50 ++++----- .../autopacmen/submodules/helper_general.html | 104 +++++++++--------- .../html/autopacmen/submodules/index.html | 48 ++++---- .../html/autopacmen/submodules/kegg.html | 24 ++-- .../autopacmen/submodules/ncbi_taxonomy.html | 40 +++---- .../parse_bigg_metabolites_file.html | 22 ++-- .../parse_brenda_json_for_model.html | 22 ++-- .../submodules/parse_brenda_textfile.html | 26 ++--- .../autopacmen/submodules/parse_sabio_rk.html | 62 +++++------ .../submodules/parse_sabio_rk_for_model.html | 32 +++--- .../reaction_flux_control_by_scenario.html | 14 +-- 35 files changed, 420 insertions(+), 416 deletions(-) diff --git a/autopacmen/html/autopacmen/analysis_fva_comparison.html b/autopacmen/html/autopacmen/analysis_fva_comparison.html index 37d9465..36e114c 100644 --- a/autopacmen/html/autopacmen/analysis_fva_comparison.html +++ b/autopacmen/html/autopacmen/analysis_fva_comparison.html @@ -3,14 +3,14 @@ - + autopacmen.analysis_fva_comparison API documentation - - + + @@ -125,7 +125,7 @@

Index

diff --git a/autopacmen/html/autopacmen/analysis_fva_prot_pool.html b/autopacmen/html/autopacmen/analysis_fva_prot_pool.html index 53ff093..6fbb069 100644 --- a/autopacmen/html/autopacmen/analysis_fva_prot_pool.html +++ b/autopacmen/html/autopacmen/analysis_fva_prot_pool.html @@ -3,14 +3,14 @@ - + autopacmen.analysis_fva_prot_pool API documentation - - + + @@ -127,7 +127,7 @@

Index

diff --git a/autopacmen/html/autopacmen/data_create_combined_kcat_database.html b/autopacmen/html/autopacmen/data_create_combined_kcat_database.html index 00bc311..45069c5 100644 --- a/autopacmen/html/autopacmen/data_create_combined_kcat_database.html +++ b/autopacmen/html/autopacmen/data_create_combined_kcat_database.html @@ -3,14 +3,14 @@ - + autopacmen.data_create_combined_kcat_database API documentation - - + + @@ -121,7 +121,7 @@

Index

diff --git a/autopacmen/html/autopacmen/data_parse_bigg_metabolites_file.html b/autopacmen/html/autopacmen/data_parse_bigg_metabolites_file.html index 62de3da..2aaced9 100644 --- a/autopacmen/html/autopacmen/data_parse_bigg_metabolites_file.html +++ b/autopacmen/html/autopacmen/data_parse_bigg_metabolites_file.html @@ -3,14 +3,14 @@ - + autopacmen.data_parse_bigg_metabolites_file API documentation - - + + @@ -118,7 +118,7 @@

Index

diff --git a/autopacmen/html/autopacmen/data_parse_brenda_json_for_model.html b/autopacmen/html/autopacmen/data_parse_brenda_json_for_model.html index 67fc35e..17dcdf1 100644 --- a/autopacmen/html/autopacmen/data_parse_brenda_json_for_model.html +++ b/autopacmen/html/autopacmen/data_parse_brenda_json_for_model.html @@ -3,14 +3,14 @@ - + autopacmen.data_parse_brenda_json_for_model API documentation - - + + @@ -126,7 +126,7 @@

Index

diff --git a/autopacmen/html/autopacmen/data_parse_brenda_textfile.html b/autopacmen/html/autopacmen/data_parse_brenda_textfile.html index f05fec2..ba06a6f 100644 --- a/autopacmen/html/autopacmen/data_parse_brenda_textfile.html +++ b/autopacmen/html/autopacmen/data_parse_brenda_textfile.html @@ -3,14 +3,14 @@ - + autopacmen.data_parse_brenda_textfile API documentation - - + + @@ -134,7 +134,7 @@

Index

diff --git a/autopacmen/html/autopacmen/data_parse_sabio_rk_for_model.html b/autopacmen/html/autopacmen/data_parse_sabio_rk_for_model.html index 2d9a732..caf97ed 100644 --- a/autopacmen/html/autopacmen/data_parse_sabio_rk_for_model.html +++ b/autopacmen/html/autopacmen/data_parse_sabio_rk_for_model.html @@ -3,14 +3,14 @@ - + autopacmen.data_parse_sabio_rk_for_model API documentation - - + + @@ -129,7 +129,7 @@

Index

diff --git a/autopacmen/html/autopacmen/index.html b/autopacmen/html/autopacmen/index.html index 849d636..eedc2d4 100644 --- a/autopacmen/html/autopacmen/index.html +++ b/autopacmen/html/autopacmen/index.html @@ -3,21 +3,21 @@ - + autopacmen API documentation - - + +
-

Module autopacmen

+

Package autopacmen

@@ -26,59 +26,59 @@

Sub-modules

autopacmen.analysis_fva_comparison
-

analysis_fba_comparison.py …

+

analysis_fba_comparison.py …

autopacmen.analysis_fva_prot_pool
-

analysis_fva_prot_pool.py …

+

analysis_fva_prot_pool.py …

autopacmen.data_create_combined_kcat_database
-

data_create_combined_kcat_database.py …

+

data_create_combined_kcat_database.py …

autopacmen.data_parse_bigg_metabolites_file
-

data_parse_bigg_metabolites_file.py …

+

data_parse_bigg_metabolites_file.py …

autopacmen.data_parse_brenda_json_for_model
-

data_parse_brenda_textfile_for_model.py …

+

data_parse_brenda_textfile_for_model.py …

autopacmen.data_parse_brenda_textfile
-

data_parse_brenda_textfile.py …

+

data_parse_brenda_textfile.py …

autopacmen.data_parse_sabio_rk_for_model
-

data_parse_sabio_rk_for_model.py …

+

data_parse_sabio_rk_for_model.py …

autopacmen.modeling_create_gecko_model
-

modeling_create_gecko_model.py

+

modeling_create_gecko_model.py

autopacmen.modeling_create_smoment_model
-

modeling_create_smoment_model.py

+

modeling_create_smoment_model.py

autopacmen.modeling_get_initial_spreadsheets
-

modeling_create_initial_spreadsheets.py …

+

modeling_create_initial_spreadsheets.py …

autopacmen.modeling_get_protein_mass_mapping
-

modeling_get_protein_mass_mapping.py …

+

modeling_get_protein_mass_mapping.py …

autopacmen.modeling_get_reactions_kcat_mapping
-

modeling_get_reactions_kcat_mapping.py …

+

modeling_get_reactions_kcat_mapping.py …

autopacmen.optimization_apply_manual_changes
-

modeling_get_protein_mass_mapping.py …

+

modeling_get_protein_mass_mapping.py …

autopacmen.submodules
-
+
@@ -117,7 +117,7 @@

Index

diff --git a/autopacmen/html/autopacmen/modeling_create_gecko_model.html b/autopacmen/html/autopacmen/modeling_create_gecko_model.html index 3baa0b2..4db26a6 100644 --- a/autopacmen/html/autopacmen/modeling_create_gecko_model.html +++ b/autopacmen/html/autopacmen/modeling_create_gecko_model.html @@ -3,14 +3,14 @@ - + autopacmen.modeling_create_gecko_model API documentation - - + + @@ -138,7 +138,7 @@

Index

diff --git a/autopacmen/html/autopacmen/modeling_create_smoment_model.html b/autopacmen/html/autopacmen/modeling_create_smoment_model.html index 68345b5..5455f45 100644 --- a/autopacmen/html/autopacmen/modeling_create_smoment_model.html +++ b/autopacmen/html/autopacmen/modeling_create_smoment_model.html @@ -3,14 +3,14 @@ - + autopacmen.modeling_create_smoment_model API documentation - - + + @@ -145,7 +145,7 @@

Index

diff --git a/autopacmen/html/autopacmen/modeling_get_initial_spreadsheets.html b/autopacmen/html/autopacmen/modeling_get_initial_spreadsheets.html index 305e85a..8bfe54b 100644 --- a/autopacmen/html/autopacmen/modeling_get_initial_spreadsheets.html +++ b/autopacmen/html/autopacmen/modeling_get_initial_spreadsheets.html @@ -3,14 +3,14 @@ - + autopacmen.modeling_get_initial_spreadsheets API documentation - - + + @@ -119,7 +119,7 @@

Index

diff --git a/autopacmen/html/autopacmen/modeling_get_protein_mass_mapping.html b/autopacmen/html/autopacmen/modeling_get_protein_mass_mapping.html index b742297..f126d87 100644 --- a/autopacmen/html/autopacmen/modeling_get_protein_mass_mapping.html +++ b/autopacmen/html/autopacmen/modeling_get_protein_mass_mapping.html @@ -3,14 +3,14 @@ - + autopacmen.modeling_get_protein_mass_mapping API documentation - - + + @@ -122,7 +122,7 @@

Index

diff --git a/autopacmen/html/autopacmen/modeling_get_reactions_kcat_mapping.html b/autopacmen/html/autopacmen/modeling_get_reactions_kcat_mapping.html index 3eadeab..2af0c5b 100644 --- a/autopacmen/html/autopacmen/modeling_get_reactions_kcat_mapping.html +++ b/autopacmen/html/autopacmen/modeling_get_reactions_kcat_mapping.html @@ -3,14 +3,14 @@ - + autopacmen.modeling_get_reactions_kcat_mapping API documentation - - + + @@ -168,7 +168,7 @@

Index

diff --git a/autopacmen/html/autopacmen/optimization_apply_manual_changes.html b/autopacmen/html/autopacmen/optimization_apply_manual_changes.html index 2589f3a..196760b 100644 --- a/autopacmen/html/autopacmen/optimization_apply_manual_changes.html +++ b/autopacmen/html/autopacmen/optimization_apply_manual_changes.html @@ -3,14 +3,14 @@ - + autopacmen.optimization_apply_manual_changes API documentation - - + + @@ -137,7 +137,7 @@

Index

diff --git a/autopacmen/html/autopacmen/submodules/apply_manual_changes.html b/autopacmen/html/autopacmen/submodules/apply_manual_changes.html index 3ebcd8c..d46937a 100644 --- a/autopacmen/html/autopacmen/submodules/apply_manual_changes.html +++ b/autopacmen/html/autopacmen/submodules/apply_manual_changes.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.apply_manual_changes API documentation - - + + @@ -124,26 +124,26 @@

Module autopacmen.submodules.apply_manual_changes

Functions

-def apply_manual_changes(model, kcat_change_factors) +def apply_manual_changes(model: cobra.core.model.Model, kcat_change_factors: Dict[str, Tuple[str, Union[float, int]]]) -> cobra.core.model.Model
-

Applies the given kcat value changes.

+

Applies the given kcat value changes.

Arguments

  • model: cobra.Model ~ The model on which the manual changes shall be applied.
  • kcat_change_factors: Dict[str, Tuple[str, Union[float, int]]] ~ See the following example :-)
-

Example of kcat_change_factors

+

Example Of Kcat_Change_Factors

If the kcat of REAC1_TG_forward shall be lowered by the factor 10, and REAC2's kcat -shall be 10 times higher (REAC2 is not splitted into a forward or reverse reaction): +shall be 10 times higher (REAC2 is not splitted into a forward or reverse reaction):

 kcat_change_factors = {
     "REAC1": ("forward", 1/10),
     "REAC2": ("", 10)
 }
-

+

Output

-

The given cobra.Model with the given manual changes.

+

The given cobra.Model with the given manual changes.

Expand source code @@ -235,7 +235,7 @@

Index

diff --git a/autopacmen/html/autopacmen/submodules/create_combined_kcat_database.html b/autopacmen/html/autopacmen/submodules/create_combined_kcat_database.html index 0c06a09..24c4acb 100644 --- a/autopacmen/html/autopacmen/submodules/create_combined_kcat_database.html +++ b/autopacmen/html/autopacmen/submodules/create_combined_kcat_database.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.create_combined_kcat_database API documentation - - + + @@ -164,10 +164,10 @@

Module autopacmen.submodules.create_combined_kcat_databa

Functions

-def create_combined_kcat_database(sabio_rk_kcat_database_path, brenda_kcat_database_path, output_path) +def create_combined_kcat_database(sabio_rk_kcat_database_path: str, brenda_kcat_database_path: str, output_path: str) -> NoneType
-

Creates a combined JSON of the given SABIO-K and BRENDA kcat databases with non-wildcard entries only.

+

Creates a combined JSON of the given SABIO-K and BRENDA kcat databases with non-wildcard entries only.

Arguments

  • sabio_rk_kcat_database_path: str ~ The path to the SABIO-RK kcat database JSON
  • @@ -175,7 +175,7 @@

    Arguments

  • output_path: str ~ The outputh path (with filename) of the genreated combined kcat database JSON

Output: -A JSON with the following format: +A JSON with the following format:

 {
     '$EC_NUMBER': {
@@ -183,15 +183,15 @@ 

Arguments

'$ORGANISM': { kcat: float }, - (…) + (...) }, - (…), + (...), 'SOURCE': 'SABIO_RK' or 'BRENDA' or 'BRENDA and SABIO-RK', 'WILDCARD': false }, - (…) + (...) } -

+
Expand source code @@ -321,7 +321,7 @@

Index

diff --git a/autopacmen/html/autopacmen/submodules/create_gecko_model_reaction_wise.html b/autopacmen/html/autopacmen/submodules/create_gecko_model_reaction_wise.html index e10de8d..63ac586 100644 --- a/autopacmen/html/autopacmen/submodules/create_gecko_model_reaction_wise.html +++ b/autopacmen/html/autopacmen/submodules/create_gecko_model_reaction_wise.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.create_gecko_model_reaction_wise API documentation - - + + @@ -318,10 +318,10 @@

Module autopacmen.submodules.create_gecko_model_reaction

Functions

-def create_gecko_model_reaction_wise(model, output_sbml_name, project_folder, project_name, excluded_reactions) +def create_gecko_model_reaction_wise(model: cobra.core.model.Model, output_sbml_name: str, project_folder: str, project_name: str, excluded_reactions: List[str]) -> cobra.core.model.Model
-

Creates a GECKO model as described in

+

Creates a GECKO model as described in

Sánchez, B. J., Zhang, C., Nilsson, A., Lahtvee, P. J., Kerkhoven, E. J., & Nielsen, J. (2017). Improving the phenotype predictions of a yeast genome‐scale metabolic model by incorporating enzymatic @@ -339,7 +339,7 @@

Arguments

  • excluded_reactions: List[str] ~ A string list of reaction IDs (the 'reverse' and 'forward' name additions must not be added, i.e. for 'ACALD_forward' just 'ACALD' has to be given) to which no kcat shall be added. Typically used for gas exchange reactions such as 'CO2tex'.
  • -
    +
    Expand source code @@ -586,10 +586,10 @@

    Arguments

    -def create_gecko_model_reaction_wise_with_sbml(input_sbml_path, output_sbml_name, project_folder, project_name, excluded_reactions) +def create_gecko_model_reaction_wise_with_sbml(input_sbml_path: str, output_sbml_name: str, project_folder: str, project_name: str, excluded_reactions: List[str]) -> cobra.core.model.Model
    -

    See create_gecko_model_reaction_wise()

    +

    See create_gecko_model_reaction_wise()

    Expand source code @@ -632,7 +632,7 @@

    Index

    diff --git a/autopacmen/html/autopacmen/submodules/create_smoment_model_reaction_wise.html b/autopacmen/html/autopacmen/submodules/create_smoment_model_reaction_wise.html index 96ef483..d01a97f 100644 --- a/autopacmen/html/autopacmen/submodules/create_smoment_model_reaction_wise.html +++ b/autopacmen/html/autopacmen/submodules/create_smoment_model_reaction_wise.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.create_smoment_model_reaction_wise API documentation - - + + @@ -377,10 +377,10 @@

    Module autopacmen.submodules.create_smoment_model_reacti

    Functions

    -def create_smoment_model_reaction_wise(model, output_sbml_name, project_folder, project_name, excluded_reactions, type_of_default_kcat_selection='median') +def create_smoment_model_reaction_wise(model: cobra.core.model.Model, output_sbml_name: str, project_folder: str, project_name: str, excluded_reactions: List[str], type_of_default_kcat_selection: str = 'median') -> NoneType
    -

    Adds proteomic constraints according to sMOMENT to the given stoichiometric model and stores it as SBML.

    +

    Adds proteomic constraints according to sMOMENT to the given stoichiometric model and stores it as SBML.

    Arguments

    • model: cobra.Model ~ A cobra Model representation of the metabolic network. This model will @@ -398,7 +398,7 @@

      Arguments

    Output

    An SBML in the given folder with the given name, which describes the given stoichiometric model -enhanced by the protein constraint introduction with this function.

    +enhanced by the protein constraint introduction with this function.

    Expand source code @@ -695,10 +695,10 @@

    Output

    -def create_smoment_model_reaction_wise_with_sbml(input_sbml_path, output_sbml_name, project_folder, project_name, excluded_reactions, type_of_default_kcat_selection='median') +def create_smoment_model_reaction_wise_with_sbml(input_sbml_path: str, output_sbml_name: str, project_folder: str, project_name: str, excluded_reactions: List[str], type_of_default_kcat_selection: str = 'median') -> NoneType
    -

    See this module's create_smoment_model_reaction_wise()

    +

    See this module's create_smoment_model_reaction_wise()

    Expand source code @@ -743,7 +743,7 @@

    Index

    diff --git a/autopacmen/html/autopacmen/submodules/fva_comparison.html b/autopacmen/html/autopacmen/submodules/fva_comparison.html index c52f1e0..c59f821 100644 --- a/autopacmen/html/autopacmen/submodules/fva_comparison.html +++ b/autopacmen/html/autopacmen/submodules/fva_comparison.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.fva_comparison API documentation - - + + @@ -106,10 +106,10 @@

    Module autopacmen.submodules.fva_comparison

    Functions

    -def fva_comparison(model_original, model_smoment, objective='') +def fva_comparison(model_original: cobra.core.model.Model, model_smoment: cobra.core.model.Model, objective: str = '') -> NoneType
    -

    Compares the original model with the AutoPACMEN model using FVA for 100% of the objective value.

    +

    Compares the original model with the AutoPACMEN model using FVA for 100% of the objective value.

    The results are printed in the console, and are using cobrapy's FVA summary function.

    Arguments

      @@ -118,7 +118,7 @@

      Arguments

    • objective: str = "" ~ An alternative objective for both models. Keep in mind that due to the separation of reversible reactions in the sMOMENTed model, there may be differential reaction names for the raction that you want to be the objective.
    • -
    +
    Expand source code @@ -154,10 +154,10 @@

    Arguments

    -def fva_comparison_with_sbml(sbml_original_path, sbml_smomented_path, objective) +def fva_comparison_with_sbml(sbml_original_path: str, sbml_smomented_path: str, objective: str) -> NoneType
    -

    Loads the two given SBMLs using cobrapy, and uses fva_comparison.

    +

    Loads the two given SBMLs using cobrapy, and uses fva_comparison.

    Arguments

    • sbml_original_path: str ~ The path to the non-sMOMENTed SBML model.
    • @@ -165,7 +165,7 @@

      Arguments

    • objective: str = "" ~ An alternative objective for both models. Keep in mind that due to the separation of reversible reactions in the sMOMENTed model, there may be differential reaction names for the raction that you want to be the objective.
    • -
    +
    Expand source code @@ -213,7 +213,7 @@

    Index

    diff --git a/autopacmen/html/autopacmen/submodules/fva_prot_pool.html b/autopacmen/html/autopacmen/submodules/fva_prot_pool.html index dda0ffc..96afe49 100644 --- a/autopacmen/html/autopacmen/submodules/fva_prot_pool.html +++ b/autopacmen/html/autopacmen/submodules/fva_prot_pool.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.fva_prot_pool API documentation - - + + @@ -98,10 +98,10 @@

    Module autopacmen.submodules.fva_prot_pool

    Functions

    -def fva_prot_pool(model, pp_upper_bounds, objective='') +def fva_prot_pool(model: cobra.core.model.Model, pp_upper_bounds: List[float], objective: str = '') -> NoneType
    -

    Performs an FVA for the given protein-constraint-enhanced model with the given protein pools.

    +

    Performs an FVA for the given protein-constraint-enhanced model with the given protein pools.

    Output

    Standard cobrapy FVA result summaries for each given protein pool.

    Arguments

    @@ -110,7 +110,7 @@

    Arguments

  • pp_upper_bounds: List[float] ~ The list of upper protein pool bounds.
  • objective: str = "" ~ If set, the objecive will be changed to the given term. Otherwise, the standard objective is used.
  • -
    +
    Expand source code @@ -145,10 +145,10 @@

    Arguments

    -def fva_prot_pool_with_sbml(sbml_path, pp_upper_bounds, objective) +def fva_prot_pool_with_sbml(sbml_path: str, pp_upper_bounds: List[float], objective: str) -> NoneType
    -

    SBML-loading version of fva_prot_pool(), see its comments for more.

    +

    SBML-loading version of fva_prot_pool(), see its comments for more.

    Expand source code @@ -185,7 +185,7 @@

    Index

    diff --git a/autopacmen/html/autopacmen/submodules/get_differential_reactions.html b/autopacmen/html/autopacmen/submodules/get_differential_reactions.html index cc5eb80..f354ff1 100644 --- a/autopacmen/html/autopacmen/submodules/get_differential_reactions.html +++ b/autopacmen/html/autopacmen/submodules/get_differential_reactions.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.get_differential_reactions API documentation - - + + @@ -208,17 +208,17 @@

    Module autopacmen.submodules.get_differential_reactions<

    Functions

    -def get_all_differential_reactions(scenario_names, flux_control_files_path, project_name, threshold=0.001) +def get_all_differential_reactions(scenario_names: List[str], flux_control_files_path: str, project_name: str, threshold: float = 0.001)
    -

    Returns the set of all differential reactions (with the given threshold) of all given scenarios.

    +

    Returns the set of all differential reactions (with the given threshold) of all given scenarios.

    Arguments

    • scenario_names: str ~ The names of the scenarios for which the differential reactions shall be collected.
    • flux_control_files_path: str ~ The path to the flux control files.
    • project_name: str ~ The name of the project, which is at the beginning of the file name of the flux files.
    • threshold: float = (.1)/100 ~ The threshold for a change in the solution of a reaction.
    • -
    +
    Expand source code @@ -243,10 +243,10 @@

    Arguments

    -def get_differential_reactions(scenario_names, flux_control_files_path, project_name, scenarios, threshold=0.001, print_result=True) +def get_differential_reactions(scenario_names: List[str], flux_control_files_path: str, project_name: str, scenarios, threshold: float = 0.001, print_result: bool = True)
    -

    Returns the differential reactions in the given flux files.

    +

    Returns the differential reactions in the given flux files.

    Definition of 'differential reaction'

    In a protein-constraint-enhanced metabolic network, the deletion of the protein constraint in a reaction can have an influence on the objective solution value, or not. A 'differential reaction' is a reaction in @@ -268,7 +268,7 @@

    Output

    * unique_differential_proteins_of_scenario: Dict[str, List[str]] ~ A list of all differential reactions which occur in only one given scenario. * differential_reactions_of_all_scenarios: List[str] ~ A list of all differential reactions which -occur in all given scenarios.

    +occur in all given scenarios.

    Expand source code @@ -398,7 +398,7 @@

    Index

    diff --git a/autopacmen/html/autopacmen/submodules/get_initial_spreadsheets.html b/autopacmen/html/autopacmen/submodules/get_initial_spreadsheets.html index faf21fb..ad3018a 100644 --- a/autopacmen/html/autopacmen/submodules/get_initial_spreadsheets.html +++ b/autopacmen/html/autopacmen/submodules/get_initial_spreadsheets.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.get_initial_spreadsheets API documentation - - + + @@ -351,10 +351,10 @@

    Module autopacmen.submodules.get_initial_spreadsheetsFunctions

    -def get_initial_spreadsheets(model, project_folder, project_name) +def get_initial_spreadsheets(model: cobra.core.model.Model, project_folder: str, project_name: str) -> NoneType
    -

    Creates a number of initially needed XLSX spreadsheets in the given folder.

    +

    Creates a number of initially needed XLSX spreadsheets in the given folder.

    Output

    The following spreadsheets are going to be created (all file names start with project_name+"_"): * reactions.xlsx ~ A list of all KEGG IDs for each reaction of the model, the user can then select @@ -379,7 +379,7 @@

    Arguments

  • model: cobra.Model ~ The cobrapy model for which the initial spreadsheets will be created.
  • project_folder: str ~ In this folder, all XLSX files will be stored.
  • project_name: str ~ This project name is added before each XLSX file name.
  • -
    +
    Expand source code @@ -621,16 +621,16 @@

    Arguments

    -def get_initial_spreadsheets_with_sbml(sbml_path, project_folder, project_name) +def get_initial_spreadsheets_with_sbml(sbml_path: str, project_folder: str, project_name: str) -> NoneType
    -

    Allows to call get_initial_spreadsheets with an SBML.

    +

    Allows to call get_initial_spreadsheets with an SBML.

    Arguments

    • sbml_path: str ~ The SBML of the analyzed model.
    • project_folder: str ~ In this folder, all XLSX files will be stored.
    • project_name: str ~ This project name is added before each XLSX file name.
    • -
    +
    Expand source code @@ -675,7 +675,7 @@

    Index

    diff --git a/autopacmen/html/autopacmen/submodules/get_protein_mass_mapping.html b/autopacmen/html/autopacmen/submodules/get_protein_mass_mapping.html index 55bd101..0f52853 100644 --- a/autopacmen/html/autopacmen/submodules/get_protein_mass_mapping.html +++ b/autopacmen/html/autopacmen/submodules/get_protein_mass_mapping.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.get_protein_mass_mapping API documentation - - + + @@ -51,7 +51,6 @@

    Module autopacmen.submodules.get_protein_mass_mappingModule autopacmen.submodules.get_protein_mass_mappingModule autopacmen.submodules.get_protein_mass_mappingModule autopacmen.submodules.get_protein_mass_mappingModule autopacmen.submodules.get_protein_mass_mappingFunctions

    -def get_protein_mass_mapping(model, project_folder, project_name) +def get_protein_mass_mapping(model: cobra.core.model.Model, project_folder: str, project_name: str) -> NoneType
    -

    Returns a JSON with a mapping of protein IDs as keys, and as values the protein mass in kDa.

    -

    The protein masses are calculated using the amino acid sequence from UniProt (retrieved using +

    Returns a JSON with a mapping of protein IDs as keys, and as values the protein mass in kDa.

    +

    The protein masses are taken +from UniProt (retrieved using UniProt's REST API).

    Arguments

      @@ -222,13 +224,13 @@

      Arguments

    Output

    A JSON file with the path project_folder+project_name+'_protein_id_mass_mapping.json' -and the following structure: +and the following structure:

     {
         "$PROTEIN_ID": $PROTEIN_MASS_IN_KDA,
    -    (…),
    +    (...),
     }
    -

    +
    Expand source code @@ -236,7 +238,7 @@

    Output

    def get_protein_mass_mapping(model: cobra.Model, project_folder: str, project_name: str) -> None:
         """Returns a JSON with a mapping of protein IDs as keys, and as values the protein mass in kDa.
     
    -    The protein masses are calculated using the amino acid sequence from UniProt (retrieved using
    +    The protein masses are taken  from UniProt (retrieved using
         UniProt's REST API).
     
         Arguments
    @@ -317,7 +319,7 @@ 

    Output

    # With 'OR', all given IDs are searched, and subsequently in this script, # the right associated masses are being picked. query = " OR ".join(batch) - uniprot_query_url = f"https://www.uniprot.org/uniprot/?query={query}&format=tab&columns=id,sequence" + uniprot_query_url = f"https://www.uniprot.org/uniprot/?query={query}&format=tab&columns=id,mass" print(f"UniProt batch search for: {query}") # Call UniProt's API :-) @@ -330,18 +332,20 @@

    Output

    if line == "": continue uniprot_id = line.split("\t")[0] - sequence = line.split("\t")[1] - # Get the protein mass using biopython's associated function for amino acid sequences + mass_string = line.split("\t")[1] try: - mass = ProteinAnalysis(sequence, monoisotopic=False).molecular_weight() - except ValueError: # e.g. if an "X" is in a sequence + # Note that the mass entry from UniProt uses a comma as a thousand separator, so it has to be removed before parsing + mass = float(mass_string.replace(",","")) + except ValueError: # We may also risk the entry is missing + # print(f"No protein mass obtainable for protein ID {uniprot_id}") continue uniprot_id_protein_mass_mapping[uniprot_id] = float(mass) # Create the pickled cache files for the searched protein masses for uniprot_id in batch: - cache_filepath = cache_basepath + uniprot_id - pickle_write(cache_filepath, uniprot_id_protein_mass_mapping[uniprot_id]) + if uniprot_id in uniprot_id_protein_mass_mapping: # Takes into account that we may fail to obtain a UniProt ID + cache_filepath = cache_basepath + uniprot_id + pickle_write(cache_filepath, uniprot_id_protein_mass_mapping[uniprot_id]) # Continue with the next batch :D batch_start += batch_size @@ -363,16 +367,16 @@

    Output

    -def get_protein_mass_mapping_with_sbml(sbml_path, project_folder, project_name) +def get_protein_mass_mapping_with_sbml(sbml_path: str, project_folder: str, project_name: str) -> NoneType
    -

    This module's get_protein_mass_mapping() with SBML instead of a cobrapy module as argument.

    +

    This module's get_protein_mass_mapping() with SBML instead of a cobrapy module as argument.

    Arguments

    • sbml_path: str ~ The path to the model's SBML
    • project_folder: str ~ The folder in which the JSON shall be created
    • project_name: str ~ The beginning of the JSON's file name
    • -
    +
    Expand source code @@ -416,7 +420,7 @@

    Index

    diff --git a/autopacmen/html/autopacmen/submodules/get_reactions_kcat_mapping.html b/autopacmen/html/autopacmen/submodules/get_reactions_kcat_mapping.html index 43259e9..c584072 100644 --- a/autopacmen/html/autopacmen/submodules/get_reactions_kcat_mapping.html +++ b/autopacmen/html/autopacmen/submodules/get_reactions_kcat_mapping.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.get_reactions_kcat_mapping API documentation - - + + @@ -527,42 +527,42 @@

    Module autopacmen.submodules.get_reactions_kcat_mapping<

    Functions

    -def get_reactions_kcat_mapping(sbml_path, project_folder, project_name, organism, kcat_database_path, protein_kcat_database_path, type_of_kcat_selection='mean') +def get_reactions_kcat_mapping(sbml_path: str, project_folder: str, project_name: str, organism: str, kcat_database_path: str, protein_kcat_database_path: str, type_of_kcat_selection: str = 'mean') -> NoneType
    -

    Returns a reaction<->kcat mapping for the given model :D

    +

    Returns a reaction<->kcat mapping for the given model :D

    The selection of kcats is depending on the affected metabolites of the reaction direction (one kcat is given for each the forward and reverse direction), and on the organism (the kcats from the taxonomically nearest organism is prefered).

    Arguments

    -
    *sbml_path : str ~ Te SBML path to the model
    +
    *sbml_path : str ~ Te SBML path to the model
     
    -
    *project_folder : str ~ The folder in which the model data files are sored
    +
    *project_folder : str ~ The folder in which the model data files are sored
     
    -
    *project_name : str ~ The name of the used project
    +
    *project_name : str ~ The name of the used project
     
    -
    *organism : str ~ The organism's name
    +
    *organism : str ~ The organism's name
     
    -
    *kcat_database_path : str ~ A path to an already created EC number<->kcats database
    +
    *kcat_database_path : str ~ A path to an already created EC number<->kcats database
     
    -
    *protein_kcat_database_path : str ~ A path to the custom protein<->kcat database
    +
    *protein_kcat_database_path : str ~ A path to the custom protein<->kcat database
     

    *type_of_kcat_selection: str ~ Can be "mean", "median" or "random". Refers to the selection of found kcats of a reaction. Is "mean" by default.

    Output

    A JSON in the given project folder with the name $project_name+'_reactions_kcat_mapping_combined.json' and -the following structure: +the following structure:

     {
         "$REACTION_NAME": {
             "forward": $forward_kcat,
             "reverse": $reverse_kcat
         },
    -    (…)
    +    (...)
     }
    -

    +
    Expand source code @@ -774,7 +774,7 @@

    Index

    diff --git a/autopacmen/html/autopacmen/submodules/helper_create_model.html b/autopacmen/html/autopacmen/submodules/helper_create_model.html index e51ec1d..86e1fb4 100644 --- a/autopacmen/html/autopacmen/submodules/helper_create_model.html +++ b/autopacmen/html/autopacmen/submodules/helper_create_model.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.helper_create_model API documentation - - + + @@ -536,10 +536,10 @@

    Module autopacmen.submodules.helper_create_model<

    Functions

    -def add_prot_pool_reaction(model, id_addition, p_total, p_measured, unmeasured_protein_fraction, mean_saturation) +def add_prot_pool_reaction(model: cobra.core.model.Model, id_addition: str, p_total: float, p_measured: float, unmeasured_protein_fraction: float, mean_saturation: float) -> cobra.core.model.Model
    -

    Adds a protein pool reaction with the given parameters, in accordance with the GECKO paper.

    +

    Adds a protein pool reaction with the given parameters, in accordance with the GECKO paper.

    The protein pool reaction gets the id 'ER_pool'+id_addition

    Arguments

      @@ -552,7 +552,7 @@

      Arguments

    • mean_saturation: float ~ A fitted value of all unmeasured protein's mean saturation.

    Output

    -

    The given cobra model with a protein pool reaction :D

    +

    The given cobra model with a protein pool reaction :D

    Expand source code @@ -596,15 +596,15 @@

    Output

    -def apply_scenario_on_model(model, scenario) +def apply_scenario_on_model(model: cobra.core.model.Model, scenario: Dict[str, Any]) -> cobra.core.model.Model
    -

    Returns a model on which the given scenario is applied.

    +

    Returns a model on which the given scenario is applied.

    Arguments

    • model: cobra.Model ~ The model on which the scenario shall be applied.
    • scenario: Dict[str, Any] ~ The scenario's dictionary representation.
    • -
    +
    Expand source code @@ -638,10 +638,10 @@

    Arguments

    -def get_irreversible_model(model, id_addition) +def get_irreversible_model(model: cobra.core.model.Model, id_addition: str) -> cobra.core.model.Model
    -

    Returns an irreversible model for further AutoPACMEN processing.

    +

    Returns an irreversible model for further AutoPACMEN processing.

    Only reactions with gene rules, i.e. with proteins, are made irreversible. The splitted reactios are then called reaction.id+id_addition+"forward" or "reverse", respectively.

    @@ -651,7 +651,7 @@

    Arguments

    • model: cobra.Model ~ The model that shall be made irreversible as described
    • id_addition: str ~ The string that is added before 'reversed' or 'forward'
    • -
    +
    Expand source code @@ -719,10 +719,10 @@

    Arguments

    -def get_model_with_separated_measured_enzyme_reactions(model, protein_id_concentration_mapping, reaction_id_gene_rules_mapping, reaction_id_gene_rules_protein_stoichiometry_mapping, excluded_reactions, protein_id_mass_mapping) +def get_model_with_separated_measured_enzyme_reactions(model: cobra.core.model.Model, protein_id_concentration_mapping: Dict[str, float], reaction_id_gene_rules_mapping: Dict[str, Any], reaction_id_gene_rules_protein_stoichiometry_mapping: Dict[str, Any], excluded_reactions: List[str], protein_id_mass_mapping: Dict[str, float])
    -

    Splits the reactions with measured enzymes in their gene rules according to the OR blocks in the gene rule.

    +

    Splits the reactions with measured enzymes in their gene rules according to the OR blocks in the gene rule.

    Arguments

    • model: cobra.Model ~ The model for which the reactions shall be splitted.
    • @@ -732,7 +732,7 @@

      Arguments

    • reaction_id_gene_rules_protein_stoichiometry_mapping: Dict[str, Any] ~ A dictionary describing the internal protein stoichiometries in complexes (created with _read_stoichiometries_worksheet())
    • excluded_reactions: List[str] ~ A list of reactions for which no enzyme constraints shall be added.
    • -
    +
    Expand source code @@ -931,16 +931,16 @@

    Arguments

    -def get_p_measured(protein_id_concentration_mapping, protein_id_mass_mapping) +def get_p_measured(protein_id_concentration_mapping: Dict[str, float], protein_id_mass_mapping: Dict[str, float]) -> float
    -

    Return p_measured (as defined in the GECKO paper) using the given arguments.

    +

    Return p_measured (as defined in the GECKO paper) using the given arguments.

    Arguments

    • protein_id_concentration_mapping: Dict[str, float] ~ The given concentrations of the proteins.
    • protein_id_mass_mapping: Dict[str, float] ~ The masses of the given proteins.
    • -
    +
    Expand source code @@ -970,14 +970,14 @@

    Arguments

    -def read_enzyme_stoichiometries_xlsx(basepath) +def read_enzyme_stoichiometries_xlsx(basepath: str)
    -

    Reads the internal protein stoichiometries for each enzyme XLSX.

    +

    Reads the internal protein stoichiometries for each enzyme XLSX.

    Arguments

    • basepath: str ~ The path in which the XLSX can be found.
    • -
    +
    Expand source code @@ -998,10 +998,10 @@

    Arguments

    -def read_protein_data_xlsx(basepath) +def read_protein_data_xlsx(basepath: str)
    -

    Reads the protein data XLSX '$PROJECT_NAME_protein_data.xlsx'

    +

    Reads the protein data XLSX '$PROJECT_NAME_protein_data.xlsx'

    Argument

    • basepath: str ~ The folder in which the XLSX exists.
    • @@ -1014,7 +1014,7 @@

      Output

      3. unmeasured_protein_fraction: float ~ The mass fraction of the proteins without a measured concentration. 4. mean_saturation: float ~ A given - and usually fitted - value of mean saturation for all -enzymes.

    +enzymes.

    Expand source code @@ -1096,7 +1096,7 @@

    Index

    diff --git a/autopacmen/html/autopacmen/submodules/helper_general.html b/autopacmen/html/autopacmen/submodules/helper_general.html index 13cf305..fb6602c 100644 --- a/autopacmen/html/autopacmen/submodules/helper_general.html +++ b/autopacmen/html/autopacmen/submodules/helper_general.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.helper_general API documentation - - + + @@ -434,10 +434,10 @@

    Module autopacmen.submodules.helper_general

    Functions

    -def check_argument(argument, command) +def check_argument(argument: str, command: str) -> str
    -

    Checks wheter the given mandatory argument variable is None or not. If none, the program stops.

    +

    Checks wheter the given mandatory argument variable is None or not. If none, the program stops.

    It is checked wheter the argument is None as argparser sets an argument variable to None if the argument is not set.

    Arguments

    @@ -445,7 +445,7 @@

    Arguments

  • argument: str ~ The argument that shall be checked and which shall not be None.
  • command: str ~ The argument long name (i.e. the name after –) which is displayed in an error message if the argument is None.
  • -
    +
    Expand source code @@ -472,14 +472,14 @@

    Arguments

    -def ensure_folder_existence(folder) +def ensure_folder_existence(folder: str) -> NoneType
    -

    Checks if the given folder exists. If not, the folder is created.

    +

    Checks if the given folder exists. If not, the folder is created.

    Argument

    • folder: str ~ The folder whose existence shall be enforced.
    • -
    +
    Expand source code @@ -497,10 +497,10 @@

    Argument

    -def get(url, num_tries=3, sleep_time=10.0) +def get(url: str, num_tries: int = 3, sleep_time: float = 10.0) -> List[str]
    -

    Returns an internet site's content in the form of a list with one string per line.

    +

    Returns an internet site's content in the form of a list with one string per line.

    Arguments

    • url:str ~ The URL of the internet site.
    • @@ -511,7 +511,7 @@

      Arguments

      Its default value of 10.0 seconds is in accordance with the NCBI rule that its servers shall not be contacted more often than every 10 seconds. -
    +
    Expand source code @@ -576,16 +576,16 @@

    Arguments

    -def get_and_save(url, filepath) +def get_and_save(url: str, filepath: str) -> List[str]
    -

    Retrieves the text content from the given URL and saves it in the given text file path.

    +

    Retrieves the text content from the given URL and saves it in the given text file path.

    It also returns the content of the URL as a list of strings (one list element per newline-separated line).

    Arguments

    • url: str ~ The URL of which the text content is read out
    • filepath: str ~ The path pof the text file which will include the URL text content
    • -
    +
    Expand source code @@ -609,17 +609,17 @@

    Arguments

    -def get_entry_id_kegg_id_mapping(xlsx_path, worksheet_name) +def get_entry_id_kegg_id_mapping(xlsx_path: str, worksheet_name: str) -> Dict[str, str]
    -

    Reads a worksheet in which the user can select the KEGG IDs of e.g. metabolites or reactions.

    +

    Reads a worksheet in which the user can select the KEGG IDs of e.g. metabolites or reactions.

    This is used for the KEGG ID XLSX for reactions and metabolites in AutoPACMEN. THe functions returns a dictionary of IDs as keys and selected KEGG IDs as values.

    Arguments

    • xlsx_path: str ~ The path to the analyzed XLSX
    • worksheet_name: str ~ THe name of the analyzed worksheet of the analyzed XLSX
    • -
    +
    Expand source code @@ -667,14 +667,14 @@

    Arguments

    -def get_files(path) +def get_files(path: str) -> List[str]
    -

    Returns the names of the files in the given folder as a list of strings.

    +

    Returns the names of the files in the given folder as a list of strings.

    Arguments

    • path: str ~ The path to the folder of which the file names shall be returned
    • -
    +
    Expand source code @@ -693,16 +693,16 @@

    Arguments

    -def get_float_cell_value(cell_value) +def get_float_cell_value(cell_value) -> float
    -

    Returns the value of an openpyxl cell value.

    +

    Returns the value of an openpyxl cell value.

    This function is used in oder to operate with spreadsheets which use the comma as the decimal mark instead of a period.

    Arguments

    • cell_value ~ The openpyxl cell value
    • -
    +
    Expand source code @@ -724,16 +724,16 @@

    Arguments

    -def is_fitting_ec_numbers(ec_number_one, ec_number_two, wildcard_level) +def is_fitting_ec_numbers(ec_number_one: str, ec_number_two: str, wildcard_level: int) -> bool
    -

    Check whether the EC numbers are the same under the used wildcard level.

    +

    Check whether the EC numbers are the same under the used wildcard level.

    Arguments

    • ec_number_one: str ~ The first given EC number.
    • ec_number_two: str ~ The second given EC number.
    • wildcard_level: int ~ The wildcard level.
    • -
    +
    Expand source code @@ -761,14 +761,14 @@

    Arguments

    -def json_load(path) +def json_load(path: str) -> Dict[Any, Any]
    -

    Loads the given JSON file and returns it as dictionary.

    +

    Loads the given JSON file and returns it as dictionary.

    Arguments

    • path: str ~ The path of the JSON file
    • -
    +
    Expand source code @@ -786,17 +786,17 @@

    Arguments

    -def json_write(path, dictionary) +def json_write(path: str, dictionary: Dict[Any, Any]) -> NoneType
    -

    Writes a JSON file at the given path with the given dictionary as content.

    +

    Writes a JSON file at the given path with the given dictionary as content.

    Arguments

    • path: str ~ The path of the JSON file that shall be written
    • dictionary: Dict[Any, Any] ~ The dictionary which shalll be the content of the created JSON file
    • -
    +
    Expand source code @@ -816,15 +816,15 @@

    Arguments

    -def mkdir(path) +def mkdir(path: str) -> NoneType
    -

    Creates a directory if the given directory does not exist yet.

    +

    Creates a directory if the given directory does not exist yet.

    Uses os.mkdir and os.path.exists internally.

    Argument

    • path: str ~ The directory's path.
    • -
    +
    Expand source code @@ -843,14 +843,14 @@

    Argument

    -def pickle_load(path) +def pickle_load(path: str) -> Any
    -

    Returns the value of the given pickle file.

    +

    Returns the value of the given pickle file.

    Arguments

    • path: str ~ The path to the pickle file.
    • -
    +
    Expand source code @@ -869,15 +869,15 @@

    Arguments

    -def pickle_write(path, pickled_object) +def pickle_write(path: str, pickled_object: Any) -> NoneType
    -

    Writes the given object as pickled file with the given path

    +

    Writes the given object as pickled file with the given path

    Arguments

    • path: str ~ The path of the pickled file that shall be created
    • pickled_object: Any ~ The object which shall be saved in the pickle file
    • -
    +
    Expand source code @@ -896,10 +896,10 @@

    Arguments

    -def resolve_pathway_ids(pathway_ids, pathways) +def resolve_pathway_ids(pathway_ids: str, pathways: List[Any]) -> List[int]
    -

    Returns a list index integer list of the given pathway_ids for the given pathway list.

    +

    Returns a list index integer list of the given pathway_ids for the given pathway list.

    It gets 'all' and returns all indices of pathways or a comma-separated list of pathway numbers.

    Example

    If an organism has 5 pathways in total, this function would return for 'all' as pathway_ids @@ -909,7 +909,7 @@

    Arguments

  • pathway_ids ~ The IDs of the pathways in a string. Can be 'all' to get all indices, or a comma-separated list of numbers.
  • pathways ~ The list of pathways of which an index integer list shall be created.
  • -
    +
    Expand source code @@ -943,16 +943,16 @@

    Arguments

    -def sanitize_path(text) +def sanitize_path(text: str) -> str
    -

    Replaces all invalid characters for a path with valid ones.

    +

    Replaces all invalid characters for a path with valid ones.

    E.g. useful for creating files with the name of KEGG pathways, as these names may contain invalid characters.

    Argument

    • text: str ~ The string that may contain invalid characters.
    • -
    +
    Expand source code @@ -974,16 +974,16 @@

    Argument

    -def standardize_folder(folder) +def standardize_folder(folder: str) -> str
    -

    Returns for the given folder path is returned in a more standardized way.

    +

    Returns for the given folder path is returned in a more standardized way.

    I.e., folder paths with potential \ are replaced with /. In addition, if a path does not end with / will get an added /.

    Argument

    • folder: str ~ The folder path that shall be standardized.
    • -
    +
    Expand source code @@ -1050,7 +1050,7 @@

    Index

    diff --git a/autopacmen/html/autopacmen/submodules/index.html b/autopacmen/html/autopacmen/submodules/index.html index 524706b..378c63c 100644 --- a/autopacmen/html/autopacmen/submodules/index.html +++ b/autopacmen/html/autopacmen/submodules/index.html @@ -3,14 +3,14 @@ - + autopacmen.submodules API documentation - - + + @@ -26,83 +26,83 @@

    Sub-modules

    autopacmen.submodules.apply_manual_changes
    -

    appy_manual_changes.py …

    +

    appy_manual_changes.py …

    autopacmen.submodules.create_combined_kcat_database
    -

    create_combined_kcat_database.py …

    +

    create_combined_kcat_database.py …

    autopacmen.submodules.create_gecko_model_reaction_wise
    -

    modeling_create_gecko_model.py

    +

    modeling_create_gecko_model.py

    autopacmen.submodules.create_smoment_model_reaction_wise
    -

    create_smoment_model_reaction_wise.py …

    +

    create_smoment_model_reaction_wise.py …

    autopacmen.submodules.fva_comparison
    -

    fba_comparison.py …

    +

    fba_comparison.py …

    autopacmen.submodules.fva_prot_pool
    -

    analysis_fva_prot_pool.py …

    +

    analysis_fva_prot_pool.py …

    autopacmen.submodules.get_differential_reactions
    -

    get_differential_reactions.py …

    +

    get_differential_reactions.py …

    autopacmen.submodules.get_initial_spreadsheets
    -

    get_initial_spreadsheets.py …

    +

    get_initial_spreadsheets.py …

    autopacmen.submodules.get_protein_mass_mapping
    -

    get_protein_mass_mapping.py …

    +

    get_protein_mass_mapping.py …

    autopacmen.submodules.get_reactions_kcat_mapping
    -

    get_reactions_kcat_mapping.py …

    +

    get_reactions_kcat_mapping.py …

    autopacmen.submodules.helper_create_model
    -

    helper_create_model.py …

    +

    helper_create_model.py …

    autopacmen.submodules.helper_general
    -

    helper_general.py …

    +

    helper_general.py …

    autopacmen.submodules.kegg
    -

    kegg.py …

    +

    kegg.py …

    autopacmen.submodules.ncbi_taxonomy
    -

    ncbi_taxonomy.py …

    +

    ncbi_taxonomy.py …

    autopacmen.submodules.parse_bigg_metabolites_file
    -

    parse_bigg_metabolites_file.py …

    +

    parse_bigg_metabolites_file.py …

    autopacmen.submodules.parse_brenda_json_for_model
    -

    parse_brenda_for_model.py …

    +

    parse_brenda_for_model.py …

    autopacmen.submodules.parse_brenda_textfile
    -

    parse_brenda_textfile.py …

    +

    parse_brenda_textfile.py …

    autopacmen.submodules.parse_sabio_rk
    -

    sabio_rk.py …

    +

    sabio_rk.py …

    autopacmen.submodules.parse_sabio_rk_for_model
    -

    parse_sabio_rk_for_model.py …

    +

    parse_sabio_rk_for_model.py …

    autopacmen.submodules.reaction_flux_control_by_scenario
    -

    reaction_flux_control_by_scenario.py …

    +

    reaction_flux_control_by_scenario.py …

    @@ -152,7 +152,7 @@

    Index

    diff --git a/autopacmen/html/autopacmen/submodules/kegg.html b/autopacmen/html/autopacmen/submodules/kegg.html index d13f155..5835f68 100644 --- a/autopacmen/html/autopacmen/submodules/kegg.html +++ b/autopacmen/html/autopacmen/submodules/kegg.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.kegg API documentation - - + + @@ -160,12 +160,12 @@

    Functions

    def get_full_organism_name_from_kegg_id(organism_kegg_id)
    -

    Get the given organism's full name using KEGG info. Returned as str.

    +

    Get the given organism's full name using KEGG info. Returned as str.

    Arguments

    • organism_kegg_id: str ~ The organism's full name, e.g. "Xanthomonas campestris pv. campesris B100"
    • -
    +
    Expand source code @@ -188,10 +188,10 @@

    Arguments

    -def kegg_rest(type, argument, optional_argument='', sleep_time=0.5) +def kegg_rest(type: str, argument: str, optional_argument: str = '', sleep_time: float = 0.5) -> List[str]
    -

    This function calls Biopython's KEGG REST function and returns the lines as a string list.

    +

    This function calls Biopython's KEGG REST function and returns the lines as a string list.

    All empty lines are deleted from the list as they do not contain any information.

    Arguments

      @@ -204,7 +204,7 @@

      Arguments

      rule that its servers shall not be contacted more often than every 10 seconds. KEGG might have lower or higher required sleep times, but I did not find any specified time step. -
    +
    Expand source code @@ -251,17 +251,17 @@

    Arguments

    -def kegg_rest_get_batch(input_ids, batch_size=4) +def kegg_rest_get_batch(input_ids: List[str], batch_size: int = 4) -> List[List[str]]
    -

    Using Biopython's KEGG REST function, this function returns a list of lists of KEGG REST get results.

    +

    Using Biopython's KEGG REST function, this function returns a list of lists of KEGG REST get results.

    See this module's kegg_rest() comments for more.

    Arguments

    • input_ids: List[str] ~ The list of searched KEGG GET IDs.
    • batch_size: int = 4 ~ The size of batches, i.e. the maximal number of looked up IDs (batching is done in order to lower the number of necessary KEGG API calls).
    • -
    +
    Expand source code @@ -328,7 +328,7 @@

    Index

    diff --git a/autopacmen/html/autopacmen/submodules/ncbi_taxonomy.html b/autopacmen/html/autopacmen/submodules/ncbi_taxonomy.html index 80037ed..7b4a68b 100644 --- a/autopacmen/html/autopacmen/submodules/ncbi_taxonomy.html +++ b/autopacmen/html/autopacmen/submodules/ncbi_taxonomy.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.ncbi_taxonomy API documentation - - + + @@ -237,7 +237,7 @@

    Functions

    def get_entrez_id_from_organism_full_name(organism_full_name)
    -

    Get organism's Entrez numeric identifier.

    +

    Get organism's Entrez numeric identifier.

    This numeric identifier is neccessary for BLAST and NCBI TAXONOMY searches. This function uses Biopython functions. Returns BLAST-compatible ID as @@ -246,7 +246,7 @@

    Functions

    organism_kegg_id: str ~ The organism's full name, e.g. "Xanthomonas campestris pv. campesris B100"

    -
    +
    Expand source code @@ -281,10 +281,10 @@

    Functions

    -def get_entrez_id_from_organism_full_name_batch(organism_full_names) +def get_entrez_id_from_organism_full_name_batch(organism_full_names: List[str]) -> List[str]
    -

    Retrieves the Entrez numeric ID of the given organisms.

    +

    Retrieves the Entrez numeric ID of the given organisms.

    This numeric identifier is neccessary for BLAST and NCBI TAXONOMY searches. This function uses Biopython functions. Returns BLAST-compatible ID as @@ -293,7 +293,7 @@

    Functions

    organism_full_names: List[str] ~ A list of full names of organisms, e.g. "Xanthomonas campestris pv. campesris B100"

    -
    +
    Expand source code @@ -341,7 +341,7 @@

    Functions

    def get_taxonomy_from_organism_ncbi_id(organism_ncbi_id)
    -

    Get organism's taxonomy from NCBI Taxonomy using Biopython functions.

    +

    Get organism's taxonomy from NCBI Taxonomy using Biopython functions.

    The taxonomy is returned as list, starting with the nearest and ending with the highest taxonomic level above the organism.

    Arguments:

    @@ -349,7 +349,7 @@

    Functions

    ncbi_organism_id: str ~ The organism's NCBI ID, e.g. retrieved by this module's "get_entrez_id_from_organism_full_name" function, in the format txid + NCBI ID + [ORGN]

    -
    +
    Expand source code @@ -374,10 +374,10 @@

    Functions

    -def get_taxonomy_from_organism_ncbi_id_batch(organism_ncbi_ids) +def get_taxonomy_from_organism_ncbi_id_batch(organism_ncbi_ids: List[str]) -> Dict[str, List[str]]
    -

    Get the taxonomy from NCBI Taxonomy of the given organisms using Biopython functions.

    +

    Get the taxonomy from NCBI Taxonomy of the given organisms using Biopython functions.

    The taxonomy is returned as Dictionary (Dict[str, List[str]) for each organism, where each value is a string list starting with the nearest and ending with the highest taxonomic level above the organism.

    @@ -386,7 +386,7 @@

    Functions

    organism_ncbi_ids: List[str] ~ The list of the NCBI IDs of the organisms, e.g. retrieved by this module's "get_entrez_id_from_organism_full_name" function, in the format txid + NCBI ID + [ORGN]

    -
    +
    Expand source code @@ -420,11 +420,11 @@

    Functions

    -def most_taxonomic_similar(base_species, taxonomy_dict) +def most_taxonomic_similar(base_species: str, taxonomy_dict: Dict[str, List[str]]) -> Dict[str, int]
    -

    Returns a dictionary with a score of taxonomic distance from the given organism.

    -

    e.g. if base_species is "Escherichia coli" and taxonomy_dict is +

    Returns a dictionary with a score of taxonomic distance from the given organism.

    +

    e.g. if base_species is "Escherichia coli" and taxonomy_dict is

     {
         "Escherichia coli": ["Escherichia", "Bacteria", "Organism"],
    @@ -432,20 +432,20 @@ 

    Functions

    "Homo sapiens": ["Homo", "Mammalia", "Animalia", "Organism"], }
    -this function would return +

    this function would return

     {
         "Escherichia coli": 0,
         "Pseudomonas": 1,
         "Homo sapiens": 2,
     }
    -

    +

    Arguments

    • base_species: str ~ The species to which a relation is made.
    • taxonomy_dict: Dict[str, List[str]] ~ A dictionary with organism names as keys and their taxonomic levels (sorted from nearest to farthest) as string list.
    • -
    +
    Expand source code @@ -522,7 +522,7 @@

    Index

    diff --git a/autopacmen/html/autopacmen/submodules/parse_bigg_metabolites_file.html b/autopacmen/html/autopacmen/submodules/parse_bigg_metabolites_file.html index a4e3af4..a6eb103 100644 --- a/autopacmen/html/autopacmen/submodules/parse_bigg_metabolites_file.html +++ b/autopacmen/html/autopacmen/submodules/parse_bigg_metabolites_file.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.parse_bigg_metabolites_file API documentation - - + + @@ -119,10 +119,10 @@

    Module autopacmen.submodules.parse_bigg_metabolites_file

    Functions

    -def parse_bigg_metabolites_file(bigg_metabolites_file_path, json_output_folder) +def parse_bigg_metabolites_file(bigg_metabolites_file_path: str, json_output_folder: str) -> NoneType
    -

    Parses a BIGG metabolites text file and returns a dictionary for this file.

    +

    Parses a BIGG metabolites text file and returns a dictionary for this file.

    As of 29/04/2019, a BIGG metabolites list of all BIGG-included metabolites is retrievable under http://bigg.ucsd.edu/data_access

    Arguments

    @@ -136,17 +136,17 @@

    Arguments

    Output

    • A JSON file with the name 'bigg_id_name_mapping.json' in the given output folder, -with the following structure: +with the following structure:
    • +
      {
          "$BIGG_ID": "$CHEMICAL_OR_USUAL_NAME",
    -     (…),
    +     (...),
          "$BIGG_ID": "$BIGG_ID",
    -     (…),
    +     (...),
      }
     
    -The BIGG ID <-> BIGG ID mapping is done for models which already use the BIGG IDs. -
    +

    The BIGG ID <-> BIGG ID mapping is done for models which already use the BIGG IDs.

    Expand source code @@ -233,7 +233,7 @@

    Index

    diff --git a/autopacmen/html/autopacmen/submodules/parse_brenda_json_for_model.html b/autopacmen/html/autopacmen/submodules/parse_brenda_json_for_model.html index f3f9716..d62497f 100644 --- a/autopacmen/html/autopacmen/submodules/parse_brenda_json_for_model.html +++ b/autopacmen/html/autopacmen/submodules/parse_brenda_json_for_model.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.parse_brenda_json_for_model API documentation - - + + @@ -183,10 +183,10 @@

    Module autopacmen.submodules.parse_brenda_json_for_model

    Functions

    -def parse_brenda_json_for_model(sbml_path, brenda_json_path, output_json_path) +def parse_brenda_json_for_model(sbml_path: str, brenda_json_path: str, output_json_path: str) -> NoneType
    -

    Reads out a BRENDA JSON file created with parse_brenda_textfile and creates a model-specific JSON.

    +

    Reads out a BRENDA JSON file created with parse_brenda_textfile and creates a model-specific JSON.

    Arguments

    • sbml_path: str ~ The path of the SBML model of which a specific BRENDA JSON kcat database @@ -195,7 +195,7 @@

      Arguments

    • output_json_path: str ~ The full path to the newly created JSON.

    Output

    -

    A JSON in the given folder and the name 'kcat_database_brenda.json', and with the following structure: +

    A JSON in the given folder and the name 'kcat_database_brenda.json', and with the following structure:

     {
         '$EC_NUMBER': {
    @@ -203,13 +203,13 @@ 

    Output

    '$ORGANISM': [ kcat_list: float ], - (…) + (...) }, - (…) + (...) }, - (…) + (...) } -

    +
    Expand source code @@ -322,7 +322,7 @@

    Index

    diff --git a/autopacmen/html/autopacmen/submodules/parse_brenda_textfile.html b/autopacmen/html/autopacmen/submodules/parse_brenda_textfile.html index fc70db9..daa2945 100644 --- a/autopacmen/html/autopacmen/submodules/parse_brenda_textfile.html +++ b/autopacmen/html/autopacmen/submodules/parse_brenda_textfile.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.parse_brenda_textfile API documentation - - + + @@ -253,10 +253,10 @@

    Module autopacmen.submodules.parse_brenda_textfileFunctions

    -def parse_brenda_textfile(brenda_textfile_path, bigg_metabolites_json_folder, json_output_path) +def parse_brenda_textfile(brenda_textfile_path: str, bigg_metabolites_json_folder: str, json_output_path: str) -> NoneType
    -

    Goes through a BRENDA database textfile and converts it into a machine-readable JSON.

    +

    Goes through a BRENDA database textfile and converts it into a machine-readable JSON.

    The JSON includes kcats for found organisms and substrates. As of 29/04/2019, the BRENDA database can be downloaded as textfile under https://www.brenda-enzymes.org/download_brenda_without_registration.php

    @@ -272,31 +272,31 @@

    Arguments

    Output

      -
    • A JSON containing the BRENDA textfile kcat data in a machine-readable format: +
    • A JSON containing the BRENDA textfile kcat data in a machine-readable format:
    • +
         {
             "$EC_NUMBER": {
                 "$SUBSTRATE_WITH_BIGG_ID_1": {
                     "$ORGANISM_1": [
                         $kcat_1,
    -                    (…)
    +                    (...)
                         $kcat_n,
                     ]
                 },
    -            (…),
    +            (...),
                 "REST": {
                     "$ORGANISM_1": [
                         $kcat_1,
    -                    (…)
    +                    (...)
                         $kcat_n,
                     ]
                 }
             }
    -        (…),
    +        (...),
         }
     
    -'REST' stands for a substrate without found BIGG ID. -
    +

    'REST' stands for a substrate without found BIGG ID.

    Expand source code @@ -517,7 +517,7 @@

    Index

    diff --git a/autopacmen/html/autopacmen/submodules/parse_sabio_rk.html b/autopacmen/html/autopacmen/submodules/parse_sabio_rk.html index 7cb16c9..046ef4d 100644 --- a/autopacmen/html/autopacmen/submodules/parse_sabio_rk.html +++ b/autopacmen/html/autopacmen/submodules/parse_sabio_rk.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.parse_sabio_rk API documentation - - + + @@ -574,43 +574,43 @@

    Module autopacmen.submodules.parse_sabio_rk

    Functions

    -

    Returns EC number-dependent kcats using an incremental wildcard level until kcarts were found for all ECs.

    +

    Returns EC number-dependent kcats using an incremental wildcard level until kcarts were found for all ECs.

    Arguments

    *ec_numbers: List[str] ~ The list of checked EC numbers.
    -
    *bigg_id_name_mapping_path : str ~ The full path to a BIGG ID<->Name mapping
    +
    *bigg_id_name_mapping_path : str ~ The full path to a BIGG ID<->Name mapping
     
    -
    *batch_size : int = 5 ~ How many EC numbers shall be looked up in parallel in SABIO-RK. Do not set this too high!
    +
    *batch_size : int = 5 ~ How many EC numbers shall be looked up in parallel in SABIO-RK. Do not set this too high!
     

    Output

    -

    A dictionary with the following content: +

    A dictionary with the following content:

             {
             "$EC_NUMBER_OR_KEGG_REACTION_ID": {
                 "$SUBSTRATE_WITH_BIGG_ID_1": {
                     "$ORGANISM_1": [
                         $kcat_1,
    -                    (…)
    +                    (...)
                         $kcat_n,
                     ]
                 },
    -            (…),
    +            (...),
                 "REST": {
                     "$ORGANISM_1": [
                         $kcat_1,
    -                    (…)
    +                    (...)
                         $kcat_n,
                     ]
                 }
             }
    -        (…),
    +        (...),
         }
     
    -'REST' stands for a substrate without found BIGG ID.

    +

    'REST' stands for a substrate without found BIGG ID.

    Expand source code @@ -725,10 +725,10 @@

    Output

    -def get_id_associated_kcats(searched_ids, id_type, bigg_id_name_mapping_path, batch_size=5) +def get_id_associated_kcats(searched_ids: List[str], id_type: str, bigg_id_name_mapping_path: str, batch_size: int = 5) -> Dict[str, Any]
    -

    Returns a dictionary with SABIO-RK kcat data for the given EC numbers or KEGG IDs.

    +

    Returns a dictionary with SABIO-RK kcat data for the given EC numbers or KEGG IDs.

    This function calls the SABIO-RK API.

    Input

      @@ -738,30 +738,30 @@

      Input

    • batch_size: int = 5 ~ The SABIO-RK API search batching number (i.e., with satch_size=5 five IDs are searched at once)

    Output

    -

    A dictionary with the following content: +

    A dictionary with the following content:

     {
         "$EC_NUMBER_OR_KEGG_REACTION_ID": {
             "$SUBSTRATE_WITH_BIGG_ID_1": {
                 "$ORGANISM_1": [
                     $kcat_1,
    -                (…)
    +                (...)
                     $kcat_n,
                 ]
             },
    -        (…),
    +        (...),
             "REST": {
                 "$ORGANISM_1": [
                     $kcat_1,
    -                (…)
    +                (...)
                     $kcat_n,
                 ]
             }
         }
    -    (…),
    +    (...),
     }
     
    -'REST' stands for a substrate without found BIGG ID.

    +

    'REST' stands for a substrate without found BIGG ID.

    Expand source code @@ -975,10 +975,10 @@

    Output

    -def sabio_rk_query_get_csv_lines(query_dicts) +def sabio_rk_query_get_csv_lines(query_dicts: List[Any]) -> Any
    -

    Returns the result of a SABIo-RK API call with the given query dicts as csvReader lines

    +

    Returns the result of a SABIo-RK API call with the given query dicts as csvReader lines

    Input

    • query_dicts: List[Any] ~ A list of query dicts in the form of {id_name: ec_number, "Parametertype": "kcat", "EnzymeType": "wildtype"}
    • @@ -989,7 +989,7 @@

      Output

      Either "NO_RESULT" (a str) if no search esult was found, or a list of strings which includes the lines of the CSV that is returned by SABIO-RK -
    +
    Expand source code @@ -1016,10 +1016,10 @@

    Output

    -def sabio_rk_query_with_query_dicts(query_dicts) +def sabio_rk_query_with_query_dicts(query_dicts: List[Any]) -> str
    -

    Performs a SABIO-RK query with given query dicts and converts them into a string

    +

    Performs a SABIO-RK query with given query dicts and converts them into a string

    Input

    • query_dicts: List[Any] ~ A list of query dicts in the form of {id_name: ec_number, "Parametertype": "kcat", "EnzymeType": "wildtype"}
    • @@ -1027,7 +1027,7 @@

      Input

      Output

      • As in sabio_rk_query_with_string()
      • -
    +
    Expand source code @@ -1057,10 +1057,10 @@

    Output

    -def sabio_rk_query_with_string(query_string) +def sabio_rk_query_with_string(query_string: str) -> str
    -

    Call SABIO-RK API with the given query string.

    +

    Call SABIO-RK API with the given query string.

    The query string is the actual term that is searched

    Arguments

      @@ -1073,7 +1073,7 @@

      Output

      The returned result fields are the EC number, the KEGG reaction ID, the organism and the 'parameter', i.e. the category of the given result. A possible category is 'kcat'. -If no results could be found, it is the str "NO_RESULT".

    +If no results could be found, it is the str "NO_RESULT".

    Expand source code @@ -1153,7 +1153,7 @@

    Index

    diff --git a/autopacmen/html/autopacmen/submodules/parse_sabio_rk_for_model.html b/autopacmen/html/autopacmen/submodules/parse_sabio_rk_for_model.html index f3509e7..68e7206 100644 --- a/autopacmen/html/autopacmen/submodules/parse_sabio_rk_for_model.html +++ b/autopacmen/html/autopacmen/submodules/parse_sabio_rk_for_model.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.parse_sabio_rk_for_model API documentation - - + + @@ -139,10 +139,10 @@

    Module autopacmen.submodules.parse_sabio_rk_for_modelFunctions

    -def parse_sabio_rk_for_model(model, json_output_path, bigg_id_name_mapping_path) +def parse_sabio_rk_for_model(model: cobra.core.model.Model, json_output_path: str, bigg_id_name_mapping_path: str) -> NoneType
    -

    Retrieves kcats from SABIO-RK for the given model and stores it in a JSON for the given model in the given path.

    +

    Retrieves kcats from SABIO-RK for the given model and stores it in a JSON for the given model in the given path.

    Algorithm

    Using the SABIO-RK REST API (as of 2019/30/04, it is explained under http://sabiork.h-its.org/layouts/content/docuRESTfulWeb/RESTWebserviceIntro.gsp),

    @@ -153,31 +153,31 @@

    Arguments

    Output

      -
    • A JSON in the given project folder with the following structure: +
    • A JSON in the given project folder with the following structure:
    • +
         {
             "$EC_NUMBER_OR_KEGG_REACTION_ID": {
                 "$SUBSTRATE_WITH_BIGG_ID_1": {
                     "$ORGANISM_1": [
                         $kcat_1,
    -                    (…)
    +                    (...)
                         $kcat_n,
                     ]
                 },
    -            (…),
    +            (...),
                 "REST": {
                     "$ORGANISM_1": [
                         $kcat_1,
    -                    (…)
    +                    (...)
                         $kcat_n,
                     ]
                 }
             }
    -        (…),
    +        (...),
         }
     
    -'REST' stands for a substrate without found BIGG ID. -
    +

    'REST' stands for a substrate without found BIGG ID.

    Expand source code @@ -242,15 +242,15 @@

    Output

    -def parse_sabio_rk_for_model_with_sbml(sbml_path, json_output_path, bigg_id_name_mapping_path) +def parse_sabio_rk_for_model_with_sbml(sbml_path: str, json_output_path: str, bigg_id_name_mapping_path: str) -> NoneType
    -

    See this module's parse_sabio_rk_for_model() documentation. This function uses an SBML path.

    +

    See this module's parse_sabio_rk_for_model() documentation. This function uses an SBML path.

    Arguments

    • sbml_path: str ~ The model's SBML path.
    • json_output_path: str ~ The path of the JSON that shall be created
    • -
    +
    Expand source code @@ -295,7 +295,7 @@

    Index

    diff --git a/autopacmen/html/autopacmen/submodules/reaction_flux_control_by_scenario.html b/autopacmen/html/autopacmen/submodules/reaction_flux_control_by_scenario.html index 5447404..fe2c1e3 100644 --- a/autopacmen/html/autopacmen/submodules/reaction_flux_control_by_scenario.html +++ b/autopacmen/html/autopacmen/submodules/reaction_flux_control_by_scenario.html @@ -3,14 +3,14 @@ - + autopacmen.submodules.reaction_flux_control_by_scenario API documentation - - + + @@ -173,10 +173,10 @@

    Module autopacmen.submodules.reaction_flux_control_by_sc

    Functions

    -def reaction_flux_control_by_scenario(model, output_folder, project_name, scenarios) +def reaction_flux_control_by_scenario(model: cobra.core.model.Model, output_folder: str, project_name: str, scenarios)
    -

    Creates reaction flux control files for the given model in the given folder, and depending on the given scenarios.

    +

    Creates reaction flux control files for the given model in the given folder, and depending on the given scenarios.

    Definition of 'reaction flux control file': A reaction flux control file contains a list of reactions and the realative change of the objective solution if the protein constraint of the reaction is removed.

    @@ -189,7 +189,7 @@

    Arguments

    applied on the model, one by one

    Output

    -

    Reaction flux control files in the given folder (see _reaction_flux_control()'s comment for more)

    +

    Reaction flux control files in the given folder (see _reaction_flux_control()'s comment for more)

    Expand source code @@ -251,7 +251,7 @@

    Index