Skip to content

Commit 0995c22

Browse files
committed
Add new GR data
1 parent 2e1d8ff commit 0995c22

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

WorkSpace/EricModel/GR_2_Electric_Boogaloo.m

+39-39
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,16 @@
8989

9090
%% TODO: clean up scattered data on contour plots
9191

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');
9393

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, :);
9696

9797
% Randomly sample 1000 points from the filtered data
9898
numSamples = min(1000, height(filteredData)); % Ensure we don’t sample more than available data
9999
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);
102102

103103
% Plot contourf figures and add scatter points
104104
for g=1:f
@@ -110,17 +110,17 @@
110110
subplot(1,3,1)
111111
contourf(log10(fspsoln_sptensor_a{g}))
112112
hold on
113-
scatter(normgrcyt, normgrnuc, 'r', 'filled') % Red dots
113+
scatter(normGRcyt, normGRnuc, 'r', 'filled') % Red dots
114114

115115
subplot(1,3,2)
116116
contourf(log10(fspsoln_sptensor_b{g}))
117117
hold on
118-
scatter(normgrcyt, normgrnuc, 'r', 'filled') % Red dots
118+
scatter(normGRcyt, normGRnuc, 'r', 'filled') % Red dots
119119

120120
subplot(1,3,3)
121121
contourf(log10(conv2solnTensor{g}))
122122
hold on
123-
scatter(normgrcyt, normgrnuc, 'r', 'filled') % Red dots
123+
scatter(normGRcyt, normGRnuc, 'r', 'filled') % Red dots
124124
end
125125

126126

@@ -150,17 +150,17 @@
150150
ModelGRfit_b = cell(1,1);
151151

152152
% 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'});
155155

156156
% ModelGRODEfit = cell(1,size(GRfitCases,1));
157157

158158
% Load data, fit 3 Dex concentrations to GR-alpha's 'Dex0' parameter,
159159
% and set solution scheme to FSP.
160160
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}});
164164
ModelGRfit_a{i}.parameters(9,:) = {'Dex0', str2num(GRfitCases{i,1})};
165165
ModelGRparameterMap_a(i) = {(1:8)};
166166
end
@@ -259,7 +259,7 @@
259259
% logLikelihood = sum(log(solnTensor(PAs>0)).*PAs((PAs>0)),"all");
260260

261261

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.
263263
for jj = 1:fitIters
264264
% Solve
265265
combinedGRModel_a = SSITMultiModel(ModelGRfit_a,ModelGRparameterMap_a,logPriorGR_a);
@@ -370,12 +370,12 @@
370370

371371
%% Convolution, contour plots, and scattered data
372372
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');
374374

375375
tspan = [0,10,30,50,75,150,180];
376376

377377
for model=1:size(GRfitCases,1)
378-
dataDex = data(data.Dex_Conc == str2double(GRfitCases{model}), :);
378+
dataDex = data(data.dex_conc == str2double(GRfitCases{model}), :);
379379
for t=1:max(numel(fspSolnsSMM(model).fsp),numel(GR_b_fspSoln.fsp))
380380
% Figure index
381381
figIndex = (model - 1) * 7 + t;
@@ -390,15 +390,15 @@
390390
tspan(t)
391391
end
392392
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);
395395

396396
% t is time point, so solution tensors are FSP probabilities across states for each time point
397397
conv2solnTensor_postData{t} = conv2(double(fspSolnsSMM(model).fsp{t}.p.data),double(GR_b_fspSoln.fsp{t}.p.data));
398398
figure(figIndex)
399399
contourf(log10(conv2solnTensor_postData{t}))
400400
hold on
401-
scatter(normgrcyt, normgrnuc, 'r', 'filled')
401+
scatter(normGRcyt, normGRnuc, 'r', 'filled')
402402

403403
% Add subplots (can be commented out)
404404
fspsoln_sptensor_a_postData{t} = double(fspSolnsSMM(model).fsp{t}.p.data);
@@ -407,36 +407,36 @@
407407
subplot(1,3,1)
408408
contourf(log10(fspsoln_sptensor_a_postData{t}))
409409
hold on
410-
scatter(normgrcyt, normgrnuc, 'r', 'filled') % Red dots
410+
scatter(normGRcyt, normGRnuc, 'r', 'filled') % Red dots
411411

412412
subplot(1,3,2)
413413
contourf(log10(fspsoln_sptensor_b_postData{t}))
414414
hold on
415-
scatter(normgrcyt, normgrnuc, 'r', 'filled') % Red dots
415+
scatter(normGRcyt, normGRnuc, 'r', 'filled') % Red dots
416416

417417
subplot(1,3,3)
418418
contourf(log10(conv2solnTensor_postData{t}))
419419
hold on
420-
scatter(normgrcyt, normgrnuc, 'r', 'filled') % Red dots
420+
scatter(normGRcyt, normGRnuc, 'r', 'filled') % Red dots
421421
end
422422
end
423423

