|
89 | 89 |
|
90 | 90 | %% TODO: clean up scattered data on contour plots
|
91 | 91 |
|
92 |
| - data = readtable('../EricModel/EricData/Gated_dataframe_Ron_020224_NormalizedGR_bins.csv'); |
| 92 | + data = readtable('../EricModel/EricData/GR_ALL_gated_with_CytoArea_and_normGR_Feb2825_03.csv'); |
93 | 93 |
|
94 |
| - % Filter the data if desired for particular Time_index and/or Dex_Conc |
95 |
| - filteredData = data(data.time == 180 & data.Dex_Conc == 100, :); |
| 94 | + % Filter the data if desired for particular Time_index and/or dex_conc |
| 95 | + filteredData = data(data.time == 180 & data.dex_conc == 100, :); |
96 | 96 |
|
97 | 97 | % Randomly sample 1000 points from the filtered data
|
98 | 98 | numSamples = min(1000, height(filteredData)); % Ensure we don’t sample more than available data
|
99 | 99 | randomIndices = randperm(height(filteredData), numSamples);
|
100 |
| - normgrnuc = filteredData.normgrnuc(randomIndices); |
101 |
| - normgrcyt = filteredData.normgrcyt(randomIndices); |
| 100 | + normGRnuc = filteredData.normGRnuc(randomIndices); |
| 101 | + normGRcyt = filteredData.normGRcyt(randomIndices); |
102 | 102 |
|
103 | 103 | % Plot contourf figures and add scatter points
|
104 | 104 | for g=1:f
|
|
110 | 110 | subplot(1,3,1)
|
111 | 111 | contourf(log10(fspsoln_sptensor_a{g}))
|
112 | 112 | hold on
|
113 |
| - scatter(normgrcyt, normgrnuc, 'r', 'filled') % Red dots |
| 113 | + scatter(normGRcyt, normGRnuc, 'r', 'filled') % Red dots |
114 | 114 |
|
115 | 115 | subplot(1,3,2)
|
116 | 116 | contourf(log10(fspsoln_sptensor_b{g}))
|
117 | 117 | hold on
|
118 |
| - scatter(normgrcyt, normgrnuc, 'r', 'filled') % Red dots |
| 118 | + scatter(normGRcyt, normGRnuc, 'r', 'filled') % Red dots |
119 | 119 |
|
120 | 120 | subplot(1,3,3)
|
121 | 121 | contourf(log10(conv2solnTensor{g}))
|
122 | 122 | hold on
|
123 |
| - scatter(normgrcyt, normgrnuc, 'r', 'filled') % Red dots |
| 123 | + scatter(normGRcyt, normGRnuc, 'r', 'filled') % Red dots |
124 | 124 | end
|
125 | 125 |
|
126 | 126 |
|
|
150 | 150 | ModelGRfit_b = cell(1,1);
|
151 | 151 |
|
152 | 152 | % Load data for GR-beta
|
153 |
| - ModelGRfit_b{1} = ModelGR_b.loadData("../EricModel/EricData/Gated_dataframe_Ron_020224_NormalizedGR_bins.csv",... |
154 |
| - {'nucGR_b','normgrnuc';'cytGR_b','normgrcyt'},{'Dex_Conc','100'}); |
| 153 | + ModelGRfit_b{1} = ModelGR_b.loadData("../EricModel/EricData/GR_ALL_gated_with_CytoArea_and_normGR_Feb2825_03.csv",... |
| 154 | + {'nucGR_b','normGRnuc';'cytGR_b','normGRcyt'},{'dex_conc','100'}); |
155 | 155 |
|
156 | 156 | % ModelGRODEfit = cell(1,size(GRfitCases,1));
|
157 | 157 |
|
158 | 158 | % Load data, fit 3 Dex concentrations to GR-alpha's 'Dex0' parameter,
|
159 | 159 | % and set solution scheme to FSP.
|
160 | 160 | for i=1:3
|
161 |
| - ModelGRfit_a{i} = ModelGR_a.loadData("../EricModel/EricData/Gated_dataframe_Ron_020224_NormalizedGR_bins.csv",... |
162 |
| - {'nucGR_a','normgrnuc';'cytGR_a','normgrcyt'},... |
163 |
| - {'Dex_Conc',GRfitCases{i,2}}); |
| 161 | + ModelGRfit_a{i} = ModelGR_a.loadData("../EricModel/EricData/GR_ALL_gated_with_CytoArea_and_normGR_Feb2825_03.csv",... |
| 162 | + {'nucGR_a','normGRnuc';'cytGR_a','normGRcyt'},... |
| 163 | + {'dex_conc',GRfitCases{i,2}}); |
164 | 164 | ModelGRfit_a{i}.parameters(9,:) = {'Dex0', str2num(GRfitCases{i,1})};
|
165 | 165 | ModelGRparameterMap_a(i) = {(1:8)};
|
166 | 166 | end
|
|
259 | 259 | % logLikelihood = sum(log(solnTensor(PAs>0)).*PAs((PAs>0)),"all");
|
260 | 260 |
|
261 | 261 |
|
262 |
| - %% Solve for combined GR-alpha model for three Dex_Conc=Dex0 and fit using a single parameter set. |
| 262 | + %% Solve for combined GR-alpha model for three dex_conc=Dex0 and fit using a single parameter set. |
263 | 263 | for jj = 1:fitIters
|
264 | 264 | % Solve
|
265 | 265 | combinedGRModel_a = SSITMultiModel(ModelGRfit_a,ModelGRparameterMap_a,logPriorGR_a);
|
|
370 | 370 |
|
371 | 371 | %% Convolution, contour plots, and scattered data
|
372 | 372 | load('combinedGR_a_fspSolns.mat')
|
373 |
| - data = readtable('../EricModel/EricData/Gated_dataframe_Ron_020224_NormalizedGR_bins.csv'); |
| 373 | + data = readtable('../EricModel/EricData/GR_ALL_gated_with_CytoArea_and_normGR_Feb2825_03.csv'); |
374 | 374 |
|
375 | 375 | tspan = [0,10,30,50,75,150,180];
|
376 | 376 |
|
377 | 377 | for model=1:size(GRfitCases,1)
|
378 |
| - dataDex = data(data.Dex_Conc == str2double(GRfitCases{model}), :); |
| 378 | + dataDex = data(data.dex_conc == str2double(GRfitCases{model}), :); |
379 | 379 | for t=1:max(numel(fspSolnsSMM(model).fsp),numel(GR_b_fspSoln.fsp))
|
380 | 380 | % Figure index
|
381 | 381 | figIndex = (model - 1) * 7 + t;
|
|
390 | 390 | tspan(t)
|
391 | 391 | end
|
392 | 392 | randomIndices = randperm(height(dataDexTime), numSamples);
|
393 |
| - normgrnuc = dataDexTime.normgrnuc(randomIndices); |
394 |
| - normgrcyt = dataDexTime.normgrcyt(randomIndices); |
| 393 | + normGRnuc = dataDexTime.normGRnuc(randomIndices); |
| 394 | + normGRcyt = dataDexTime.normGRcyt(randomIndices); |
395 | 395 |
|
396 | 396 | % t is time point, so solution tensors are FSP probabilities across states for each time point
|
397 | 397 | conv2solnTensor_postData{t} = conv2(double(fspSolnsSMM(model).fsp{t}.p.data),double(GR_b_fspSoln.fsp{t}.p.data));
|
398 | 398 | figure(figIndex)
|
399 | 399 | contourf(log10(conv2solnTensor_postData{t}))
|
400 | 400 | hold on
|
401 |
| - scatter(normgrcyt, normgrnuc, 'r', 'filled') |
| 401 | + scatter(normGRcyt, normGRnuc, 'r', 'filled') |
402 | 402 |
|
403 | 403 | % Add subplots (can be commented out)
|
404 | 404 | fspsoln_sptensor_a_postData{t} = double(fspSolnsSMM(model).fsp{t}.p.data);
|
|
407 | 407 | subplot(1,3,1)
|
408 | 408 | contourf(log10(fspsoln_sptensor_a_postData{t}))
|
409 | 409 | hold on
|
410 |
| - scatter(normgrcyt, normgrnuc, 'r', 'filled') % Red dots |
| 410 | + scatter(normGRcyt, normGRnuc, 'r', 'filled') % Red dots |
411 | 411 |
|
412 | 412 | subplot(1,3,2)
|
413 | 413 | contourf(log10(fspsoln_sptensor_b_postData{t}))
|
414 | 414 | hold on
|
415 |
| - scatter(normgrcyt, normgrnuc, 'r', 'filled') % Red dots |
| 415 | + scatter(normGRcyt, normGRnuc, 'r', 'filled') % Red dots |
416 | 416 |
|
417 | 417 | subplot(1,3,3)
|
418 | 418 | contourf(log10(conv2solnTensor_postData{t}))
|
419 | 419 | hold on
|
420 |
| - scatter(normgrcyt, normgrnuc, 'r', 'filled') % Red dots |
| 420 | + scatter(normGRcyt, normGRnuc, 'r', 'filled') % Red dots |
421 | 421 | end
|
422 | 422 | end
|
423 | 423 |
|
424 | 424 | %% resample data if wanted
|
425 | 425 |
|
426 |
| - data = readtable('../EricModel/EricData/Gated_dataframe_Ron_020224_NormalizedGR_bins.csv'); |
| 426 | + data = readtable('../EricModel/EricData/GR_ALL_gated_with_CytoArea_and_normGR_Feb2825_03.csv'); |
427 | 427 |
|
428 |
| - % Filter the data if desired for particular Time_index and/or Dex_Conc |
429 |
| - filteredData = data(data.time == 150 & data.Dex_Conc == 10, :); |
| 428 | + % Filter the data if desired for particular Time_index and/or dex_conc |
| 429 | + filteredData = data(data.time == 150 & data.dex_conc == 10, :); |
430 | 430 |
|
431 | 431 | % Randomly sample 1000 points from the filtered data
|
432 | 432 | numSamples = min(1000, height(filteredData)); % Ensure we don’t sample more than available data
|
433 | 433 | randomIndices = randperm(height(filteredData), numSamples);
|
434 |
| - normgrnuc = filteredData.normgrnuc(randomIndices); |
435 |
| - normgrcyt = filteredData.normgrcyt(randomIndices); |
| 434 | + normGRnuc = filteredData.normGRnuc(randomIndices); |
| 435 | + normGRcyt = filteredData.normGRcyt(randomIndices); |
436 | 436 |
|
437 | 437 | %% compute likelihood
|
438 | 438 |
|
439 |
| - normgr = [filteredData.normgrcyt,filteredData.normgrnuc]; |
| 439 | + normgr = [filteredData.normGRcyt,filteredData.normGRnuc]; |
440 | 440 | for logL=1:max(size(conv2solnTensor_postData))
|
441 | 441 | logLikelihood = sum(log(conv2solnTensor_postData{logL}(normgr>0)).*normgr((normgr>0)),"all")
|
442 | 442 | end
|
|
504 | 504 | for i = 1:size(Dusp1FitCases,1)
|
505 | 505 | ModelDusp1Fit{i} = ModelGRDusp100nM.loadData('EricData/pdoCalibrationData_EricIntensity_DexSweeps.csv',...
|
506 | 506 | {'rna','totalNucRNA'},...
|
507 |
| - {'Dex_Conc','100'}); |
| 507 | + {'dex_conc','100'}); |
508 | 508 | ModelDusp1Fit{i}.inputExpressions = {'IDex','Dex0*exp(-gDex*t)'};
|
509 | 509 | ModelDusp1parameterMap{i} = (1:4);
|
510 | 510 | % Set Dex concentration.
|
|
515 | 515 |
|
516 | 516 | %% Load data
|
517 | 517 | ModelGRDusp100nM = ModelGRDusp100nM.loadData('EricData/pdoCalibrationData_EricIntensity_DexSweeps.csv',...
|
518 |
| - {'rna','RNA_DUSP1_nuc'},{'Dex_Conc','100'}); |
| 518 | + {'rna','RNA_DUSP1_nuc'},{'dex_conc','100'}); |
519 | 519 | DUSP1pars = [ModelGRDusp100nM.parameters{ModelGRDusp100nM.fittingOptions.modelVarsToFit,2}];
|
520 | 520 |
|
521 | 521 | %% Fit DUSP1 model at 100nM Dex.
|
|
634 | 634 | for i = 1:size(Dusp1FitCases,1)
|
635 | 635 | ModelDusp1Fit{i} = ModelGRDusp100nM.loadData('EricData/pdoCalibrationData_EricIntensity_DexSweeps.csv',...
|
636 | 636 | {'rna','totalNucRNA'},...
|
637 |
| - {'Dex_Conc','100'}); |
| 637 | + {'dex_conc','100'}); |
638 | 638 | ModelDusp1Fit{i}.inputExpressions = {'IDex','Dex0*exp(-gDex*t)'};
|
639 | 639 | ModelDusp1parameterMap{i} = (1:4);
|
640 | 640 | % Set Dex concentration.
|
|
645 | 645 |
|
646 | 646 | %%
|
647 | 647 | ModelGRDusp100nM = ModelGRDusp100nM.loadData('EricData/pdoCalibrationData_EricIntensity_DexSweeps.csv',...
|
648 |
| - {'rna','totalNucRNA'},{'Dex_Conc','100'}); |
| 648 | + {'rna','totalNucRNA'},{'dex_conc','100'}); |
649 | 649 | DUSP1pars = [ModelGRDusp100nM.parameters{ModelGRDusp100nM.fittingOptions.modelVarsToFit,2}];
|
650 | 650 |
|
651 | 651 | %% Fit DUSP1 model at 100nM Dex.
|
|
824 | 824 |
|
825 | 825 | %% Load data into the model
|
826 | 826 | % Load data for GR-alpha
|
827 |
| - ModelGR_a_ode = ModelGR_a.loadData("../EricModel/EricData/Gated_dataframe_Ron_020224_NormalizedGR_bins.csv",... |
828 |
| - {'nucGR_a','normgrnuc';'cytGR_a','normgrcyt'},{'Dex_Conc','100'}); |
| 827 | + ModelGR_a_ode = ModelGR_a.loadData("../EricModel/EricData/GR_ALL_gated_with_CytoArea_and_normGR_Feb2825_03.csv",... |
| 828 | + {'nucGR_a','normGRnuc';'cytGR_a','normGRcyt'},{'dex_conc','100'}); |
829 | 829 |
|
830 | 830 | % Load data for GR-beta
|
831 |
| - ModelGR_b_ode = ModelGR_b.loadData("../EricModel/EricData/Gated_dataframe_Ron_020224_NormalizedGR_bins.csv",... |
832 |
| - {'nucGR_b','normgrnuc';'cytGR_b','normgrcyt'}); |
| 831 | + ModelGR_b_ode = ModelGR_b.loadData("../EricModel/EricData/GR_ALL_gated_with_CytoArea_and_normGR_Feb2825_03.csv",... |
| 832 | + {'nucGR_b','normGRnuc';'cytGR_b','normGRcyt'}); |
833 | 833 |
|
834 | 834 | %% Switch solver to ODE and generate model codes
|
835 | 835 | ModelGR_a_ode.solutionScheme = 'ode'; % TODO: loop (right now just solve for 100nM Dex)
|
|
915 | 915 | % extendedMod0p3 = extendedMod.loadData('EricData/pdoCalibrationData_EricIntensity_DexSweeps.csv',...
|
916 | 916 | % {'rna','RNA_DUSP1_nuc'; ...
|
917 | 917 | % 'rCyt','RNA_DUSP1_cyto'},...
|
918 |
| - % {'Dex_Conc','0.3'}); |
| 918 | + % {'dex_conc','0.3'}); |
919 | 919 | % extendedMod0p3.parameters(13,:) = {'Dex0',0.3};
|
920 | 920 | %
|
921 | 921 | % extendedMod1 = extendedMod.loadData('EricData/pdoCalibrationData_EricIntensity_DexSweeps.csv',...
|
922 | 922 | % {'rna','RNA_DUSP1_nuc'; ...
|
923 | 923 | % 'rCyt','RNA_DUSP1_cyto'},...
|
924 |
| - % {'Dex_Conc','1'}); |
| 924 | + % {'dex_conc','1'}); |
925 | 925 | % extendedMod1.parameters(13,:) = {'Dex0',1.0};
|
926 | 926 | %
|
927 | 927 | % extendedMod10 = extendedMod.loadData('EricData/pdoCalibrationData_EricIntensity_DexSweeps.csv',...
|
928 | 928 | % {'rna','RNA_DUSP1_nuc'; ...
|
929 | 929 | % 'rCyt','RNA_DUSP1_cyto'},...
|
930 |
| - % {'Dex_Conc','10'}); |
| 930 | + % {'dex_conc','10'}); |
931 | 931 | % extendedMod10.parameters(13,:) = {'Dex0',10};
|
932 | 932 | %
|
933 | 933 | % plotODEresults(extendedMod1,extendedMod1.solve,ModelGRfit{1},501)
|
|
0 commit comments