|
58 | 58 | else
|
59 | 59 | %% STEP 0.B. -- Create Base Model for GR Only
|
60 | 60 | % Here, I set up the model for the GR translocation dynamics.
|
61 |
| - fitOptions = optimset('Display','iter','MaxIter',300); |
| 61 | + fitOptions = optimset('Display','iter','MaxIter',200); |
62 | 62 |
|
63 | 63 | % Create blank SSIT model.
|
64 | 64 | ModelGR = SSIT;
|
|
115 | 115 | ModelGRparameterMap = cell(1,size(GRfitCases,1));
|
116 | 116 | ModelGRfit = cell(1,size(GRfitCases,1));
|
117 | 117 | % ModelGRODEfit = cell(1,size(GRfitCases,1));
|
| 118 | + |
| 119 | + % OLD GR DATA |
| 120 | + % ModelGRfit{1} = ModelGR.loadData("EricData/Gated_dataframe_Ron_020224_NormalizedGR_bins_Dex_Conc_1.csv",... |
| 121 | + % {'nucGR','normgrnuc';'cytGR','normgrcyt'}); |
| 122 | + % ModelGRfit{2} = ModelGR.loadData("EricData/Gated_dataframe_Ron_020224_NormalizedGR_bins_Dex_Conc_10.csv",... |
| 123 | + % {'nucGR','normgrnuc';'cytGR','normgrcyt'}); |
| 124 | + % ModelGRfit{3} = ModelGR.loadData("EricData/Gated_dataframe_Ron_020224_NormalizedGR_bins_Dex_Conc_100.csv",... |
| 125 | + % {'nucGR','normgrnuc';'cytGR','normgrcyt'}); |
| 126 | + |
| 127 | + % NEW GR DATA |
| 128 | + ModelGRfit{1} = ModelGR.loadData("EricData/GR_ALL_gated_with_CytoArea_and_normGR_Feb2825_03_dex_conc_1.csv",... |
| 129 | + {'nucGR','normGRnuc';'cytGR','normGRcyt'}); |
| 130 | + ModelGRfit{2} = ModelGR.loadData("EricData/GR_ALL_gated_with_CytoArea_and_normGR_Feb2825_03_dex_conc_10.csv",... |
| 131 | + {'nucGR','normGRnuc';'cytGR','normGRcyt'}); |
| 132 | + ModelGRfit{3} = ModelGR.loadData("EricData/GR_ALL_gated_with_CytoArea_and_normGR_Feb2825_03_dex_conc_100.csv",... |
| 133 | + {'nucGR','normGRnuc';'cytGR','normGRcyt'}); |
| 134 | + |
118 | 135 | for i=1:3
|
119 |
| - ModelGRfit{i} = ModelGR.loadData("EricData/GR_ALL_gated_with_CytoArea_and_normGR_Feb2825_03.csv",... %ModelGRfit{i} = ModelGR.loadData("EricData/Gated_dataframe_Ron_020224_NormalizedGR_bins.csv",... % |
120 |
| - {'nucGR','normGRnuc';'cytGR','normGRcyt'},... |
121 |
| - {'Dex_Conc',GRfitCases{i,2}}); |
| 136 | + % ModelGRfit{i} = ModelGR.loadData("EricData/Gated_dataframe_Ron_020224_NormalizedGR_bins.csv",... |
| 137 | + % {'nucGR','normgrnuc';'cytGR','normgrcyt'},... |
| 138 | + % {'Dex_Conc',GRfitCases{i,2}}); |
| 139 | + %ModelGRfit{i} = ModelGR.loadData("EricData/GR_ALL_gated_with_CytoArea_and_normGR_Feb2825_03.csv",{'nucGR','normGRnuc';'cytGR','normGRcyt'}, |
122 | 140 | ModelGRfit{i}.parameters(13,:) = {'Dex0', str2num(GRfitCases{i,1})};
|
123 | 141 | ModelGRparameterMap(i) = {(1:8)};
|
124 | 142 | % parameters 1 - 8 refer to the parameter set that is relevant to
|
|
159 | 177 |
|
160 | 178 | % STEP 1.C. -- Combine all three GR models and fit using a single parameter set.
|
161 | 179 | for jj = 1:fitIters
|
162 |
| - combinedGRModel = SSITMultiModel(ModelGRfit,ModelGRparameterMap,logPriorGR); |
163 |
| - combinedGRModel = combinedGRModel.initializeStateSpaces(boundGuesses); |
164 |
| - combinedGRModel = combinedGRModel.updateModels(GRpars,false); |
165 |
| - GRpars = combinedGRModel.maximizeLikelihood(... |
166 |
| - GRpars, fitOptions); |
167 |
| - save('EricModel_MMDex','GRpars') |
| 180 | + combinedGRModel = SSITMultiModel(ModelGRfit,ModelGRparameterMap,logPriorGR); |
| 181 | + combinedGRModel = combinedGRModel.initializeStateSpaces(boundGuesses); |
| 182 | + combinedGRModel = combinedGRModel.updateModels(GRpars,false); |
| 183 | + GRpars = combinedGRModel.maximizeLikelihood(GRpars, fitOptions); |
| 184 | + save('EricModel_MMDex','GRpars') |
168 | 185 | end
|
169 | 186 |
|
170 | 187 | save('EricModelGR_MMDex','GRpars','combinedGRModel', 'ModelGRfit', 'log10PriorStd')
|
|
213 | 230 | end
|
214 | 231 |
|
215 | 232 | %%
|
216 |
| -for i=1:3 |
217 |
| - combinedGRModel.SSITModels{i} = combinedGRModel.SSITModels{i}.loadData("EricData/GR_ALL_gated_with_CytoArea_and_normGR_Feb2825_03.csv",... |
218 |
| - {'nucGR','normGRnuc';'cytGR','normGRcyt'}); |
219 |
| -end |
| 233 | +% dex_conc_values = [1, 10, 100]; |
| 234 | +% |
| 235 | +% for i = 1:3 |
| 236 | +% % Load the full dataset first |
| 237 | +% fullData = readtable("EricData/GR_ALL_gated_with_CytoArea_and_normGR_Feb2825_03.csv"); |
| 238 | +% |
| 239 | +% % Filter based on dex_conc value |
| 240 | +% filteredData = fullData(fullData.dex_conc == dex_conc_values(i), :); |
| 241 | +% |
| 242 | +% % Save filtered data to a temporary file (optional if loadData can take a table directly) |
| 243 | +% tempFile = sprintf("temp_filtered_data_%d.csv", dex_conc_values(i)); |
| 244 | +% writetable(filteredData, tempFile); |
| 245 | +% |
| 246 | +% % Load the filtered data |
| 247 | +% combinedGRModel.SSITModels{i} = combinedGRModel.SSITModels{i}.loadData(tempFile, ... |
| 248 | +% {'nucGR','normGRnuc';'cytGR','normGRcyt'}); |
| 249 | +% end |
| 250 | + |
220 | 251 |
|
221 | 252 | %% STEP 1.F. -- Make Plots of GR Fit Results
|
222 | 253 | makeGRPlots(combinedGRModel,GRpars)
|
223 | 254 |
|
| 255 | + |
| 256 | +%combinedGRModel = combinedGRModel.updateModels(GRpars,false); |
| 257 | +%for i=1:length(ModelGRfit) |
| 258 | + % Update parameters in original models. |
| 259 | +% ModelGRfit{i} = combinedGRModel.SSITModels{i}; |
| 260 | +% ModelGRfit{i}.tSpan = sort(unique([ModelGRfit{i}.tSpan,linspace(0,180,30)])); |
| 261 | +% ModelGRfit{i}.makeFitPlot([],1,[],true,'STD') |
| 262 | +%end |
| 263 | + |
224 | 264 | save('EricModelGR_MMDex','GRpars','combinedGRModel','MHResultsGR')
|
225 |
| -save('workspaceMay4_2024.mat','GRpars', 'ModelGRfit', 'combinedGRModel','MHResultsGR', 'log10PriorStd', 'ModelGRparameterMap') |
| 265 | +save('workspaceMay4_2025.mat','GRpars', 'ModelGRfit', 'combinedGRModel','MHResultsGR', 'log10PriorStd', 'ModelGRparameterMap') |
226 | 266 |
|
227 | 267 | %% STEP 2 -- Extend Model to Include DUSP1 Activation, Production, and Degradation
|
228 | 268 | if loadPrevious
|
|
0 commit comments