diff --git a/doc/src/geckomat/utilities/ecFSEOF.html b/doc/src/geckomat/utilities/ecFSEOF.html index 5d80d73ae..eb327cf71 100644 --- a/doc/src/geckomat/utilities/ecFSEOF.html +++ b/doc/src/geckomat/utilities/ecFSEOF.html @@ -77,7 +77,7 @@
getFluxTarget @@ -37,15 +37,11 @@DESCRIPTION DESCRIPTION CROSS-REFERENCE INFORMATION
@@ -69,7 +65,7 @@CROSS-REFERENCE INFORMATION SOURCE CODE
-0001 function [maxFlux, minFlux] = getFluxTarget(model,targetRxn,csRxn,alpha,tolerance,modelAdapter) ++0031 % Fix a suboptimal alpha if equal to 1 +0032 if alpha == 1 +0033 alpha = 0.99; +0034 end +0035 +0036 % Get relevant rxn indexes +0037 bioRxnIdx = getIndexes(model, bioRxn,'rxns'); +0038 poolIdx = strcmpi(model.rxns, 'prot_pool_exchange'); +0039 +0040 % Maximize growth and fix carbon source and suboptimal growth +0041 model = setParam(model, 'obj', bioRxn, 1); +0042 sol = solveLP(model); +0043 model = setParam(model, 'lb', bioRxn, sol.x(bioRxnIdx) * alpha); +0044 +0045 % Minimize prot_pool_exchange and fix +0046 model = setParam(model, 'obj', 'prot_pool_exchange', 1); +0047 sol = solveLP(model); +0048 model = setParam(model, 'lb', 'prot_pool_exchange', sol.x(poolIdx) * 1.01); +0049 +0050 % If minimum fluxes are required get them +0051 minFlux = []; +0052 if nargout == 2 +0053 % Minimize target +0054 model = setParam(model, 'obj', targetRxn, -1); +0055 minSol = solveLP(model); +0056 minFlux = minSol.x; +0057 end +0058 +0059 % Maximize target +0060 model = setParam(model, 'obj', targetRxn, 1); +0061 maxSol = solveLP(model); +0062 maxFlux = maxSol.x; +0063 end0001 function [maxFlux, minFlux] = getFluxTarget(model,bioRxn,targetRxn,alpha) 0002 % getFluxTarget 0003 % 0004 % Function that performs a series of LP optimizations on an ecModel, @@ -80,77 +76,58 @@SOURCE CODE % 0010 % Input: 0011 % model an ecModel in GECKO 3 format (with ecModel.ec structure). -0012 % targetRxn rxn ID for the production target reaction, a exchange -0013 % reaction is recommended. -0014 % csRxn rxn ID for the main carbon source uptake reaction. +0012 % bioRxn rxn ID for the biomass reaction. +0013 % targetRxn rxn ID for the production target reaction, a exchange +0014 % reaction is recommended. 0015 % alpha scalling factor for desired suboptimal growth. 0016 % (Optional, default 0.95) -0017 % tolerance numerical tolerance for fixing bounds -0018 % (Optional, default 1e-4) -0019 % modelAdapter a loaded model adapter. (Optional, will otherwise use -0020 % the default model adapter) -0021 % -0022 % Output: -0023 % minFlux vector of minimum flux rates at minimum target production, -0024 % corresponding to model.rxns -0025 % maxFlux vector of maximum flux rates at maximum target production, -0026 % corresponding to model.rxns -0027 % -0028 % Usage: -0029 % [maxFlux, minFlux] = simulateGrowth(ecModel,targetRxn,csRxn,alpha,tol) +0017 % +0018 % Output: +0019 % minFlux vector of minimum flux rates at minimum target production, +0020 % corresponding to model.rxns +0021 % maxFlux vector of maximum flux rates at maximum target production, +0022 % corresponding to model.rxns +0023 % +0024 % Usage: +0025 % [maxFlux, minFlux] = getFluxTarget(ecModel,bioRxn,targetRxn,alpha) +0026 +0027 if nargin < 4 || isempty(alpha) +0028 alpha = 0.95; +0029 end 0030 -0031 if nargin < 6 || isempty(modelAdapter) -0032 modelAdapter = ModelAdapterManager.getDefault(); -0033 if isempty(modelAdapter) -0034 error('Either send in a modelAdapter or set the default model adapter in the ModelAdapterManager.') -0035 end -0036 end -0037 params = modelAdapter.getParameters(); -0038 -0039 if nargin < 5 || isempty(tolerance) -0040 tolerance = 1e-4; -0041 end -0042 -0043 if nargin < 4 || isempty(alpha) -0044 alpha = 0.95; -0045 end -0046 -0047 % Get relevant rxn indexes -0048 targetRxnIdx = getIndexes(model, targetRxn,'rxns'); -0049 csRxnIdx = getIndexes(model, csRxn,'rxns'); -0050 bioRxnIdx = getIndexes(model, params.bioRxn,'rxns'); -0051 -0052 % Maximize growth and fix carbon source and suboptimal growth -0053 model = setParam(model, 'obj', params.bioRxn, 1); -0054 sol = solveLP(model); -0055 model = setParam(model, 'var', csRxn, sol.x(csRxnIdx), tolerance); -0056 model = setParam(model, 'lb', params.bioRxn, sol.x(bioRxnIdx) * (1-tolerance) * alpha); -0057 -0058 % If minimum fluxes are required get them -0059 minFlux = []; -0060 if nargout == 2 -0061 % Minimize target -0062 model = setParam(model, 'obj', targetRxn, -1); -0063 sol = solveLP(model); -0064 -0065 % Now fix min value for target and minimize proteins usage -0066 model.lb(targetRxnIdx) = sol.x(targetRxnIdx) * (1-tolerance); -0067 model = setParam(model, 'obj', 'prot_pool_exchange', 1); -0068 minSol = solveLP(model,1); -0069 minFlux = minSol.x; -0070 end -0071 -0072 % Maximize target -0073 model = setParam(model, 'obj', targetRxn, 1); -0074 sol = solveLP(model); -0075 -0076 % Now fix max value for target and minimize proteins usage -0077 model.lb(targetRxnIdx) = sol.x(targetRxnIdx) * (1-tolerance); -0078 model = setParam(model, 'obj', 'prot_pool_exchange', 1); -0079 maxSol = solveLP(model); -0080 maxFlux = maxSol.x; -0081 -0082 end
Generated by m2html © 2005