Skip to content

Commit ac3efa3

Browse files
committed
Fix bug in model constraints for Dusp1 model.
1 parent d71de53 commit ac3efa3

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

WorkSpace/EricModel/a0_Fit_GR_and_DUSP1_models.m

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
close all
1010
addpath(genpath('../../src'));
1111

12-
loadPrevious = true;
13-
savedWorkspace = 'workspaceJuly24';
12+
loadPrevious = false;
13+
savedWorkspace = 'workspaceOct22_2024';
1414
addpath('tmpPropensityFunctions');
1515

1616
%% STEP 0 -- Preliminaries.
@@ -88,7 +88,7 @@
8888
for i=1:3
8989
ModelGRfit{i} = ModelGR.loadData("EricData/Gated_dataframe_Ron_020224_NormalizedGR_bins.csv",...
9090
{'nucGR','normgrnuc';'cytGR','normgrcyt'},...
91-
{'Condition','GR_timesweep';'Dex_Conc',GRfitCases{i,2}});
91+
{'Dex_Conc',GRfitCases{i,2}});
9292
ModelGRfit{i}.parameters(13,:) = {'Dex0', str2num(GRfitCases{i,1})};
9393
ModelGRparameterMap(i) = {(1:8)};
9494
% parameters 1 - 8 refer to the parameter set that is relevant to
@@ -180,6 +180,7 @@
180180
ModelGRDusp100nM.useHybrid = true;
181181
ModelGRDusp100nM.hybridOptions.upstreamODEs = {'cytGR','nucGR'};
182182
ModelGRDusp100nM.solutionScheme = 'FSP';
183+
ModelGRDusp100nM.customConstraintFuns = [];
183184
ModelGRDusp100nM.fspOptions.bounds = [0;0;0;2;2;400];
184185
ModelGRDusp100nM.fittingOptions.modelVarsToFit = 1:4;
185186
ModelGRDusp100nM = ModelGRDusp100nM.formPropensitiesGeneral('EricModDusp1');
@@ -235,7 +236,6 @@
235236
%% STEP 2.D.2. -- Compute FIM
236237
% define which species in model are not observed.
237238
ModelGRDusp100nM.pdoOptions.unobservedSpecies = {'offGene';'onGene'};
238-
% TODO - Make this automated when you load data.
239239

240240
% compute the FIM
241241
fimResults = ModelGRDusp100nM.computeFIM(sensSoln.sens,'log');
@@ -262,7 +262,7 @@
262262
else
263263
MHFitOptions.proposalDistribution=@(x)mvnrnd(x,covFree);
264264
MHFitOptions.thin=1;
265-
MHFitOptions.numberOfSamples=10000;
265+
MHFitOptions.numberOfSamples=1000;
266266
MHFitOptions.burnIn=0;
267267
MHFitOptions.progress=true;
268268
MHFitOptions.numChains = 1;
@@ -545,7 +545,7 @@
545545
%'DUSP1parsIntensity'
546546
});
547547

548-
save('workspaceJuly24',varNames{:})
548+
save('workspaceOct22_2024',varNames{:})
549549

550550
%% Extra Function
551551

WorkSpace/EricModel/a1_Apply_PDO_to_DUSP1_data_and_model.m

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
addpath(genpath('../../src'));
66

77
loadPrevious = true;
8-
savedWorkspace = 'workspaceJuly24';
8+
savedWorkspace = 'workspaceOct22_2024';
99
addpath('tmpPropensityFunctions');
1010

11-
load('workspaceJuly24.mat');
11+
load(savedWorkspace);
1212

1313
figNew = figure;
1414

@@ -168,7 +168,7 @@
168168
DUSP1parsFIMDesign = ModelGRDusp100nM_FIMDesign.maximizeLikelihood(...
169169
DUSP1parsFIMDesign, fitOptions);
170170
ModelGRDusp100nM_FIMDesign.parameters(1:4,2) = num2cell(DUSP1parsFIMDesign);
171-
save('EricModelDusp1_MMDex','GRpars','DUSP1pars','DUSP1parsFIMDesign')
171+
save('EricModelDusp1_MMDex_PDO','GRpars','DUSP1pars','DUSP1parsFIMDesign')
172172
end
173173

174174
%% STEP XX.D.2. -- Plot fit and predicitons using FIM suggested conditions.
@@ -183,15 +183,15 @@
183183
ModelPDOIntensEric = ModelPDOIntensEric.loadData('EricData/pdoCalibrationData_EricIntensity_DexSweeps.csv',...
184184
{'rna','Nuc_DUSP1_avg_int_tot'},...
185185
{'Dex_Conc','100'});
186-
load('EricModelDusp1_MMDex','DUSP1parsIntensity')
186+
load('EricModelDusp1_MMDex_PDO','DUSP1parsIntensity')
187187

188188
ModelPDOIntensEric.parameters(1:4,2) = num2cell(DUSP1parsIntensity);
189189

190190
for i = 1:fitIters
191191
DUSP1parsIntensity = ModelPDOIntensEric.maximizeLikelihood(...
192192
DUSP1parsIntensity, fitOptions);
193193
ModelPDOIntensEric.parameters(1:4,2) = num2cell(DUSP1parsIntensity);
194-
save('EricModelDusp1_MMDex','GRpars','DUSP1pars','DUSP1parsFIMDesign','DUSP1parsIntensity','DUSP1parsFIMDesignIntensity')
194+
save('EricModelDusp1_MMDex_PDO','GRpars','DUSP1pars','DUSP1parsFIMDesign','DUSP1parsIntensity','DUSP1parsFIMDesignIntensity')
195195
end
196196
%% STEP XX.D.3.a. -- Plot predictions when fit to distorted data at ALL times.
197197
showCases = [1,1,1,1];
@@ -209,14 +209,14 @@
209209
% Set fitting routine only to consider the time points selected by the FIM.
210210
ModelPDOIntensEricFIM.fittingOptions.timesToFit = nCellsOpt>0;
211211
% Refit the model, but now with only those time points.
212-
load('EricModelDusp1_MMDex','DUSP1parsFIMDesignIntensity')
212+
load('EricModelDusp1_MMDex_PDO','DUSP1parsFIMDesignIntensity')
213213
ModelPDOIntensEricFIM.parameters(1:4,2) = num2cell(DUSP1parsFIMDesignIntensity);
214214

215215
for i = 1:5
216216
DUSP1parsFIMDesignIntensity = ModelPDOIntensEricFIM.maximizeLikelihood(...
217217
DUSP1parsFIMDesignIntensity, fitOptions);
218218
ModelPDOIntensEricFIM.parameters(1:4,2) = num2cell(DUSP1parsFIMDesignIntensity);
219-
save('EricModelDusp1_MMDex','GRpars','DUSP1pars','DUSP1parsFIMDesign','DUSP1parsFIMDesignIntensity')
219+
save('EricModelDusp1_MMDex_PDO','GRpars','DUSP1pars','DUSP1parsFIMDesign','DUSP1parsFIMDesignIntensity')
220220
end
221221
%% STEP XX.D.5.a. -- Plot predictions when fit to distorted data at FIM times.
222222
showCases = [1,1,1,1];

0 commit comments

Comments
 (0)