-
Notifications
You must be signed in to change notification settings - Fork 0
/
changePAMParameter.m
249 lines (233 loc) · 9.23 KB
/
changePAMParameter.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
function model_pa = changePAMParameter(model_pa,varargin)
% Change proein allocation model parameters
%
%
% INPUTS:
% model_pa: protein allocation model
%
%
% varargin Optional Inputs provided as 'ParameterName', Value pairs.
%
% *kcat vector containing kcat values to be changed.
% Also requires "rxnID" as an input
% argument.(unit: 1/s)
%
% *rxnID Character vector of Reaction ID of enzymatic reactions for which
% kcat values are to be changed. May be a cell array
% if multiple reactions should be changed. Also requires
% "kcat" as an input argument.
%
% *totProtConc New concentration of total
% condition-dependent protein (unit: g/g_CDW)
%
% *subsRxnID Character vector with new substrate uptake
% reaction ID for parametrization of the excess enzymes sector.
% Can also be a cell array if
% multiple substrates should be considered at the
% same time. Also requires "subsUptakeMax" as an
% input argument.
%
% *subsUptakeMax Vecor containing the maximal substrate
% uptake rates for the new substrate
% upake reactions.
%
% *EEPS_0 Protein allocated to excess enzymes sector at
% zeros substrate uptake (unit: g/g_CDW).
%
% *TPS_0 Protein allocated to translational protein
% sector at zero growth (unit: g/g_CDW).
%
% *TPS_mu Slope protein allocated to translational sector
% per unit increase of growth rate (unit: g h/g_CDW)
%
%
%
%
% *printFlag (1): prints ouput (default); (0) no printed output
%
%
% OUTPUT
% model_pa: Protein allocation model including parameter changes
%
%
% Author: Tobias B. Alter
% NOV 15, 2019
%% setup parameter change
% preallocate variables
kcat = [];
rxnID = {};
totProtConc = [];
subsRxnID = {};
subsUptakeMax = [];
EEPS_0_parameter = [];
TPS_0_parameter = [];
TPS_mu_parameter = [];
if any(strcmp(varargin,'kcat'))
kcat = varargin{find(strcmp(varargin,'kcat'))+1};
end
if any(strcmp(varargin,'rxnID'))
rxnID = varargin{find(strcmp(varargin,'rxnID'))+1};
end
if any(strcmp(varargin,'totProtConc'))
totProtConc = varargin{find(strcmp(varargin,'totProtConc'))+1};
end
if any(strcmp(varargin,'subsRxnID'))
subsRxnID = varargin{find(strcmp(varargin,'subsRxnID'))+1};
end
if any(strcmp(varargin,'subsUptakeMax'))
subsUptakeMax = varargin{find(strcmp(varargin,'subsUptakeMax'))+1};
end
if any(strcmp(varargin,'EEPS_0'))
EEPS_0_parameter = varargin{find(strcmp(varargin,'EEPS_0'))+1};
end
if any(strcmp(varargin,'TPS_0'))
TPS_0_parameter = varargin{find(strcmp(varargin,'TPS_0'))+1};
end
if any(strcmp(varargin,'TPS_mu'))
TPS_mu_parameter = varargin{find(strcmp(varargin,'TPS_mu'))+1};
end
if any(strcmp(varargin,'printFlag'))
printFlag = varargin{find(strcmp(varargin,'printFlag'))+1};
else
printFlag = 1;
end
%% load model data
opt = model_pa.opt_pa;
%% change kcat values
if ~isempty(kcat) && ~isempty(rxnID)
if ischar(rxnID)
rxnID = {rxnID};
end
% check provided data
if length(kcat)~=length(rxnID)
warning('Number of provided kcat values does not match the number of reaction IDs')
else
% load parameter
rxns2ECrxns = opt.activeEnzymesSector.rxns2ECrxns;
cnstrID2ECrxns = opt.activeEnzymesSector.cnstrID2ECrxns;
ECrxns = opt.activeEnzymesSector.ECrxns;
for i=1:length(kcat)
pos = find(strcmp(rxns2ECrxns,rxnID{i}));
model_pa.S(strcmp(model_pa.mets,cnstrID2ECrxns{pos}),...
strcmp(model_pa.rxns,ECrxns{pos})) ...
= -(kcat(i)*3600)*1e-6;
% save new kcat value
oldkcat = opt.activeEnzymesSector.kcat2ECrxns(pos);
opt.activeEnzymesSector.kcat2ECrxns(pos) = kcat(i);
% print
if printFlag
fprintf([rxnID{i},': kcat value changed from: ',num2str(oldkcat),' 1/s to ',...
num2str(kcat(i)),' 1/s\n'])
end
end
end
end
%% change concentration of total condition-dependent protein
if ~isempty(totProtConc)
% change parameter
model_pa.b(strcmp(model_pa.mets,opt.totalProtein.cnstrID)) ...
= totProtConc*1000;
% save new value
oldconc = opt.totalProtein.totalProteinConcentration;
opt.totalProtein.totalProteinConcentration = totProtConc;
% print
if printFlag
fprintf(['Total condition-dependent protein concentration changed from: ',...
num2str(oldconc),' g/g_CDW to ', num2str(totProtConc),' g/g_CDW \n'])
end
end
%% change concentration of maximal excess enzyme protein allocation
if ~isempty(EEPS_0_parameter)
% change parameter
model_pa.b(strcmp(model_pa.mets,opt.excessEnzymesSector.cnstrID)) ...
= EEPS_0_parameter*1000;
% save new value
oldconc = opt.excessEnzymesSector.EEPS_0;
opt.excessEnzymesSector.EEPS_0 = EEPS_0_parameter;
% print
if printFlag
fprintf(['Maximal protein amount allocated to excess enzymes sector changed from: ',...
num2str(oldconc),' g/g_CDW to ', num2str(EEPS_0_parameter),' g/g_CDW \n'])
end
end
%% change parameters of the excess enzymes sector
if ~isempty(subsRxnID) && ~isempty(subsUptakeMax)
% check if single or multiple substrates were supplied
if ischar(subsRxnID)
subsRxnID = {subsRxnID};
end
% check if excess enzymes sector exists
if ~isfield(opt,'excessEnzymesSector')
warning('There is no excess enzymes sector in the model')
elseif length(subsRxnID)~=length(subsUptakeMax)
% check if provided data is consistent
warning('Number of substrate uptake reaction IDs does not mach the number of substrate uptake rate values.')
else
% load parameter
EEPS_pos = find(strcmp(model_pa.mets,opt.excessEnzymesSector.cnstrID));
EEPS_0 = opt.excessEnzymesSector.EEPS_0;
% delete link to current substrate
for i=1:length(opt.excessEnzymesSector.subsRxnID)
model_pa.S(EEPS_pos,find(strcmp(model_pa.rxns,...
opt.excessEnzymesSector.subsRxnID{i}))) = 0;
model_pa = changeRxnBounds(model_pa,opt.excessEnzymesSector.subsRxnID{i},0,'b');
end
% add new substrates
subsRxnNum = [];
subsRxnID_s = {};
subsUptakeMax_s = [];
for i=1:length(subsRxnID)
if ~any(strcmp(model_pa.rxns,subsRxnID{i}))
warning(['Substrate uptake reaction ',subsRxnID{i},' not found in the model.'])
else
subsRxnNum(end+1,1) = find(strcmp(model_pa.rxns,subsRxnID{i}));
subsRxnID_s{end+1,1} = subsRxnID{i};
subsUptakeMax_s(end+1,1) = subsUptakeMax(i);
% change parameter
model_pa.S(EEPS_pos,subsRxnNum(end)) = (1000*EEPS_0)/subsUptakeMax(i);
% change reaction bounds
model_pa = changeRxnBounds(model_pa,subsRxnID{i},subsUptakeMax(i),'u');
% print
if printFlag
fprintf(['New substrate uptake reaction: ',subsRxnID{i},'\n'])
end
end
end
% save parameter
opt.excessEnzymesSector.subsRxnNum = subsRxnNum;
opt.excessEnzymesSector.subsRxnID = subsRxnID_s;
opt.excessEnzymesSector.subsUptakeMax = subsUptakeMax_s;
end
end
%% change protein concentration allocated to the translational sector at zero growth
if ~isempty(TPS_0_parameter)
% change parameter
model_pa.b(strcmp(model_pa.mets,opt.translationalSector.cnstrID)) ...
= TPS_0_parameter*1000;
% save new value
oldconc = opt.translationalSector.TPS_0;
opt.translationalSector.TPS_0 = TPS_0_parameter;
% print
if printFlag
fprintf(['Protein allocated to translational sector at zero growth changed from: ',...
num2str(oldconc),' g/g_CDW to ', num2str(TPS_0_parameter),' g/g_CDW \n'])
end
end
%% change slope of protein allocated to the translational sector
if ~isempty(TPS_mu_parameter)
% change parameter
model_pa.S(strcmp(model_pa.mets,opt.translationalSector.cnstrID), ...
strcmp(model_pa.rxns,opt.translationalSector.bmRxnID)) ...
= -TPS_mu_parameter*1000;
% save new value
oldconc = opt.translationalSector.TPS_mu;
opt.translationalSector.TPS_mu = TPS_mu_parameter;
% print
if printFlag
fprintf(['Protein allocation slope of translational sector changed from: ',...
num2str(oldconc),' g h/g_CDW to ', num2str(TPS_mu_parameter),' g h/g_CDW \n'])
end
end
% save new options file
model_pa.opt_pa = opt;
end