Format NCscurImCF_3parfor.m
This commit is contained in:
@@ -218,11 +218,8 @@ function [par4scanselIntensStd,par4scanselTimesStd,par4scanTimesELr,par4scanInte
|
|||||||
outCstd(ii,:)=resMatStd; %{ii, par4resMatStd};
|
outCstd(ii,:)=resMatStd; %{ii, par4resMatStd};
|
||||||
end
|
end
|
||||||
|
|
||||||
%*********************************19_1001***********************************
|
% To accomodate parfor
|
||||||
%To accomodate parfor copy par4scan thru global p4 functions inside of
|
% Copy par4scan thru global p4 functions inside of parfor loop --then outside to par4Gbl_Main8b.m
|
||||||
%parfor loop --then outside to par4Gbl_Main8b.m
|
|
||||||
|
|
||||||
%**************************************************************************
|
|
||||||
fileExt='.txt';
|
fileExt='.txt';
|
||||||
filePrefix='FitResultsComplete_';
|
filePrefix='FitResultsComplete_';
|
||||||
fileNamePlate=[filePrefix fileSuffix fileExt];
|
fileNamePlate=[filePrefix fileSuffix fileExt];
|
||||||
|
|||||||
@@ -1,25 +1,18 @@
|
|||||||
%% CALLED BY NCfitImCFparforFailGbl2.m %%
|
%% CALLED BY NCfitImCFparforFailGbl2.m %%
|
||||||
function [resMatStd, resMat, selTimesStd, selIntensStd, FiltTimesELr, NormIntensELr] =...
|
function [resMatStd, resMat, selTimesStd, selIntensStd, FiltTimesELr, NormIntensELr] =...
|
||||||
NCscurImCF_3parfor(dataMatrix, AUCfinalTime, currSpotArea, sols, bl, minTime)
|
NCscurImCF_3parfor(dataMatrix, AUCfinalTime, currSpotArea, sols, bl, minTime)
|
||||||
%Major revision for Early-Late data cuts to improve accuracof 'r'. Removed legacy iterative method.
|
|
||||||
%Significant Modification for Parfor
|
|
||||||
%***************************************************************
|
|
||||||
|
|
||||||
%##########################################################################
|
|
||||||
%******************************************* New Stage 1***************************************************************
|
|
||||||
% Preallocate
|
% Preallocate
|
||||||
resMatStd=zeros(1,27);
|
resMatStd=zeros(1,27);
|
||||||
resMat=zeros(1,27);
|
resMat=zeros(1,27);
|
||||||
% Set internal variables sent to matlab fit function
|
% Set internal variables sent to matlab fit function
|
||||||
me=200;
|
me=200;
|
||||||
meL=750;
|
meL=750;
|
||||||
mi=25; %50
|
mi=25;
|
||||||
miL=250;
|
miL=250;
|
||||||
%***********************************
|
|
||||||
rmsStg1=0;
|
rmsStg1=0;
|
||||||
rmsStg1I(1)=0;
|
rmsStg1I(1)=0;
|
||||||
slps=1;
|
slps=1;
|
||||||
|
|
||||||
filterTimes=[];
|
filterTimes=[];
|
||||||
normIntens=[];
|
normIntens=[];
|
||||||
nn=1;
|
nn=1;
|
||||||
@@ -33,28 +26,17 @@ for n=1:size(dataMatrix,2)
|
|||||||
nn=nn+1;
|
nn=nn+1;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
%------------------------------------------------------------------
|
|
||||||
|
|
||||||
%++++++++++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
filterTimes=filterTimes';
|
filterTimes=filterTimes';
|
||||||
selTimesStd=filterTimes;
|
selTimesStd=filterTimes;
|
||||||
normIntens=normIntens';
|
normIntens=normIntens';
|
||||||
selIntensStd=normIntens;
|
selIntensStd=normIntens;
|
||||||
|
|
||||||
%normIntens %debugging parfor gbl 200330 good values
|
|
||||||
%afgj
|
|
||||||
|
|
||||||
lastTptUsed=1;
|
lastTptUsed=1;
|
||||||
lastIntensUsed=1;
|
lastIntensUsed=1;
|
||||||
thresGT2TmStd=0;
|
thresGT2TmStd=0;
|
||||||
try
|
try
|
||||||
|
|
||||||
lastTptUsed=max(filterTimes);
|
lastTptUsed=max(filterTimes);
|
||||||
lastIntensUsed=normIntens(length(normIntens));
|
lastIntensUsed=normIntens(length(normIntens));
|
||||||
lastIntensUsedStd=lastIntensUsed;
|
lastIntensUsedStd=lastIntensUsed;
|
||||||
|
|
||||||
lastTptUsedStd=lastTptUsed;
|
lastTptUsedStd=lastTptUsed;
|
||||||
Tpt1Std=filterTimes(1);
|
Tpt1Std=filterTimes(1);
|
||||||
numFitTptsStd=nnz((normIntens(:)>=0)==1);
|
numFitTptsStd=nnz((normIntens(:)>=0)==1);
|
||||||
@@ -67,12 +49,12 @@ selIntensStd=normIntens;
|
|||||||
numTptsGT2Std=nnz((normIntens(:)>=2)==1); % nnz(filterTimes(find(filterTimes>=thresGT2Tm)));
|
numTptsGT2Std=nnz((normIntens(:)>=2)==1); % nnz(filterTimes(find(filterTimes>=thresGT2Tm)));
|
||||||
K_Guess=max(normIntens);
|
K_Guess=max(normIntens);
|
||||||
numTimePts=length(filterTimes);
|
numTimePts=length(filterTimes);
|
||||||
opts = fitoptions('Method','Nonlinear','Robust','On',...
|
opts=fitoptions('Method','Nonlinear','Robust','On','DiffMinChange',1.0E-11,'DiffMaxChange',0.001,...
|
||||||
'DiffMinChange',1.0E-11,'DiffMaxChange',0.001,...
|
'MaxFunEvals',me, 'MaxIter', mi, 'TolFun', 1.0E-12, 'TolX', 1.0E-10, 'Lower', [K_Guess*0.5,0,0],...
|
||||||
'MaxFunEvals',me, 'MaxIter', mi, 'TolFun', 1.0E-12, 'TolX', 1.0E-10, 'Lower', [K_Guess*0.5,0,0], 'StartPoint', [K_Guess,filterTimes(floor(numTimePts/2)),0.30], 'Upper', [K_Guess*2.0,max(filterTimes),1.0],'Display','off');
|
'StartPoint', [K_Guess,filterTimes(floor(numTimePts/2)),0.30], 'Upper', [K_Guess*2.0,max(filterTimes),1.0],'Display','off');
|
||||||
ftype=fittype('K / (1 + exp(-r* (t - l )))','independent','t','dependent',['K','r','l'],'options',opts);
|
ftype=fittype('K / (1 + exp(-r* (t - l )))','independent','t','dependent',['K','r','l'],'options',opts);
|
||||||
|
|
||||||
% carry out the curve fitting process
|
% Carry out the curve fitting process
|
||||||
[fitObject, errObj]=fit(filterTimes,normIntens,ftype);
|
[fitObject, errObj]=fit(filterTimes,normIntens,ftype);
|
||||||
coeffsArray=coeffvalues(fitObject);
|
coeffsArray=coeffvalues(fitObject);
|
||||||
rmsStg1=errObj.rsquare;
|
rmsStg1=errObj.rsquare;
|
||||||
@@ -82,17 +64,15 @@ selIntensStd=normIntens;
|
|||||||
l=coeffsArray(2); sDat(slps,3)=coeffsArray(2); % lag time
|
l=coeffsArray(2); sDat(slps,3)=coeffsArray(2); % lag time
|
||||||
r=coeffsArray(3); sDat(slps,4)=coeffsArray(3); % rateS
|
r=coeffsArray(3); sDat(slps,4)=coeffsArray(3); % rateS
|
||||||
|
|
||||||
% integrate (from first to last time point)
|
% Integrate (from first to last time point)
|
||||||
numVals=size(filterTimes);
|
numVals=size(filterTimes);
|
||||||
numVals=numVals(1);
|
numVals=numVals(1);
|
||||||
t_begin=0;
|
t_begin=0;
|
||||||
t_end=AUCfinalTime;
|
t_end=AUCfinalTime;
|
||||||
AUC=(K/r*log(1+exp(-r*(t_end-l)))-K/r*log(exp(-r*(t_end-l)))) - (K/r*log(1+exp(-r*(t_begin-l)))-K/r*log(exp(-r*(t_begin-l))));
|
AUC=(K/r*log(1+exp(-r*(t_end-l)))-K/r*log(exp(-r*(t_end-l)))) - (K/r*log(1+exp(-r*(t_begin-l)))-K/r*log(exp(-r*(t_begin-l))));
|
||||||
MSR=r;
|
MSR=r;
|
||||||
|
|
||||||
rsquare=errObj.rsquare;
|
rsquare=errObj.rsquare;
|
||||||
confObj=confint(fitObject,0.9); % get the 90% confidence
|
confObj=confint(fitObject,0.9); % get the 90% confidence
|
||||||
|
|
||||||
NANcond=0; stdNANcond=0; % stdNANcond added to relay not to attempt ELr as there is no curve to find critical point
|
NANcond=0; stdNANcond=0; % stdNANcond added to relay not to attempt ELr as there is no curve to find critical point
|
||||||
confObj_filtered=confObj;
|
confObj_filtered=confObj;
|
||||||
Klow=confObj(1,1); sDat(slps,5)=confObj(1,1);
|
Klow=confObj(1,1); sDat(slps,5)=confObj(1,1);
|
||||||
@@ -104,34 +84,22 @@ selIntensStd=normIntens;
|
|||||||
if(isnan(Klow)||isnan(Kup)||isnan(llow)||isnan(lup)||isnan(rlow)||isnan(rup))
|
if(isnan(Klow)||isnan(Kup)||isnan(llow)||isnan(lup)||isnan(rlow)||isnan(rup))
|
||||||
NANcond=1; stdNANcond=1; % stdNANcond added to relay not to attempt ELr as there is no curve to find critical point
|
NANcond=1; stdNANcond=1; % stdNANcond added to relay not to attempt ELr as there is no curve to find critical point
|
||||||
end
|
end
|
||||||
|
catch ME
|
||||||
%rup %debugging parfor gbl 200330
|
|
||||||
%Klow
|
|
||||||
%asdfjj114
|
|
||||||
% {
|
|
||||||
catch %ME
|
|
||||||
% if no data is given, return zeros
|
% if no data is given, return zeros
|
||||||
AUC=0;MSR=0;K=0;r=0;l=0;rsquare=0;Klow=0;Kup=0;
|
AUC=0;MSR=0;K=0;r=0;l=0;rsquare=0;Klow=0;Kup=0;
|
||||||
rlow=0;rup=0;lup=0;llow=0;
|
rlow=0;rup=0;lup=0;llow=0;
|
||||||
NANcond=1; stdNANcond=1; %stdNANcond added to relay not to attempt ELr as there is no curve to find critical point
|
NANcond=1; stdNANcond=1; %stdNANcond added to relay not to attempt ELr as there is no curve to find critical point
|
||||||
end %end Try
|
end
|
||||||
%}
|
|
||||||
if (exist('K','var')&& exist('r','var') && exist('l','var'))
|
if (exist('K','var')&& exist('r','var') && exist('l','var'))
|
||||||
t=(0:1:200);
|
t=(0:1:200);
|
||||||
Growth=K ./ (1 + exp(-r.* (t - l )));
|
Growth=K ./ (1 + exp(-r.* (t - l )));
|
||||||
fitblStd= min(Growth); %jh diag
|
fitblStd=min(Growth);
|
||||||
end
|
end
|
||||||
|
|
||||||
cutTm(1:4)=1000; %-1 means cuts not used or NA
|
cutTm(1:4)=1000; %-1 means cuts not used or NA
|
||||||
%{
|
|
||||||
l %debugging parfor
|
|
||||||
K
|
|
||||||
r
|
|
||||||
Klow
|
|
||||||
k
|
|
||||||
%}
|
|
||||||
%***Preserve for ResultsStd+++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
|
% Preserve for ResultsStd
|
||||||
resMatStd(1)=AUC;
|
resMatStd(1)=AUC;
|
||||||
resMatStd(2)=MSR;
|
resMatStd(2)=MSR;
|
||||||
resMatStd(3)=K;
|
resMatStd(3)=K;
|
||||||
@@ -147,18 +115,12 @@ resMatStd(12)= lup;
|
|||||||
resMatStd(13)=currSpotArea;
|
resMatStd(13)=currSpotArea;
|
||||||
resMatStd(14)=lastIntensUsedStd; % filtNormIntens(length(filtNormIntens));
|
resMatStd(14)=lastIntensUsedStd; % filtNormIntens(length(filtNormIntens));
|
||||||
|
|
||||||
%spline fit unneccessary and removed;therefore No maxRateTime assoc'd w/spline fit
|
|
||||||
%try
|
|
||||||
%resMatStd(15)= maxRateTime;
|
|
||||||
%catch
|
|
||||||
maxRateTime=0; %[]; %Std shows []; ELr shows 0; %parfor
|
maxRateTime=0; %[]; %Std shows []; ELr shows 0; %parfor
|
||||||
resMatStd(15)=0; %maxRateTimestdMeth;
|
resMatStd(15)=0; %maxRateTimestdMeth;
|
||||||
%end
|
|
||||||
|
|
||||||
|
resMatStd(16)=lastTptUsedStd;
|
||||||
resMatStd(16)= lastTptUsedStd; %filterTimes(length(filterTimes));
|
|
||||||
if isempty(Tpt1Std)
|
if isempty(Tpt1Std)
|
||||||
Tpt1Std= 777; %0.000002; %
|
Tpt1Std=777;
|
||||||
end
|
end
|
||||||
resMatStd(17)=Tpt1Std;
|
resMatStd(17)=Tpt1Std;
|
||||||
resMatStd(18)=bl; %perform in the filter section of NCfitImCFparfor
|
resMatStd(18)=bl; %perform in the filter section of NCfitImCFparfor
|
||||||
@@ -167,13 +129,11 @@ resMatStd(20)= minTime; %Not affected by changes made in NCscur...for refined 'r
|
|||||||
resMatStd(21)=thresGT2TmStd;
|
resMatStd(21)=thresGT2TmStd;
|
||||||
resMatStd(22)=numFitTptsStd;
|
resMatStd(22)=numFitTptsStd;
|
||||||
resMatStd(23)=numTptsGT2Std;
|
resMatStd(23)=numTptsGT2Std;
|
||||||
|
|
||||||
resMatStd(24)=999; %The Standard method has no cuts .:.no cutTm
|
resMatStd(24)=999; %The Standard method has no cuts .:.no cutTm
|
||||||
resMatStd(25)=999;
|
resMatStd(25)=999;
|
||||||
resMatStd(26)=999;
|
resMatStd(26)=999;
|
||||||
resMatStd(27)=999;
|
resMatStd(27)=999;
|
||||||
|
|
||||||
|
|
||||||
%if SwitchEvsEL==3 %Remove 'SwitchEvsEL==...' temporary SWITCH when Hartman decides what he wants
|
%if SwitchEvsEL==3 %Remove 'SwitchEvsEL==...' temporary SWITCH when Hartman decides what he wants
|
||||||
%*********************************************************************************
|
%*********************************************************************************
|
||||||
%ELr New Experimental data through L+deltaS Logistic fit for 'Improved r' Fitting
|
%ELr New Experimental data through L+deltaS Logistic fit for 'Improved r' Fitting
|
||||||
@@ -199,17 +159,13 @@ rsTmStd= LL-tc1; %%riseTime (first critical point to L)
|
|||||||
deltS=rsTmStd/2;
|
deltS=rsTmStd/2;
|
||||||
tc1Early=tc1-deltS; %AKA- tc1AdjTm %2*tc1 -LL
|
tc1Early=tc1-deltS; %AKA- tc1AdjTm %2*tc1 -LL
|
||||||
L_Late=LL+deltS;
|
L_Late=LL+deltS;
|
||||||
|
|
||||||
|
|
||||||
tc1EdatPt=find(filterTimes>(tc1Early),1,'first');
|
tc1EdatPt=find(filterTimes>(tc1Early),1,'first');
|
||||||
cutTm(1)=filterTimes(2);
|
cutTm(1)=filterTimes(2);
|
||||||
cutDatNum(1)=2;
|
cutDatNum(1)=2;
|
||||||
cutTm(2)=tc1Early;
|
cutTm(2)=tc1Early;
|
||||||
cutDatNum(2)=tc1EdatPt-1;
|
cutDatNum(2)=tc1EdatPt-1;
|
||||||
|
|
||||||
L_LDatPt=find(filterTimes< L_Late,1,'last');
|
L_LDatPt=find(filterTimes< L_Late,1,'last');
|
||||||
tc2LdatPt=find(filterTimes< tc2+rsTmStd,1,'last');
|
tc2LdatPt=find(filterTimes< tc2+rsTmStd,1,'last');
|
||||||
|
|
||||||
cutTm(3)=L_Late;
|
cutTm(3)=L_Late;
|
||||||
cutDatNum(3)=L_LDatPt;
|
cutDatNum(3)=L_LDatPt;
|
||||||
|
|
||||||
@@ -222,19 +178,16 @@ tms=[];
|
|||||||
tms(1:L_LDatPt-tc1EdatPt+2)=(stdTimes(L_LDatPt));
|
tms(1:L_LDatPt-tc1EdatPt+2)=(stdTimes(L_LDatPt));
|
||||||
tms(2:end)=stdTimes(tc1EdatPt:L_LDatPt);
|
tms(2:end)=stdTimes(tc1EdatPt:L_LDatPt);
|
||||||
tms(1)=stdTimes(1);
|
tms(1)=stdTimes(1);
|
||||||
%-----------------------------------------------
|
|
||||||
%Include/Keep late data that define K *********
|
% Include/Keep late data that define K
|
||||||
if length(tmpIntens(tc2LdatPt:end))> 4
|
if length(tmpIntens(tc2LdatPt:end))> 4
|
||||||
KlastInts=tmpIntens(tc2LdatPt:end);
|
KlastInts=tmpIntens(tc2LdatPt:end);
|
||||||
KlastTms=stdTimes(tc2LdatPt:end);
|
KlastTms=stdTimes(tc2LdatPt:end);
|
||||||
lengthKlast=length(tmpIntens(tc2LdatPt:end));
|
lengthKlast=length(tmpIntens(tc2LdatPt:end));
|
||||||
ints(end:(end+ lengthKlast-1))=KlastInts;
|
ints(end:(end+ lengthKlast-1))=KlastInts;
|
||||||
tms(end:(end+ lengthKlast-1 ))=KlastTms;
|
tms(end:(end+ lengthKlast-1 ))=KlastTms;
|
||||||
|
|
||||||
cutTm(4)=tc2+rsTmStd;
|
cutTm(4)=tc2+rsTmStd;
|
||||||
cutDatNum(4)=tc2LdatPt-1;
|
cutDatNum(4)=tc2LdatPt-1;
|
||||||
|
|
||||||
|
|
||||||
else
|
else
|
||||||
lengthKlast=length(tmpIntens(tc2LdatPt-1:end));
|
lengthKlast=length(tmpIntens(tc2LdatPt-1:end));
|
||||||
if lengthKlast>1
|
if lengthKlast>1
|
||||||
@@ -243,26 +196,18 @@ else
|
|||||||
ints(end:(end+ lengthKlast-1 ))=KlastInts;
|
ints(end:(end+ lengthKlast-1 ))=KlastInts;
|
||||||
tms(end:(end+ lengthKlast-1 ))=KlastTms;
|
tms(end:(end+ lengthKlast-1 ))=KlastTms;
|
||||||
end
|
end
|
||||||
|
|
||||||
cutTm(4)=stdTimes(tc2LdatPt-1);
|
cutTm(4)=stdTimes(tc2LdatPt-1);
|
||||||
cutDatNum(4)=tc2LdatPt-2; %length(stdTimes(end-(lengthKlast-1):end));
|
cutDatNum(4)=tc2LdatPt-2; %length(stdTimes(end-(lengthKlast-1):end));
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
%************************************************
|
|
||||||
Ints=[];
|
Ints=[];
|
||||||
Tms=[];
|
Tms=[];
|
||||||
Ints=ints';
|
Ints=ints';
|
||||||
Tms=tms';
|
Tms=tms';
|
||||||
|
|
||||||
try
|
try
|
||||||
filterTimes=Tms; filterTimes4=Tms;
|
filterTimes=Tms; filterTimes4=Tms;
|
||||||
normIntens=Ints; normIntens4=Ints;
|
normIntens=Ints; normIntens4=Ints;
|
||||||
|
|
||||||
%----------------------------------------------------------------------------------------------
|
% Classic symmetric logistic curve fit setup restated as COMMENTS for reference convenience
|
||||||
|
|
||||||
%classic symetric logistic curve fit setup restated as COMMENTS for reference convenience----------------------------
|
|
||||||
% opts=fitoptions is the same as for Std and so is redundant
|
% opts=fitoptions is the same as for Std and so is redundant
|
||||||
% opts=fitoptions('Method','Nonlinear','Robust','On',...
|
% opts=fitoptions('Method','Nonlinear','Robust','On',...
|
||||||
% 'DiffMinChange',1.0E-11,'DiffMaxChange',0.001,...
|
% 'DiffMinChange',1.0E-11,'DiffMaxChange',0.001,...
|
||||||
@@ -280,29 +225,25 @@ try
|
|||||||
GrowthELr = K ./ (1 + exp(-r.* (t - l )));
|
GrowthELr = K ./ (1 + exp(-r.* (t - l )));
|
||||||
fitblELr= min(GrowthELr); %jh diag
|
fitblELr= min(GrowthELr); %jh diag
|
||||||
end
|
end
|
||||||
|
|
||||||
catch ME
|
catch ME
|
||||||
% if no data is given, return zeros
|
% if no data is given, return zeros
|
||||||
AUC = 0;MSR = 0;K = 0;r = 0;l = 0;rsquare = 0;Klow = 0;Kup = 0;
|
AUC = 0;MSR = 0;K = 0;r = 0;l = 0;rsquare = 0;Klow = 0;Kup = 0;
|
||||||
rlow = 0;rup = 0;lup = 0;llow = 0; %normIntens=[];
|
rlow = 0;rup = 0;lup = 0;llow = 0; %normIntens=[];
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end %end Try
|
|
||||||
|
|
||||||
end %if stdNANcond=0
|
|
||||||
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
% Update values if r is better(higher) with removal of early data
|
% Update values if r is better(higher) with removal of early data
|
||||||
try
|
try
|
||||||
if r3>r && stdNANcond==0
|
if r3>r && stdNANcond==0
|
||||||
r=r3; sDat(slps,4)=sDat(slps,4); % rateS
|
r=r3; sDat(slps,4)=sDat(slps,4); % rateS
|
||||||
K=coeffsArray(1); sDat(slps,2)=coeffsArray(1); % Carrying Capacity
|
K=coeffsArray(1); sDat(slps,2)=coeffsArray(1); % Carrying Capacity
|
||||||
l=coeffsArray(2); sDat(slps,3)=coeffsArray(2); % lag time
|
l=coeffsArray(2); sDat(slps,3)=coeffsArray(2); % lag time
|
||||||
|
|
||||||
coeffsArray=coeffvalues(fitObject);
|
coeffsArray=coeffvalues(fitObject);
|
||||||
rmsStg1=errObj.rsquare;
|
rmsStg1=errObj.rsquare;
|
||||||
rmsStg1I(slps)=errObj.rsquare;
|
rmsStg1I(slps)=errObj.rsquare;
|
||||||
sDat(slps,1)=errObj.rsquare;
|
sDat(slps,1)=errObj.rsquare;
|
||||||
|
|
||||||
%jh diagnostics*************
|
% JH diagnostics
|
||||||
numFitTpts=nnz((normIntens(:)>=0)==1);
|
numFitTpts=nnz((normIntens(:)>=0)==1);
|
||||||
thresGT2=find(((normIntens(:)>2)==1), 1);
|
thresGT2=find(((normIntens(:)>2)==1), 1);
|
||||||
thresGT2Tm=filterTimes(thresGT2);
|
thresGT2Tm=filterTimes(thresGT2);
|
||||||
@@ -311,12 +252,9 @@ try
|
|||||||
|
|
||||||
AUC=(K/r*log(1+exp(-r*(t_end-l)))-K/r*log(exp(-r*(t_end-l)))) - (K/r*log(1+exp(-r*(t_begin-l)))-K/r*log(exp(-r*(t_begin-l))));
|
AUC=(K/r*log(1+exp(-r*(t_end-l)))-K/r*log(exp(-r*(t_end-l)))) - (K/r*log(1+exp(-r*(t_begin-l)))-K/r*log(exp(-r*(t_begin-l))));
|
||||||
MSR=r3;
|
MSR=r3;
|
||||||
%***************************
|
|
||||||
|
|
||||||
rsquare=errObj.rsquare;
|
rsquare=errObj.rsquare;
|
||||||
confObj=confint(fitObject,0.9); % get the 90% confidence
|
confObj=confint(fitObject,0.9); % get the 90% confidence
|
||||||
NANcond=0;
|
NANcond=0;
|
||||||
|
|
||||||
confObj_filtered=confObj;
|
confObj_filtered=confObj;
|
||||||
Klow=confObj(1,1); sDat(slps,5)=confObj(1,1);
|
Klow=confObj(1,1); sDat(slps,5)=confObj(1,1);
|
||||||
Kup=confObj(2,1); sDat(slps,6)=confObj(2,1);
|
Kup=confObj(2,1); sDat(slps,6)=confObj(2,1);
|
||||||
@@ -327,7 +265,6 @@ try
|
|||||||
if(isnan(Klow)||isnan(Kup)||isnan(llow)||isnan(lup)||isnan(rlow)||isnan(rup))
|
if(isnan(Klow)||isnan(Kup)||isnan(llow)||isnan(lup)||isnan(rlow)||isnan(rup))
|
||||||
NANcond=1;
|
NANcond=1;
|
||||||
end
|
end
|
||||||
|
|
||||||
filterTimes=Tms;
|
filterTimes=Tms;
|
||||||
normIntens=Ints;
|
normIntens=Ints;
|
||||||
resMat(17)=.00002;
|
resMat(17)=.00002;
|
||||||
@@ -337,9 +274,7 @@ try
|
|||||||
else % r is better than r3 so use the Std data in the ELr result sheet
|
else % r is better than r3 so use the Std data in the ELr result sheet
|
||||||
filterTimes=selTimesStd;
|
filterTimes=selTimesStd;
|
||||||
normIntens=selIntensStd;
|
normIntens=selIntensStd;
|
||||||
|
|
||||||
lastTptUsed=lastTptUsedStd; % Reinstall Std values for jh diags
|
lastTptUsed=lastTptUsedStd; % Reinstall Std values for jh diags
|
||||||
|
|
||||||
Tpt1=filterTimes(1);
|
Tpt1=filterTimes(1);
|
||||||
try
|
try
|
||||||
if isempty(Tpt1)
|
if isempty(Tpt1)
|
||||||
@@ -353,24 +288,17 @@ resMat(17)= Tpt1;
|
|||||||
numFitTpts=numFitTptsStd;
|
numFitTpts=numFitTptsStd;
|
||||||
numTptsGT2=numTptsGT2Std;
|
numTptsGT2=numTptsGT2Std;
|
||||||
thresGT2Tm=thresGT2TmStd;
|
thresGT2Tm=thresGT2TmStd;
|
||||||
|
cutTm(1:4)=1000; % 1 means cuts not used or NA
|
||||||
cutTm(1:4)= 1000; %-1 means cuts not used or NA
|
|
||||||
|
|
||||||
resMat(18)=bl; % only applicable to Std curve Fit; ELr superceeds and makes meaningless
|
resMat(18)=bl; % only applicable to Std curve Fit; ELr superceeds and makes meaningless
|
||||||
resMat(19)=fitblStd; % only applicable to Std curve Fit; ELr superceeds and makes meaningless
|
resMat(19)=fitblStd; % only applicable to Std curve Fit; ELr superceeds and makes meaningless
|
||||||
resMat(20)=minTime; % only applicable to Std curve Fit; ELr superceeds and makes meaningless
|
resMat(20)=minTime; % only applicable to Std curve Fit; ELr superceeds and makes meaningless
|
||||||
end % if r3>r1
|
end % if r3>r1
|
||||||
|
|
||||||
%rup
|
|
||||||
%asdf352
|
|
||||||
% {
|
|
||||||
catch ME
|
catch ME
|
||||||
% if no data is given, return zeros
|
% if no data is given, return zeros
|
||||||
AUC=0;MSR=0;K=0;r=0;l=0;rsquare=0;Klow=0;Kup=0;
|
AUC=0;MSR=0;K=0;r=0;l=0;rsquare=0;Klow=0;Kup=0;
|
||||||
rlow=0;rup=0;lup=0;llow=0; % normIntens=[];
|
rlow=0;rup=0;lup=0;llow=0; % normIntens=[];
|
||||||
|
end
|
||||||
|
|
||||||
end %end Try
|
|
||||||
%}
|
|
||||||
resMat(1)=AUC;
|
resMat(1)=AUC;
|
||||||
resMat(2)=MSR;
|
resMat(2)=MSR;
|
||||||
resMat(3)=K;
|
resMat(3)=K;
|
||||||
@@ -385,14 +313,10 @@ resMat(11)= llow;
|
|||||||
resMat(12)=lup;
|
resMat(12)=lup;
|
||||||
resMat(13)=currSpotArea;
|
resMat(13)=currSpotArea;
|
||||||
resMat(14)=lastIntensUsed; %filtNormIntens(length(filtNormIntens));
|
resMat(14)=lastIntensUsed; %filtNormIntens(length(filtNormIntens));
|
||||||
|
|
||||||
% spline fit unneccessary and removed therfor no max spline rate time->set 0
|
% spline fit unneccessary and removed therfor no max spline rate time->set 0
|
||||||
maxRateTime=0; % ELr will show 0; Std will show []
|
maxRateTime=0; % ELr will show 0; Std will show []
|
||||||
resMat(15)=maxRateTime;
|
resMat(15)=maxRateTime;
|
||||||
|
|
||||||
resMat(16)=lastTptUsed; % filterTimes(length(filterTimes));
|
resMat(16)=lastTptUsed; % filterTimes(length(filterTimes));
|
||||||
|
|
||||||
|
|
||||||
try % if Std fit used no cuts .:. no cutTm
|
try % if Std fit used no cuts .:. no cutTm
|
||||||
resMat(24)=cutTm(1);
|
resMat(24)=cutTm(1);
|
||||||
resMat(25)=cutTm(2);
|
resMat(25)=cutTm(2);
|
||||||
@@ -407,10 +331,6 @@ end
|
|||||||
|
|
||||||
FiltTimesELr=filterTimes;
|
FiltTimesELr=filterTimes;
|
||||||
NormIntensELr=normIntens;
|
NormIntensELr=normIntens;
|
||||||
|
|
||||||
%**********************************************************************************
|
|
||||||
%##########################################################################
|
|
||||||
|
|
||||||
lastTptUsed=max(filterTimes);
|
lastTptUsed=max(filterTimes);
|
||||||
lastIntensUsed=normIntens(length(normIntens));
|
lastIntensUsed=normIntens(length(normIntens));
|
||||||
|
|
||||||
@@ -419,9 +339,10 @@ NormIntensELr= normIntens;
|
|||||||
Growth=K ./ (1 + exp(-r.* (t - l )));
|
Growth=K ./ (1 + exp(-r.* (t - l )));
|
||||||
fitbl=min(Growth); % jh diag
|
fitbl=min(Growth); % jh diag
|
||||||
end
|
end
|
||||||
%}
|
try % jh diag
|
||||||
try
|
if isempty(thresGT2Tm)
|
||||||
if isempty(thresGT2Tm),thresGT2Tm=0;end %jh diag
|
thresGT2Tm=0
|
||||||
|
end
|
||||||
catch
|
catch
|
||||||
thresGT2Tm=0;
|
thresGT2Tm=0;
|
||||||
numTptsGT2=0;
|
numTptsGT2=0;
|
||||||
@@ -430,8 +351,6 @@ NormIntensELr= normIntens;
|
|||||||
resMat(21)=thresGT2Tm;
|
resMat(21)=thresGT2Tm;
|
||||||
resMat(22)=numFitTpts;
|
resMat(22)=numFitTpts;
|
||||||
resMat(23)=numTptsGT2;
|
resMat(23)=numTptsGT2;
|
||||||
|
end
|
||||||
|
|
||||||
end %function end
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user