From f01456093839ffbbcd2acd8d02132042b1000eaa Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Fri, 17 May 2024 22:33:21 +0000 Subject: [PATCH] build based on e59ae02 --- dev/.documenter-siteinfo.json | 2 +- dev/index.html | 8 ++++---- dev/objects.inv | Bin 683 -> 720 bytes dev/search_index.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index dbca960..2c9e09b 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.3","generation_timestamp":"2024-05-13T14:24:32","documenter_version":"1.4.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.3","generation_timestamp":"2024-05-17T22:33:18","documenter_version":"1.4.1"}} \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index 149e156..fd03b58 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,16 +1,16 @@ -Home · DataDrivenEnzymeRateEqs.jl

DataDrivenEnzymeRateEqs

Documentation for DataDrivenEnzymeRateEqs.

DataDrivenEnzymeRateEqs.data_driven_rate_equation_selectionMethod
data_driven_rate_equation_selection(
+Home · DataDrivenEnzymeRateEqs.jl

DataDrivenEnzymeRateEqs

Documentation for DataDrivenEnzymeRateEqs.

DataDrivenEnzymeRateEqs.data_driven_rate_equation_selectionMethod
data_driven_rate_equation_selection(
     general_rate_equation::Function,
     data::DataFrame,
     metab_names::Tuple{Symbol,Vararg{Symbol}},
     param_names::Tuple{Symbol,Vararg{Symbol}},
     range_number_params::Tuple{Int,Int},
     forward_model_selection::Bool,
-)

This function is used to perform data-driven rate equation selection using a general rate equation and data. The function will select the best rate equation by iteratively removing parameters from the general rate equation and finding an equation that yield best test scores on data not used for fitting.

Arguments

  • general_rate_equation::Function: Function that takes a NamedTuple of metabolite concentrations (with metab_names keys) and parameters (with param_names keys) and returns an enzyme rate.
  • data::DataFrame: DataFrame containing the data with column Rate and columns for each metab_names where each row is one measurement. It also needs to have a column source that contains a string that identifies the source of the data. This is used to calculate the weights for each figure in the publication.
  • metab_names::Tuple: Tuple of metabolite names that correspond to the metabolites of rate_equation and column names in data.
  • param_names::Tuple: Tuple of parameter names that correspond to the parameters of rate_equation.
  • range_number_params::Tuple{Int,Int}: A tuple of integers representing the range of the number of parameters of generalrateequation to search over.
  • forward_model_selection::Bool: A boolean indicating whether to use forward model selection (true) or reverse model selection (false).

Returns nothing, but saves a csv file for each num_params with the results of the training for each combination of parameters tested and a csv file with test results for top 10% of the best results with each number of parameters tested.

source
DataDrivenEnzymeRateEqs.display_rate_equationMethod
display_rate_equation(
+)

This function is used to perform data-driven rate equation selection using a general rate equation and data. The function will select the best rate equation by iteratively removing parameters from the general rate equation and finding an equation that yield best test scores on data not used for fitting.

Arguments

  • general_rate_equation::Function: Function that takes a NamedTuple of metabolite concentrations (with metab_names keys) and parameters (with param_names keys) and returns an enzyme rate.
  • data::DataFrame: DataFrame containing the data with column Rate and columns for each metab_names where each row is one measurement. It also needs to have a column source that contains a string that identifies the source of the data. This is used to calculate the weights for each figure in the publication.
  • metab_names::Tuple: Tuple of metabolite names that correspond to the metabolites of rate_equation and column names in data.
  • param_names::Tuple: Tuple of parameter names that correspond to the parameters of rate_equation.
  • range_number_params::Tuple{Int,Int}: A tuple of integers representing the range of the number of parameters of generalrateequation to search over.
  • forward_model_selection::Bool: A boolean indicating whether to use forward model selection (true) or reverse model selection (false).

Returns nothing, but saves a csv file for each num_params with the results of the training for each combination of parameters tested and a csv file with test results for top 10% of the best results with each number of parameters tested.

source
DataDrivenEnzymeRateEqs.display_rate_equationMethod
display_rate_equation(
 rate_equation::Function,
 metab_names::Tuple{Symbol,Vararg{Symbol}},
 param_names::Tuple{Symbol,Vararg{Symbol}};
-nt_param_removal_code = nothing

)

Return the symbolic rate equation for the given rate equation function.

Arguments

  • rate_equation::Function: The rate equation function.
  • metab_names::Tuple{Symbol,Vararg{Symbol}}: The names of the metabolites.
  • param_names::Tuple{Symbol,Vararg{Symbol}}: The names of the parameters.
  • ntparamremoval_code::NamedTuple: The named tuple of the parameters to remove from the rate equation.
source
DataDrivenEnzymeRateEqs.fit_rate_equationMethod
fit_rate_equation(
+nt_param_removal_code = nothing

)

Return the symbolic rate equation for the given rate equation function.

Arguments

  • rate_equation::Function: The rate equation function.
  • metab_names::Tuple{Symbol,Vararg{Symbol}}: The names of the metabolites.
  • param_names::Tuple{Symbol,Vararg{Symbol}}: The names of the parameters.
  • ntparamremoval_code::NamedTuple: The named tuple of the parameters to remove from the rate equation.
source
DataDrivenEnzymeRateEqs.fit_rate_equationMethod
fit_rate_equation(
     rate_equation::Function,
     data::DataFrame,
     metab_names::Tuple{Symbol, Vararg{Symbol}},
@@ -22,4 +22,4 @@
     source = ["Figure 1", "Figure 1", "Figure 2"]
 )
 rate_equation(metabs, params) = params.Vmax * metabs.S / (1 + metabs.S / params.K_S)
-fit_rate_equation(rate_equation, data, (:A,), (:Vmax, :K_S))
source
DataDrivenEnzymeRateEqs.@derive_general_mwc_rate_eqMacro
derive_general_mwc_rate_eq(metabs_and_regulators_kwargs...)

Derive a function that calculates the rate of a reaction using the general MWC rate equation given the list of substrates, products, and regulators that bind to specific cat or reg sites.

The general MWC rate equation is given by:

\[Rate = \\frac{{V_{max}^a \\prod_{i=1}^{n} \\left(\\frac{S_i}{K_{a, i}}\\right) - V_{max}^a_{rev} \\prod_{i=1}^{n} \\left(\\frac{P_i}{K_{a, i}}\\right) \\cdot Z_{a, cat}^{n-1} \\cdot Z_{a, reg}^n + L \\left(V_{max}^i \\prod_{i=1}^{n} \\left(\\frac{S_i}{K_{i, i}}\\right) - V_{max}^i_{rev} \\prod_{i=1}^{n} \\left(\\frac{P_i}{K_{i, i}}\\right)\\right) \\cdot Z_{i, cat}^{n-1} \\cdot Z_{i, reg}^n}}{Z_{a, cat}^n \\cdot Z_{a, reg}^n + L \\cdot Z_{i, cat}^n \\cdot Z_{i, reg}^n}\]

where:

  • $V_{max}^a$ is the maximum rate of the forward reaction
  • $V_{max rev}^a$ is the maximum rate of the reverse reaction
  • $V_{max}^i$ is the maximum rate of the forward reaction
  • $V_{max rev}^i$ is the maximum rate of the reverse reaction
  • $S_i$ is the concentration of the $i^{th}$ substrate
  • $P_i$ is the concentration of the $i^{th}$ product
  • $K_{a, i}$ is the Michaelis constant for the $i^{th}$ substrate
  • $K_{i, i}$ is the Michaelis constant for the $i^{th}$ product
  • $Z_{a, cat}$ is the allosteric factor for the catalytic site
  • $Z_{i, cat}$ is the allosteric factor for the catalytic site
  • $Z_{a, reg}$ is the allosteric factor for the regulatory site
  • $Z_{i, reg}$ is the allosteric factor for the regulatory site
  • $L$ is the ratio of inactive to active enzyme conformations in the absence of ligands
  • $n$ is the oligomeric state of the enzyme

Arguments

  • metabs_and_regulators_kwargs...: keyword arguments that specify the substrates, products, catalytic sites, regulatory sites, and other parameters of the reaction.

Returns

  • A function that calculates the rate of the reaction using the general MWC rate equation
  • A tuple of the names of the metabolites and parameters used in the rate equation
source
+fit_rate_equation(rate_equation, data, (:A,), (:Vmax, :K_S))
source
DataDrivenEnzymeRateEqs.@derive_general_mwc_rate_eqMacro
derive_general_mwc_rate_eq(metabs_and_regulators_kwargs...)

Derive a function that calculates the rate of a reaction using the general MWC rate equation given the list of substrates, products, and regulators that bind to specific cat or reg sites.

The general MWC rate equation is given by:

\[Rate = \\frac{{V_{max}^a \\prod_{i=1}^{n} \\left(\\frac{S_i}{K_{a, i}}\\right) - V_{max, rev}^a \\prod_{i=1}^{n} \\left(\\frac{P_i}{K_{a, i}}\\right) \\cdot Z_{a, cat}^{n-1} \\cdot Z_{a, reg}^n + L \\left(V_{max}^i \\prod_{i=1}^{n} \\left(\\frac{S_i}{K_{i, i}}\\right) - V_{max, rev}^i \\prod_{i=1}^{n} \\left(\\frac{P_i}{K_{i, i}}\\right)\\right) \\cdot Z_{i, cat}^{n-1} \\cdot Z_{i, reg}^n}}{Z_{a, cat}^n \\cdot Z_{a, reg}^n + L \\cdot Z_{i, cat}^n \\cdot Z_{i, reg}^n}\]

where:

  • $V_{max}^a$ is the maximum rate of the forward reaction
  • $V_{max, rev}^a$ is the maximum rate of the reverse reaction
  • $V_{max}^i$ is the maximum rate of the forward reaction
  • $V_{max, rev}^i$ is the maximum rate of the reverse reaction
  • $S_i$ is the concentration of the $i^{th}$ substrate
  • $P_i$ is the concentration of the $i^{th}$ product
  • $K_{a, i}$ is the Michaelis constant for the $i^{th}$ substrate
  • $K_{i, i}$ is the Michaelis constant for the $i^{th}$ product
  • $Z_{a, cat}$ is the allosteric factor for the catalytic site
  • $Z_{i, cat}$ is the allosteric factor for the catalytic site
  • $Z_{a, reg}$ is the allosteric factor for the regulatory site
  • $Z_{i, reg}$ is the allosteric factor for the regulatory site
  • $L$ is the ratio of inactive to active enzyme conformations in the absence of ligands
  • $n$ is the oligomeric state of the enzyme

Arguments

  • metabs_and_regulators_kwargs...: keyword arguments that specify the substrates, products, catalytic sites, regulatory sites, and other parameters of the reaction.

Returns

  • A function that calculates the rate of the reaction using the general MWC rate equation
  • A tuple of the names of the metabolites and parameters used in the rate equation
source
DataDrivenEnzymeRateEqs.@derive_general_qssa_rate_eqMacro
derive_general_qssa_rate_eq(metabs_and_regulators_kwargs...)

Derive a function that calculates the rate of a reaction using the Quasi Steady State Approximation (QSSA) given the list of substrates, products, and regulators.

The general QSSA rate equation is given by:

`$math Rate = \frac{V_{max} \left(\frac{\prod_{i=1}^{n}S_i}{(K_{S1...Sn})^n}\right) - V_{max, rev} \left(\frac{\prod_{i=1}^{n}P_i}{(K_{P1...Pn})^n}\right)}{Z}$ where:

  • $V_{max}$ is the maximum rate of the forward reaction
  • $V_{max, rev}$ is the maximum rate of the reverse reaction
  • $S_i$, $P_i$, $R_i$ is the concentration of the $i^{th}$ substrate (S), product (P), or regulator (R)
  • ``K{X1...X_n} is the kineitc constant
  • $Z$ is a combination of all terms containing products of [S], [P], and [R] divided by KSP_R

Arguments

  • metabs_and_regulators_kwargs...: keyword arguments that specify the substrates, products, catalytic sites, regulatory sites, and other parameters of the reaction.

Returns

  • A function that calculates the rate of the reaction using the general qssa rate equation
  • A tuple of the names of the metabolites and parameters used in the rate equation
source
diff --git a/dev/objects.inv b/dev/objects.inv index 809513a172f317c2af901a66626822969d486f4b..86ab428ad596938ac0ebec653b70b5dffafeb107 100644 GIT binary patch delta 589 zcmV-T0)Dp$*_Cv+>X4Yrqr zM*R2sgI&V1A9lJ;k&wV249~p#&M+CL@Q9SAmsF%^{2rk%B8N9qqRCWdE8y4s_d17f zM8ow`xr>ay28?|Ff0qAGr`9{iUotGPk(%!pqqlHb}vCTz>Oq1 zsFUhrg8bF*>wG3yg6@bUa=u+|Ha*81^ow2QpnnRA3}rOoXmVv3M`xc$XQw5nUp2A% zlk$t6!S8vj-R5L!Uy;`*(+-jEg?u2AVg(EwCg$*{@xnyPv4mW#2*atMpvJdevWo_m{T0;%9%sTUnSLcRM;H`dk> zlvN9wN$$97=_3WZi@m29&L7e;kGd~ODn*wBqw~|gU?Kjj6D^e@!yz3;3t=kVt5U); zK7ZcQ!z-gP$n&n-i$OEBU}W7>1Fzur4v+)K{~uo)jepaESv?YG);f^aVhBYd ze$V7FP?Ah26*6qx8W`$MdfjnnnzoQn+qbV=e>jgAEt+xKCyO1}i@f3~%~AEi0f$JZ zLG}HYI1wYH8^T6ySO-;A3Hp~34&=mYBys(9km05|Qb@O^W*<{`u&?EAD0zj!p*(h$ zOpq_71V&v6a~RlVL-RO>DP!-tFGIIgRis|>l{L?W|6oOBQ=#7R|%K{#H7;445C bGX;A4+-u`U{0!0%tv-kB4yqRFgzASXM%VC7b6C*|M(<9=YIuHZ7e~y!MP+ksNMO; z1o_gNNj?xPLAOK_Ih-A*)0XrUJ+R{(^u3_Spo~V?>75viorBZP!Cr~epQ^C>O!-BR z!N)wTMX=YmugLOVzk%dCA)kn(SOEhE6LWahcw{=|SVAtwgyB?BP~9s}*-?VbY=I0# zw>RLA{4kclMt|r-;NZCT-MA%nA&@|T^-X5~VIu?yV~`5IioNLe5$xS%x^lO+V6AGP znc=p3m;O?)QS3FvaQ>8*bFAu;q*63d&^g>|YZju{l+^%aO_A3L1 zx=gD&Zp{TLG1lIuT*5jI{8r{2XEz&@lEkJ6;(9~|Hi>NKdfd)tv1LER=~R0nHq ztLB7$lEMusk(xNBF0l-M;kn=7i)GrWAVFTe2|5ub8F;aU&an+9x>W9!??Uq>a3?!` q-~*uHhan6;`vADsB-~(CF;JjqRIiw9ywg^6TXoxI+kFE#S;_O2Y!*uZ diff --git a/dev/search_index.js b/dev/search_index.js index e5bb8b5..0765e82 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"","page":"Home","title":"Home","text":"CurrentModule = DataDrivenEnzymeRateEqs","category":"page"},{"location":"#DataDrivenEnzymeRateEqs","page":"Home","title":"DataDrivenEnzymeRateEqs","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Documentation for DataDrivenEnzymeRateEqs.","category":"page"},{"location":"","page":"Home","title":"Home","text":"","category":"page"},{"location":"","page":"Home","title":"Home","text":"Modules = [DataDrivenEnzymeRateEqs]","category":"page"},{"location":"#DataDrivenEnzymeRateEqs.calculate_all_parameter_removal_codes-Tuple{Tuple{Symbol, Vararg{Symbol}}}","page":"Home","title":"DataDrivenEnzymeRateEqs.calculate_all_parameter_removal_codes","text":"Generate all possibles codes for ways that mirror params for a and i states of MWC enzyme can be removed from the rate equation\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.data_driven_rate_equation_selection-Tuple{Function, DataFrames.DataFrame, Tuple{Symbol, Vararg{Symbol}}, Tuple{Symbol, Vararg{Symbol}}, Tuple{Int64, Int64}, Bool}","page":"Home","title":"DataDrivenEnzymeRateEqs.data_driven_rate_equation_selection","text":"data_driven_rate_equation_selection(\n general_rate_equation::Function,\n data::DataFrame,\n metab_names::Tuple{Symbol,Vararg{Symbol}},\n param_names::Tuple{Symbol,Vararg{Symbol}},\n range_number_params::Tuple{Int,Int},\n forward_model_selection::Bool,\n)\n\nThis function is used to perform data-driven rate equation selection using a general rate equation and data. The function will select the best rate equation by iteratively removing parameters from the general rate equation and finding an equation that yield best test scores on data not used for fitting.\n\nArguments\n\ngeneral_rate_equation::Function: Function that takes a NamedTuple of metabolite concentrations (with metab_names keys) and parameters (with param_names keys) and returns an enzyme rate.\ndata::DataFrame: DataFrame containing the data with column Rate and columns for each metab_names where each row is one measurement. It also needs to have a column source that contains a string that identifies the source of the data. This is used to calculate the weights for each figure in the publication.\nmetab_names::Tuple: Tuple of metabolite names that correspond to the metabolites of rate_equation and column names in data.\nparam_names::Tuple: Tuple of parameter names that correspond to the parameters of rate_equation.\nrange_number_params::Tuple{Int,Int}: A tuple of integers representing the range of the number of parameters of generalrateequation to search over.\nforward_model_selection::Bool: A boolean indicating whether to use forward model selection (true) or reverse model selection (false).\n\nReturns nothing, but saves a csv file for each num_params with the results of the training for each combination of parameters tested and a csv file with test results for top 10% of the best results with each number of parameters tested.\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.display_rate_equation-Tuple{Function, Tuple{Symbol, Vararg{Symbol}}, Tuple{Symbol, Vararg{Symbol}}}","page":"Home","title":"DataDrivenEnzymeRateEqs.display_rate_equation","text":"display_rate_equation(\nrate_equation::Function,\nmetab_names::Tuple{Symbol,Vararg{Symbol}},\nparam_names::Tuple{Symbol,Vararg{Symbol}};\nnt_param_removal_code = nothing\n\n)\n\nReturn the symbolic rate equation for the given rate equation function.\n\nArguments\n\nrate_equation::Function: The rate equation function.\nmetab_names::Tuple{Symbol,Vararg{Symbol}}: The names of the metabolites.\nparam_names::Tuple{Symbol,Vararg{Symbol}}: The names of the parameters.\nntparamremoval_code::NamedTuple: The named tuple of the parameters to remove from the rate equation.\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.fit_rate_equation-Tuple{Function, DataFrames.DataFrame, Tuple{Symbol, Vararg{Symbol}}, Tuple{Symbol, Vararg{Symbol}}}","page":"Home","title":"DataDrivenEnzymeRateEqs.fit_rate_equation","text":"fit_rate_equation(\n rate_equation::Function,\n data::DataFrame,\n metab_names::Tuple{Symbol, Vararg{Symbol}},\n param_names::Tuple{Symbol, Vararg{Symbol}};\n n_iter = 20\n\n)\n\nFit rate_equation to data and return loss and best fit parameters.\n\nArguments\n\nrate_equation::Function: Function that takes a NamedTuple of metabolite concentrations (with metab_names keys) and parameters (with param_names keys) and returns an enzyme rate.\ndata::DataFrame: DataFrame containing the data with column Rate and columns for each metab_names where each row is one measurement. It also needs to have a column source that contains a string that identifies the source of the data. This is used to calculate the weights for each figure in the publication.\nmetab_names::Tuple{Symbol, Vararg{Symbol}}: Tuple of metabolite names that correspond to the metabolites of rate_equation and column names in data.\nparam_names::Tuple{Symbol, Vararg{Symbol}}: Tuple of parameter names that correspond to the parameters of rate_equation.\nn_iter::Int: Number of iterations to run the fitting process.\n\nReturns\n\nloss::Float64: Loss of the best fit.\nparams::NamedTuple: Best fit parameters with param_names keys\n\nExample\n\nusing DataFrames\ndata = DataFrame(\n Rate = [1.0, 2.0, 3.0],\n A = [1.0, 2.0, 3.0],\n source = [\"Figure 1\", \"Figure 1\", \"Figure 2\"]\n)\nrate_equation(metabs, params) = params.Vmax * metabs.S / (1 + metabs.S / params.K_S)\nfit_rate_equation(rate_equation, data, (:A,), (:Vmax, :K_S))\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.forward_selection_next_param_removal_codes-NTuple{5, Any}","page":"Home","title":"DataDrivenEnzymeRateEqs.forward_selection_next_param_removal_codes","text":"Calculate nt_param_removal_codes with num_params including non-zero term combinations for codes (excluding alpha terms) in each previous_param_removal_codes that has num_params-1\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.generate_metab_names-Tuple{Any}","page":"Home","title":"DataDrivenEnzymeRateEqs.generate_metab_names","text":"Generate the names of the metabolites for the rate equation using the same input as @derivegeneralmwcrateeq\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.generate_param_names-Tuple{Any}","page":"Home","title":"DataDrivenEnzymeRateEqs.generate_param_names","text":"Generate the names of the parameters for the rate equation using the same input as @derivegeneralmwcrateeq\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.loocv_rate_equation-Tuple{Any, Function, DataFrames.DataFrame, Tuple{Symbol, Vararg{Symbol}}, Tuple{Symbol, Vararg{Symbol}}}","page":"Home","title":"DataDrivenEnzymeRateEqs.loocv_rate_equation","text":"function to calculate train loss without a figure and test loss on removed figure\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.loss_rate_equation-Tuple{Any, Function, NamedTuple, Tuple{Symbol, Vararg{Symbol}}, Vector{Vector{Int64}}}","page":"Home","title":"DataDrivenEnzymeRateEqs.loss_rate_equation","text":"Loss function used for fitting that calculate log of ratio of rate equation predicting of rate and rate data\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.param_rescaling-Tuple{Any, Any}","page":"Home","title":"DataDrivenEnzymeRateEqs.param_rescaling","text":"Rescaling of fitting parameters from [0, 10] scale that optimizer uses to actual values\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.param_subset_select-Tuple{Any, Any, Any}","page":"Home","title":"DataDrivenEnzymeRateEqs.param_subset_select","text":"Function to convert parameter vector to vector where some params are equal to 0, Inf or each other based on ntparamremoval_code\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.reverse_selection_next_param_removal_codes-NTuple{5, Any}","page":"Home","title":"DataDrivenEnzymeRateEqs.reverse_selection_next_param_removal_codes","text":"Calculate param_removal_codes with num_params including zero term combinations for codes (excluding alpha terms) in each previous_param_removal_codes that has num_params+1\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.test_rate_equation-Tuple{Function, Any, NamedTuple, Tuple{Symbol, Vararg{Symbol}}, Tuple{Symbol, Vararg{Symbol}}}","page":"Home","title":"DataDrivenEnzymeRateEqs.test_rate_equation","text":"Function to calculate loss for a given rate_equation and nt_fitted_params on data that was not used for training\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.@derive_general_mwc_rate_eq-Tuple{Any}","page":"Home","title":"DataDrivenEnzymeRateEqs.@derive_general_mwc_rate_eq","text":"derive_general_mwc_rate_eq(metabs_and_regulators_kwargs...)\n\nDerive a function that calculates the rate of a reaction using the general MWC rate equation given the list of substrates, products, and regulators that bind to specific cat or reg sites.\n\nThe general MWC rate equation is given by:\n\nRate = fracV_max^a prod_i=1^n left(fracS_iK_a iright) - V_max^a_rev prod_i=1^n left(fracP_iK_a iright) cdot Z_a cat^n-1 cdot Z_a reg^n + L left(V_max^i prod_i=1^n left(fracS_iK_i iright) - V_max^i_rev prod_i=1^n left(fracP_iK_i iright)right) cdot Z_i cat^n-1 cdot Z_i reg^nZ_a cat^n cdot Z_a reg^n + L cdot Z_i cat^n cdot Z_i reg^n\n\nwhere:\n\nV_max^a is the maximum rate of the forward reaction\nV_max rev^a is the maximum rate of the reverse reaction\nV_max^i is the maximum rate of the forward reaction\nV_max rev^i is the maximum rate of the reverse reaction\nS_i is the concentration of the i^th substrate\nP_i is the concentration of the i^th product\nK_a i is the Michaelis constant for the i^th substrate\nK_i i is the Michaelis constant for the i^th product\nZ_a cat is the allosteric factor for the catalytic site\nZ_i cat is the allosteric factor for the catalytic site\nZ_a reg is the allosteric factor for the regulatory site\nZ_i reg is the allosteric factor for the regulatory site\nL is the ratio of inactive to active enzyme conformations in the absence of ligands\nn is the oligomeric state of the enzyme\n\nArguments\n\nmetabs_and_regulators_kwargs...: keyword arguments that specify the substrates, products, catalytic sites, regulatory sites, and other parameters of the reaction.\n\nReturns\n\nA function that calculates the rate of the reaction using the general MWC rate equation\nA tuple of the names of the metabolites and parameters used in the rate equation\n\n\n\n\n\n","category":"macro"}] +[{"location":"","page":"Home","title":"Home","text":"CurrentModule = DataDrivenEnzymeRateEqs","category":"page"},{"location":"#DataDrivenEnzymeRateEqs","page":"Home","title":"DataDrivenEnzymeRateEqs","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Documentation for DataDrivenEnzymeRateEqs.","category":"page"},{"location":"","page":"Home","title":"Home","text":"","category":"page"},{"location":"","page":"Home","title":"Home","text":"Modules = [DataDrivenEnzymeRateEqs]","category":"page"},{"location":"#DataDrivenEnzymeRateEqs.calculate_all_parameter_removal_codes-Tuple{Tuple{Symbol, Vararg{Symbol}}}","page":"Home","title":"DataDrivenEnzymeRateEqs.calculate_all_parameter_removal_codes","text":"Generate all possibles codes for ways that mirror params for a and i states of MWC enzyme can be removed from the rate equation\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.data_driven_rate_equation_selection-Tuple{Function, DataFrames.DataFrame, Tuple{Symbol, Vararg{Symbol}}, Tuple{Symbol, Vararg{Symbol}}, Tuple{Int64, Int64}, Bool}","page":"Home","title":"DataDrivenEnzymeRateEqs.data_driven_rate_equation_selection","text":"data_driven_rate_equation_selection(\n general_rate_equation::Function,\n data::DataFrame,\n metab_names::Tuple{Symbol,Vararg{Symbol}},\n param_names::Tuple{Symbol,Vararg{Symbol}},\n range_number_params::Tuple{Int,Int},\n forward_model_selection::Bool,\n)\n\nThis function is used to perform data-driven rate equation selection using a general rate equation and data. The function will select the best rate equation by iteratively removing parameters from the general rate equation and finding an equation that yield best test scores on data not used for fitting.\n\nArguments\n\ngeneral_rate_equation::Function: Function that takes a NamedTuple of metabolite concentrations (with metab_names keys) and parameters (with param_names keys) and returns an enzyme rate.\ndata::DataFrame: DataFrame containing the data with column Rate and columns for each metab_names where each row is one measurement. It also needs to have a column source that contains a string that identifies the source of the data. This is used to calculate the weights for each figure in the publication.\nmetab_names::Tuple: Tuple of metabolite names that correspond to the metabolites of rate_equation and column names in data.\nparam_names::Tuple: Tuple of parameter names that correspond to the parameters of rate_equation.\nrange_number_params::Tuple{Int,Int}: A tuple of integers representing the range of the number of parameters of generalrateequation to search over.\nforward_model_selection::Bool: A boolean indicating whether to use forward model selection (true) or reverse model selection (false).\n\nReturns nothing, but saves a csv file for each num_params with the results of the training for each combination of parameters tested and a csv file with test results for top 10% of the best results with each number of parameters tested.\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.display_rate_equation-Tuple{Function, Tuple{Symbol, Vararg{Symbol}}, Tuple{Symbol, Vararg{Symbol}}}","page":"Home","title":"DataDrivenEnzymeRateEqs.display_rate_equation","text":"display_rate_equation(\nrate_equation::Function,\nmetab_names::Tuple{Symbol,Vararg{Symbol}},\nparam_names::Tuple{Symbol,Vararg{Symbol}};\nnt_param_removal_code = nothing\n\n)\n\nReturn the symbolic rate equation for the given rate equation function.\n\nArguments\n\nrate_equation::Function: The rate equation function.\nmetab_names::Tuple{Symbol,Vararg{Symbol}}: The names of the metabolites.\nparam_names::Tuple{Symbol,Vararg{Symbol}}: The names of the parameters.\nntparamremoval_code::NamedTuple: The named tuple of the parameters to remove from the rate equation.\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.fit_rate_equation-Tuple{Function, DataFrames.DataFrame, Tuple{Symbol, Vararg{Symbol}}, Tuple{Symbol, Vararg{Symbol}}}","page":"Home","title":"DataDrivenEnzymeRateEqs.fit_rate_equation","text":"fit_rate_equation(\n rate_equation::Function,\n data::DataFrame,\n metab_names::Tuple{Symbol, Vararg{Symbol}},\n param_names::Tuple{Symbol, Vararg{Symbol}};\n n_iter = 20\n\n)\n\nFit rate_equation to data and return loss and best fit parameters.\n\nArguments\n\nrate_equation::Function: Function that takes a NamedTuple of metabolite concentrations (with metab_names keys) and parameters (with param_names keys) and returns an enzyme rate.\ndata::DataFrame: DataFrame containing the data with column Rate and columns for each metab_names where each row is one measurement. It also needs to have a column source that contains a string that identifies the source of the data. This is used to calculate the weights for each figure in the publication.\nmetab_names::Tuple{Symbol, Vararg{Symbol}}: Tuple of metabolite names that correspond to the metabolites of rate_equation and column names in data.\nparam_names::Tuple{Symbol, Vararg{Symbol}}: Tuple of parameter names that correspond to the parameters of rate_equation.\nn_iter::Int: Number of iterations to run the fitting process.\n\nReturns\n\nloss::Float64: Loss of the best fit.\nparams::NamedTuple: Best fit parameters with param_names keys\n\nExample\n\nusing DataFrames\ndata = DataFrame(\n Rate = [1.0, 2.0, 3.0],\n A = [1.0, 2.0, 3.0],\n source = [\"Figure 1\", \"Figure 1\", \"Figure 2\"]\n)\nrate_equation(metabs, params) = params.Vmax * metabs.S / (1 + metabs.S / params.K_S)\nfit_rate_equation(rate_equation, data, (:A,), (:Vmax, :K_S))\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.forward_selection_next_param_removal_codes-NTuple{5, Any}","page":"Home","title":"DataDrivenEnzymeRateEqs.forward_selection_next_param_removal_codes","text":"Calculate nt_param_removal_codes with num_params including non-zero term combinations for codes (excluding alpha terms) in each previous_param_removal_codes that has num_params-1\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.generate_metab_names-Tuple{Any}","page":"Home","title":"DataDrivenEnzymeRateEqs.generate_metab_names","text":"Generate the names of the metabolites for the rate equation using the same input as @derivegeneralmwcrateeq\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.generate_param_names-Tuple{Any}","page":"Home","title":"DataDrivenEnzymeRateEqs.generate_param_names","text":"Generate the names of the parameters for the rate equation using the same input as @derivegeneralmwcrateeq\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.generate_qssa_metab_names-Tuple{Any}","page":"Home","title":"DataDrivenEnzymeRateEqs.generate_qssa_metab_names","text":"Generate the names of the metabolites for the rate equation using the same input as @derivegeneralqssarateeq\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.generate_qssa_param_names-Tuple{Any}","page":"Home","title":"DataDrivenEnzymeRateEqs.generate_qssa_param_names","text":"Generate the names of the parameters for the rate equation using the same input as @derivegeneralqssarateeq\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.loocv_rate_equation-Tuple{Any, Function, DataFrames.DataFrame, Tuple{Symbol, Vararg{Symbol}}, Tuple{Symbol, Vararg{Symbol}}}","page":"Home","title":"DataDrivenEnzymeRateEqs.loocv_rate_equation","text":"function to calculate train loss without a figure and test loss on removed figure\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.loss_rate_equation-Tuple{Any, Function, NamedTuple, Tuple{Symbol, Vararg{Symbol}}, Vector{Vector{Int64}}}","page":"Home","title":"DataDrivenEnzymeRateEqs.loss_rate_equation","text":"Loss function used for fitting that calculate log of ratio of rate equation predicting of rate and rate data\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.param_rescaling-Tuple{Any, Any}","page":"Home","title":"DataDrivenEnzymeRateEqs.param_rescaling","text":"Rescaling of fitting parameters from [0, 10] scale that optimizer uses to actual values\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.param_subset_select-Tuple{Any, Any, Any}","page":"Home","title":"DataDrivenEnzymeRateEqs.param_subset_select","text":"Function to convert parameter vector to vector where some params are equal to 0, Inf or each other based on ntparamremoval_code\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.reverse_selection_next_param_removal_codes-NTuple{5, Any}","page":"Home","title":"DataDrivenEnzymeRateEqs.reverse_selection_next_param_removal_codes","text":"Calculate param_removal_codes with num_params including zero term combinations for codes (excluding alpha terms) in each previous_param_removal_codes that has num_params+1\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.test_rate_equation-Tuple{Function, Any, NamedTuple, Tuple{Symbol, Vararg{Symbol}}, Tuple{Symbol, Vararg{Symbol}}}","page":"Home","title":"DataDrivenEnzymeRateEqs.test_rate_equation","text":"Function to calculate loss for a given rate_equation and nt_fitted_params on data that was not used for training\n\n\n\n\n\n","category":"method"},{"location":"#DataDrivenEnzymeRateEqs.@derive_general_mwc_rate_eq-Tuple{Any}","page":"Home","title":"DataDrivenEnzymeRateEqs.@derive_general_mwc_rate_eq","text":"derive_general_mwc_rate_eq(metabs_and_regulators_kwargs...)\n\nDerive a function that calculates the rate of a reaction using the general MWC rate equation given the list of substrates, products, and regulators that bind to specific cat or reg sites.\n\nThe general MWC rate equation is given by:\n\nRate = fracV_max^a prod_i=1^n left(fracS_iK_a iright) - V_max rev^a prod_i=1^n left(fracP_iK_a iright) cdot Z_a cat^n-1 cdot Z_a reg^n + L left(V_max^i prod_i=1^n left(fracS_iK_i iright) - V_max rev^i prod_i=1^n left(fracP_iK_i iright)right) cdot Z_i cat^n-1 cdot Z_i reg^nZ_a cat^n cdot Z_a reg^n + L cdot Z_i cat^n cdot Z_i reg^n\n\nwhere:\n\nV_max^a is the maximum rate of the forward reaction\nV_max rev^a is the maximum rate of the reverse reaction\nV_max^i is the maximum rate of the forward reaction\nV_max rev^i is the maximum rate of the reverse reaction\nS_i is the concentration of the i^th substrate\nP_i is the concentration of the i^th product\nK_a i is the Michaelis constant for the i^th substrate\nK_i i is the Michaelis constant for the i^th product\nZ_a cat is the allosteric factor for the catalytic site\nZ_i cat is the allosteric factor for the catalytic site\nZ_a reg is the allosteric factor for the regulatory site\nZ_i reg is the allosteric factor for the regulatory site\nL is the ratio of inactive to active enzyme conformations in the absence of ligands\nn is the oligomeric state of the enzyme\n\nArguments\n\nmetabs_and_regulators_kwargs...: keyword arguments that specify the substrates, products, catalytic sites, regulatory sites, and other parameters of the reaction.\n\nReturns\n\nA function that calculates the rate of the reaction using the general MWC rate equation\nA tuple of the names of the metabolites and parameters used in the rate equation\n\n\n\n\n\n","category":"macro"},{"location":"#DataDrivenEnzymeRateEqs.@derive_general_qssa_rate_eq-Tuple{Any}","page":"Home","title":"DataDrivenEnzymeRateEqs.@derive_general_qssa_rate_eq","text":"derive_general_qssa_rate_eq(metabs_and_regulators_kwargs...)\n\nDerive a function that calculates the rate of a reaction using the Quasi Steady State Approximation (QSSA) given the list of substrates, products, and regulators.\n\nThe general QSSA rate equation is given by:\n\n`math Rate = fracV_max left(fracprod_i=1^nS_i(K_S1Sn)^nright) - V_max rev left(fracprod_i=1^nP_i(K_P1Pn)^nright)Z where:\n\nV_max is the maximum rate of the forward reaction\nV_max rev is the maximum rate of the reverse reaction\nS_i, P_i, R_i is the concentration of the i^th substrate (S), product (P), or regulator (R)\n``K{X1...X_n} is the kineitc constant\nZ is a combination of all terms containing products of [S], [P], and [R] divided by KSP_R\n\nArguments\n\nmetabs_and_regulators_kwargs...: keyword arguments that specify the substrates, products, catalytic sites, regulatory sites, and other parameters of the reaction.\n\nReturns\n\nA function that calculates the rate of the reaction using the general qssa rate equation\nA tuple of the names of the metabolites and parameters used in the rate equation\n\n\n\n\n\n","category":"macro"}] }