0001 function ecModel = updateProtPool(ecModel, Ptot, modelAdapter)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 protRxns = find(startsWith(ecModel.rxns,'usage_prot_'));
0030 poolMetIdx = find(strcmp(ecModel.mets,'prot_pool'));
0031
0032 constProtRxns = ~(ecModel.lb(protRxns)==-1000);
0033
0034 if any(full(ecModel.S(poolMetIdx,protRxns(constProtRxns))))
0035 error(['In the provided ecModel, all protein usage reactions, both with ' ...
0036 'and without concentration constraints, draw from the protein pool. ' ...
0037 'This was introduced with GECKO 3.2.0. Since then, updateProtPool ' ...
0038 'has become obsolete, use setProtPoolSize instead to constrain the ' ...
0039 'total protein pool with condition-specific total protein content. See '...
0040 '<a href="https://github.com/SysBioChalmers/GECKO/issues/375">here</a> ' ...
0041 'for more explanation.'])
0042 end
0043
0044 if nargin < 3 || isempty(modelAdapter)
0045 modelAdapter = ModelAdapterManager.getDefault();
0046 if isempty(modelAdapter)
0047 error('Either send in a modelAdapter or set the default model adapter in the ModelAdapterManager.')
0048 end
0049 end
0050 params = modelAdapter.params;
0051
0052 if nargin < 2 || isempty(Ptot)
0053 Ptot = params.Ptot;
0054 disp(['Total protein content used: ' num2str(Ptot) ' [g protein/gDw]'])
0055 end
0056
0057
0058 if Ptot < 1
0059 Ptot = Ptot * 1000;
0060 end
0061
0062 Pmeas = sum(ecModel.ec.concs,'omitnan');
0063 if Pmeas == 0
0064 error('The model has not yet been populated with proteomics, as ecModel.ec.concs is empty.')
0065 end
0066
0067 Pnew = (Ptot - Pmeas) * params.f;
0068
0069 if Pnew > 0
0070 PoolRxnIdx = strcmp(ecModel.rxns,'prot_pool_exchange');
0071 ecModel.lb(PoolRxnIdx) = -Pnew*params.sigma;
0072 sol = solveLP(ecModel);
0073 if isempty(sol.x)
0074 error(['Estimating the remaining protein pool by subtracting the ' ...
0075 'sum of measured enzyme concentrations (in ecModel.ec.concs) ' ...
0076 'from the total protein pool (Ptot) does not yield a functional ' ...
0077 'model.'])
0078 end
0079 else
0080 error('The total measured protein mass exceeds the total protein content.')
0081 end
0082 end