From e5c5f0dab2ae60181a30db9d5c89d1cb94428761 Mon Sep 17 00:00:00 2001 From: Munsky Date: Wed, 7 Feb 2024 17:57:13 -0700 Subject: [PATCH] Update formatting functions. --- WorkSpace/EricModel/EricModelDataFeb5e.mat | Bin 239 -> 239 bytes WorkSpace/EricModel/EricModelDusp1Feb06.mat | Bin 215 -> 215 bytes WorkSpace/EricModel/ReformatFigures.m | 295 ++++++++++++------ WorkSpace/EricModel/RonModelPipelineFeb05_B.m | 70 +++-- 4 files changed, 232 insertions(+), 133 deletions(-) diff --git a/WorkSpace/EricModel/EricModelDataFeb5e.mat b/WorkSpace/EricModel/EricModelDataFeb5e.mat index 64208107f2d03f44a6ea5ff22bffb43e20e87f6f..bb74df722daa0a884378ceacc35f67e52d0d4a50 100644 GIT binary patch delta 40 vcmaFQ_?~fsu|#-kih^5el7fP{f}y#Up`n$Dv4W9-k;%kB<%tPw6HBTA^+^k< delta 40 vcmaFQ_?~fsu|!B|s)Ac;l7fPnf}y3AshO3rp@NZtk;%kB<%tPw6HBTA_m2y{ diff --git a/WorkSpace/EricModel/EricModelDusp1Feb06.mat b/WorkSpace/EricModel/EricModelDusp1Feb06.mat index 146d803e9d5445a6717ee97b5d033f5b3707c150..4191ede4a0e23e1db583bf58b194996c6d8691b0 100644 GIT binary patch delta 40 vcmcc4c%5;Au|#-kih^5el7fP{f}y#Up^=r5k%Ezdk;%kB<%tPw6HAf-?ZgXT delta 40 ucmcc4c%5;Au|!B|s)Ac;l7fPnf{}rhp@o%^IgnvwGBHqjVglR5l4Jnyq6={V diff --git a/WorkSpace/EricModel/ReformatFigures.m b/WorkSpace/EricModel/ReformatFigures.m index bc203d8..0235eee 100644 --- a/WorkSpace/EricModel/ReformatFigures.m +++ b/WorkSpace/EricModel/ReformatFigures.m @@ -1,117 +1,214 @@ - -%% To generate GR plots -f1 = figure(3); -newFig = figure(105);clf -set(gcf,'Position',[1000 991 496 247]) -clf(newFig) -copyobj(get(f1,'children'), newFig); - -fn = figure(newFig); -h = gca; -% ch = get(gca,'Children'); -set(h,'Children',h.Children([1,3,4,2,5,6])) -h.Children(4).Visible = 'off' -h.Children(5).Visible = 'off' -h.Children(6).Visible = 'off' -leg = legend('','','','Model \mu \pm \sigma','Model \mu','Data \mu \pm \sigma ') -set(gca,'fontsize',16) -xlabel('') -title('') -set(gcf,'Name','Nuc GR Vs Time') - -%% -newFig = figure(106);clf -set(gcf,'Position',[1000 991 496 247]) -clf(newFig) -copyobj(get(f1,'children'), newFig); - -fn = figure(newFig); -get(newFig,'Name') -h = gca; -% ch = get(gca,'Children'); -set(h,'Children',h.Children([2,5,6,1,3,4])) -h.Children(4).Visible = 'off' -h.Children(5).Visible = 'off' -h.Children(6).Visible = 'off' -leg = legend('','','','Model \mu \pm \sigma','Model \mu','Data \mu \pm \sigma ') -set(gca,'fontsize',16) -xlabel('') -set(gcf,'Name','Cyt GR Vs Time') - -%% Cytoplasmic -f2 = figure(2); - -% Create a new figure -f2new = figure(107); clf -set(f2new,'Name','Nuclear GR Distributuions') -set(f2new,'Position',[1000 1039 1361 199]) -% Get handles of all subplots in the original figure -subplotHandles = findobj(f2, 'type', 'axes'); - -% Iterate over each subplot and copy its contents to the new figure -orderset = [7,6,5,4,3,2,1]; -for i2 = 1:length(orderset) - i = orderset(i2); - subplotHandle = subplotHandles(i); - - % Create new subplot in the new figure - ax = subplot(1, 7, i2, 'Parent', f2new); +%% To generate GR Nuc plots +origFigs = [3,7,11]; +titles = {'Nuc GR 1nM','Nuc GR 10nM','Nuc GR 100nM'}; +newFigs = [1001,1002,1003]; + +for idex = 1:3 + oldFig = figure(origFigs(idex)); + newFig = figure(newFigs(idex));clf + set(gcf,'Position',[1000 991 496 247]) - % Copy contents of the original subplot to the new subplot - copyobj(allchild(subplotHandle), ax); + copyobj(get(oldFig,'children'), newFig); + newFig = figure(newFig); + set(newFig,'Name',titles{idex}) + h = gca; + % ch = get(gca,'Children'); + set(h,'Children',h.Children([1,3,4,2,5,6])) + h.Children(4).Visible = 'off' + h.Children(5).Visible = 'off' + h.Children(6).Visible = 'off' + legend('','','','Model \mu \pm \sigma','Model \mu','Data \mu \pm \sigma ') + set(gca,'fontsize',16) + xlabel('') + title('') +end - if i2~=1 - ylabel('') - set(gca,'yticklabels',[]) - end +%% To generate GR Cyt plots +origFigs = [3,7,11]; +titles = {'Cyt GR 1nM','Cyt GR 10nM','Cyt GR 100nM'}; +newFigs = [1011,1012,1013]; - h = gca; - set(h,'Children',h.Children([1,2,3,4])) +for idex = 1:3 + oldFig = figure(origFigs(idex)); + newFig = figure(newFigs(idex));clf + set(gcf,'Position',[1000 991 496 247]) - h.Children(3).Visible = 'off' + copyobj(get(oldFig,'children'), newFig); + newFig = figure(newFig); + set(newFig,'Name',titles{idex}) + h = gca; + % ch = get(gca,'Children'); + set(h,'Children',h.Children([2,5,6,1,3,4])) h.Children(4).Visible = 'off' + h.Children(5).Visible = 'off' + h.Children(6).Visible = 'off' + legend('','','','Model \mu \pm \sigma','Model \mu','Data \mu \pm \sigma ') + set(gca,'fontsize',16) + xlabel('') + title('') +end + + +%% Nuclear Distributions +origFigs = [2,6,10]; +titles = {'Nuc GR 1nM','Nuc GR 10nM','Nuc GR 100nM'}; +newFigs = [1021,1022,1023]; + +for idex = 1:3 + oldFig = figure(origFigs(idex)); + newFig = figure(newFigs(idex));clf + set(newFig,'Position',[1000 1039 1361 199]) - set(gca,'xlim',[0,20],'ylim',[0,0.25],'FontSize',16) - % h.Children(6).Visible = 'off' + set(newFig,'Name',titles{idex}) + % Get handles of all subplots in the original figure + subplotHandles = findobj(oldFig, 'type', 'axes'); + % Iterate over each subplot and copy its contents to the new figure + orderset = [7,6,5,4,3,2,1]; + for i2 = 1:length(orderset) + i = orderset(i2); + subplotHandle = subplotHandles(i); + + % Create new subplot in the new figure + ax = subplot(1, 7, i2, 'Parent', newFig); + + % Copy contents of the original subplot to the new subplot + copyobj(allchild(subplotHandle), ax); + + if i2~=1 + ylabel('') + set(gca,'yticklabels',[]) + end + + h = gca; + set(h,'Children',h.Children([1,2,3,4])) + + grid on + + h.Children(3).Visible = 'off' + h.Children(4).Visible = 'off' + + set(gca,'xlim',[0,20],'ylim',[0,0.3],'FontSize',16) + % h.Children(6).Visible = 'off' + end end -%% Nuclear -f2 = figure(2); - -% Create a new figure -f2new = figure(108); clf -set(f2new,'Name','Cytoplasmic GR Distributuions') -set(f2new,'Position',[1000 1039 1361 199]) -% Get handles of all subplots in the original figure -subplotHandles = findobj(f2, 'type', 'axes'); - -% Iterate over each subplot and copy its contents to the new figure -orderset = [7,6,5,4,3,2,1]; -for i2 = 1:length(orderset) - i = orderset(i2); - subplotHandle = subplotHandles(i); - - % Create new subplot in the new figure - ax = subplot(1, 7, i2, 'Parent', f2new); - - % Copy contents of the original subplot to the new subplot - copyobj(allchild(subplotHandle), ax); +%% Cytoplasmic Distributions +origFigs = [2,6,10]; +titles = {'Cyt GR 1nM','Cyt GR 10nM','Cyt GR 100nM'}; +newFigs = [1031,1032,1033]; + +for idex = 1:3 + oldFig = figure(origFigs(idex)); + newFig = figure(newFigs(idex));clf + set(newFig,'Position',[1000 1039 1361 199]) + + set(newFig,'Name',titles{idex}) + % Get handles of all subplots in the original figure + subplotHandles = findobj(oldFig, 'type', 'axes'); - if i2~=1 - ylabel('') - set(gca,'yticklabels',[]) + % Iterate over each subplot and copy its contents to the new figure + orderset = [7,6,5,4,3,2,1]; + for i2 = 1:length(orderset) + i = orderset(i2); + subplotHandle = subplotHandles(i); + + % Create new subplot in the new figure + ax = subplot(1, 7, i2, 'Parent', newFig); + + % Copy contents of the original subplot to the new subplot + copyobj(allchild(subplotHandle), ax); + + if i2~=1 + ylabel('') + set(gca,'yticklabels',[]) + end + + h = gca; + set(h,'Children',h.Children([1,2,3,4])) + + grid on + + h.Children(1).Visible = 'off' + h.Children(2).Visible = 'off' + + set(gca,'xlim',[0,20],'ylim',[0,0.5],'FontSize',16) + % h.Children(6).Visible = 'off' end +end - h = gca; - set(h,'Children',h.Children([1,2,3,4])) +%% To generate Dusp1 means and variance plots +origFigs = [201,301,302,303]; +titles = {'Dusp1 100nM','Dusp1 GR 10nM','Nuc GR 1nM','Nuc GR 0.3nM'}; +newFigs = [1041,1042,1043,1044]; + +for idex = 1:4 + oldFig = figure(origFigs(idex)); + newFig = figure(newFigs(idex));clf + set(gcf,'Position',[1000 991 496 247]) - h.Children(1).Visible = 'off' - h.Children(2).Visible = 'off' + copyobj(get(oldFig,'children'), newFig); + newFig = figure(newFig); + set(newFig,'Name',titles{idex}) + h = gca; + legend('Model \mu \pm \sigma','Model \mu','Data \mu \pm \sigma ') + set(gca,'fontsize',16) + xlabel('') + title('') +end - set(gca,'xlim',[0,20],'ylim',[0,0.5],'FontSize',16) - % h.Children(6).Visible = 'off' +%% Dusp1 Distributions +origFigs = [221,321,322,323]; +titles = {'Dusp1 100nM','Dusp1 10nM','Dusp1 1nM','Dusp1 0.3nM'}; +newFigs = [1051,1052,1053,1054]; +oldFig100 = figure(221); +subplotHandles100 = findobj(oldFig100, 'type', 'axes'); +for idex = 1:4 + oldFig = figure(origFigs(idex)); + newFig = figure(newFigs(idex));clf + set(newFig,'Position',[1000 1039 1361 199]) + + set(newFig,'Name',titles{idex}) + % Get handles of all subplots in the original figure + subplotHandles = findobj(oldFig, 'type', 'axes'); + + % Iterate over each subplot and copy its contents to the new figure + if idex==1 + orderset = [12,10,9,8,6,4,1]; + else + orderset = [NaN,6,5,4,3,2,1]; + end + for i2 = 1:length(orderset) + i = orderset(i2); + if i2==1 + subplotHandle = subplotHandles100(12); + else + subplotHandle = subplotHandles(i); + end + + % Create new subplot in the new figure + ax = subplot(1, 7, i2, 'Parent', newFig); + + % Copy contents of the original subplot to the new subplot + copyobj(allchild(subplotHandle), ax); + + if i2~=1 + ylabel('') + set(gca,'yticklabels',[]) + end + + h = gca; + set(h,'Children',h.Children([1,2])) + + grid on + + % h.Children(1).Visible = 'off' + % h.Children(2).Visible = 'off' + + set(gca,'xlim',[0,200],'ylim',[0,0.2],'FontSize',16) + % h.Children(6).Visible = 'off' + end end diff --git a/WorkSpace/EricModel/RonModelPipelineFeb05_B.m b/WorkSpace/EricModel/RonModelPipelineFeb05_B.m index bb21099..df805c2 100644 --- a/WorkSpace/EricModel/RonModelPipelineFeb05_B.m +++ b/WorkSpace/EricModel/RonModelPipelineFeb05_B.m @@ -81,8 +81,8 @@ % drawnow % end %% Combine all three GR models and fit using a single parameter set. -for jj = 1:5 - fitOptions = optimset('Display','iter','MaxIter',500); +% for jj = 1:5 + fitOptions = optimset('Display','iter','MaxIter',5); combinedGRModel = SSITMultiModel(ModelGRfit,ModelGRparameterMap); combinedGRModel = combinedGRModel.initializeStateSpaces(boundGuesses); @@ -90,7 +90,7 @@ GRpars = combinedGRModel.maximizeLikelihood(... GRpars, fitOptions); save('EricModelDataFeb5e','GRpars') -end +% end %% Compute FIM % combinedGRModel = combinedGRModel.computeFIMs; @@ -168,8 +168,8 @@ DUSP1pars = [ModelDusp1Fit{i}.parameters{ModelGRDusp.fittingOptions.modelVarsToFit,2}]; %% Fit DUSP1 model(s) with single parameter set. -for i = 1:5 - fitOptions = optimset('Display','iter','MaxIter',500); +% for i = 1:5 + fitOptions = optimset('Display','iter','MaxIter',5); fitOptions.suppressFSPExpansion = true; combinedDusp1Model = SSITMultiModel(ModelDusp1Fit,ModelDusp1parameterMap); combinedDusp1Model = combinedDusp1Model.initializeStateSpaces({[0;0;0;2;2;400]}); @@ -177,7 +177,7 @@ DUSP1pars, fitOptions); ModelGRDusp.parameters(1:4,2) = num2cell(DUSP1pars); save('EricModelDusp1Feb06','DUSP1pars') -end +% end %% Sample uncertainty for Dusp1 Parameters % MHFitOptions.thin=1; @@ -192,7 +192,8 @@ %% Make Plots of DUSP1 FIT Results fignums = [211,221,201,231]; -combinedDusp1Model = combinedDusp1Model.updateModels(DUSP1pars,true,fignums); +combinedDusp1Model = combinedDusp1Model.updateModels(DUSP1pars,false,fignums); +ModelDusp1Fit{i}.makeFitPlot([],5,fignums) for i=1:size(Dusp1FitCases,1) figure(Dusp1FitCases{i,3}); set(gca,'ylim',[0,150]) @@ -322,30 +323,31 @@ xlabel('Time (min)') end - -%% Sandbox for Predicting Other Behaviors -SBModel = ModelGRDusp; -SBModel.parameters(12,:) = {'Dex0',100}; - -SBModel.tSpan = linspace(0,300,50); -SBModel.inputExpressions = {'IDex','Dex0*exp(-gDex*t)*(t>0)-Dex0*exp(-gDex*t)*(t>10)'}; -SBModel = SBModel.formPropensitiesGeneral('Pulse'); -[fspSoln] = SBModel.solve; -SBModel.makePlot(fspSoln,'meansAndDevs',[],[],[4]) - -SBModel2 = SBModel; -SBModel2.tSpan = linspace(0,300,50); -SBModel2.inputExpressions = {'IDex','Dex0*exp(-gDex*t)*(t>0)'}; -SBModel = SBModel.formPropensitiesGeneral('Step'); -[fspSoln2] = SBModel2.solve; -SBModel2.makePlot(fspSoln2,'meansAndDevs',[],[],[4]) - -%% -SBModelJoint = ModelGRDusp; -SBModelJoint.useHybrid = false; -SBModelJoint.fspOptions.verbose = true; -SBModelJoint = SBModelJoint.formPropensitiesGeneral('EricGRDusp1Joint'); -SBModelJoint.customConstraintFuns = {'x3+x4','x5/(x4+1)'}; -[fspSoln3] = SBModelJoint.solve; -SBModelJoint.makePlot(fspSoln3,'joints',[],[]) - +return + +% %% Sandbox for Predicting Other Behaviors +% SBModel = ModelGRDusp; +% SBModel.parameters(12,:) = {'Dex0',100}; +% +% SBModel.tSpan = linspace(0,300,50); +% SBModel.inputExpressions = {'IDex','Dex0*exp(-gDex*t)*(t>0)-Dex0*exp(-gDex*t)*(t>10)'}; +% SBModel = SBModel.formPropensitiesGeneral('Pulse'); +% [fspSoln] = SBModel.solve; +% SBModel.makePlot(fspSoln,'meansAndDevs',[],[],[4]) +% +% SBModel2 = SBModel; +% SBModel2.tSpan = linspace(0,300,50); +% SBModel2.inputExpressions = {'IDex','Dex0*exp(-gDex*t)*(t>0)'}; +% SBModel = SBModel.formPropensitiesGeneral('Step'); +% [fspSoln2] = SBModel2.solve; +% SBModel2.makePlot(fspSoln2,'meansAndDevs',[],[],[4]) +% +% %% +% SBModelJoint = ModelGRDusp; +% SBModelJoint.useHybrid = false; +% SBModelJoint.fspOptions.verbose = true; +% SBModelJoint = SBModelJoint.formPropensitiesGeneral('EricGRDusp1Joint'); +% SBModelJoint.customConstraintFuns = {'x3+x4','x5/(x4+1)'}; +% [fspSoln3] = SBModelJoint.solve; +% SBModelJoint.makePlot(fspSoln3,'joints',[],[]) +%