424424
%% resample data if wanted
425425

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');
427427

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, :);
430430

431431
% Randomly sample 1000 points from the filtered data
432432
numSamples = min(1000, height(filteredData)); % Ensure we don’t sample more than available data
433433
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);
436436

437437
%% compute likelihood
438438

439-
normgr = [filteredData.normgrcyt,filteredData.normgrnuc];
439+
normgr = [filteredData.normGRcyt,filteredData.normGRnuc];
440440
for logL=1:max(size(conv2solnTensor_postData))
441441
logLikelihood = sum(log(conv2solnTensor_postData{logL}(normgr>0)).*normgr((normgr>0)),"all")
442442
end
@@ -504,7 +504,7 @@
504504
for i = 1:size(Dusp1FitCases,1)
505505
ModelDusp1Fit{i} = ModelGRDusp100nM.loadData('EricData/pdoCalibrationData_EricIntensity_DexSweeps.csv',...
506506
{'rna','totalNucRNA'},...
507-
{'Dex_Conc','100'});
507+
{'dex_conc','100'});
508508
ModelDusp1Fit{i}.inputExpressions = {'IDex','Dex0*exp(-gDex*t)'};
509509
ModelDusp1parameterMap{i} = (1:4);
510510
% Set Dex concentration.
@@ -515,7 +515,7 @@
515515

516516
%% Load data
517517
ModelGRDusp100nM = ModelGRDusp100nM.loadData('EricData/pdoCalibrationData_EricIntensity_DexSweeps.csv',...
518-
{'rna','RNA_DUSP1_nuc'},{'Dex_Conc','100'});
518+
{'rna','RNA_DUSP1_nuc'},{'dex_conc','100'});
519519
DUSP1pars = [ModelGRDusp100nM.parameters{ModelGRDusp100nM.fittingOptions.modelVarsToFit,2}];
520520

521521
%% Fit DUSP1 model at 100nM Dex.
@@ -634,7 +634,7 @@
634634
for i = 1:size(Dusp1FitCases,1)
635635
ModelDusp1Fit{i} = ModelGRDusp100nM.loadData('EricData/pdoCalibrationData_EricIntensity_DexSweeps.csv',...
636636
{'rna','totalNucRNA'},...
637-
{'Dex_Conc','100'});
637+
{'dex_conc','100'});
638638
ModelDusp1Fit{i}.inputExpressions = {'IDex','Dex0*exp(-gDex*t)'};
639639
ModelDusp1parameterMap{i} = (1:4);
640640
% Set Dex concentration.
@@ -645,7 +645,7 @@
645645

646646
%%
647647
ModelGRDusp100nM = ModelGRDusp100nM.loadData('EricData/pdoCalibrationData_EricIntensity_DexSweeps.csv',...
648-
{'rna','totalNucRNA'},{'Dex_Conc','100'});
648+
{'rna','totalNucRNA'},{'dex_conc','100'});
649649
DUSP1pars = [ModelGRDusp100nM.parameters{ModelGRDusp100nM.fittingOptions.modelVarsToFit,2}];
650650

651651
%% Fit DUSP1 model at 100nM Dex.
@@ -824,12 +824,12 @@
824824

825825
%% Load data into the model
826826
% 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'});
829829

830830
% 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'});
833833

834834
%% Switch solver to ODE and generate model codes
835835
ModelGR_a_ode.solutionScheme = 'ode'; % TODO: loop (right now just solve for 100nM Dex)
@@ -915,19 +915,19 @@
915915
% extendedMod0p3 = extendedMod.loadData('EricData/pdoCalibrationData_EricIntensity_DexSweeps.csv',...
916916
% {'rna','RNA_DUSP1_nuc'; ...
917917
% 'rCyt','RNA_DUSP1_cyto'},...
918-
% {'Dex_Conc','0.3'});
918+
% {'dex_conc','0.3'});
919919
% extendedMod0p3.parameters(13,:) = {'Dex0',0.3};
920920
%
921921
% extendedMod1 = extendedMod.loadData('EricData/pdoCalibrationData_EricIntensity_DexSweeps.csv',...
922922
% {'rna','RNA_DUSP1_nuc'; ...
923923
% 'rCyt','RNA_DUSP1_cyto'},...
924-
% {'Dex_Conc','1'});
924+
% {'dex_conc','1'});
925925
% extendedMod1.parameters(13,:) = {'Dex0',1.0};
926926
%
927927
% extendedMod10 = extendedMod.loadData('EricData/pdoCalibrationData_EricIntensity_DexSweeps.csv',...
928928
% {'rna','RNA_DUSP1_nuc'; ...
929929
% 'rCyt','RNA_DUSP1_cyto'},...
930-
% {'Dex_Conc','10'});
930+
% {'dex_conc','10'});
931931
% extendedMod10.parameters(13,:) = {'Dex0',10};
932932
%
933933
% plotODEresults(extendedMod1,extendedMod1.solve,ModelGRfit{1},501)

0 commit comments

Comments
 (0)