Skip to content

Commit 4431204

Browse files
committed
fix project down compatibility in TA
1 parent e0bc222 commit 4431204

12 files changed

Lines changed: 37 additions & 24 deletions

File tree

.githooks/pre-commit

100644100755
File mode changed.

MASH-FRET/.release_version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"tag" : "1.3.1",
3-
"prev_commit_hash" : "ae13bbbf"
3+
"prev_commit_hash" : "e0bc2229"
44
}

MASH-FRET/source/mod_transition_analysis/_callbacks/edit_TA_mdlJmax_Callback.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function edit_TA_mdlJmax_Callback(obj,evd,h_fig)
1313
set(obj, 'String', num2str(val));
1414
if ~(numel(val)==1 && ~isnan(val) && val>0)
1515
set(obj, 'BackgroundColor', [1 0.75 0.75]);
16-
setContPan('The maximum number of degenerated levels is ill-defined.',...
16+
setContPan('The maximum number of degenerate levels is ill-defined.',...
1717
'error',h_fig);
1818
return
1919
end

MASH-FRET/source/mod_transition_analysis/_callbacks/edit_TA_slBin_Callback.m

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ function edit_TA_slBin_Callback(obj,evd,h_fig)
1717
proj = p.curr_proj;
1818
tpe = p.curr_type(proj);
1919
tag = p.curr_tag(proj);
20-
prm = p.proj{proj}.prm{tag,tpe};
2120
def = p.proj{proj}.def{tag,tpe};
21+
prm = p.proj{proj}.prm{tag,tpe};
22+
curr = p.proj{proj}.curr{tag,tpe};
2223

23-
prm.lft_start{2}(3) = val;
24+
curr.lft_start{2}(3) = val;
2425

2526
% recalculate histograms and reset fit results
2627
J = prm.lft_start{2}(1);
27-
prm = ud_kinPrm(prm,def,J);
28+
curr = ud_kinPrm(curr,def,J);
2829

29-
p.proj{proj}.prm{tag,tpe} = prm;
30-
p.proj{proj}.curr{tag,tpe} = prm;
30+
p.proj{proj}.curr{tag,tpe} = curr;
31+
p.proj{proj}.prm{tag,tpe} = curr;
3132
h.param.TDP = p;
3233
guidata(h_fig, h);
3334

MASH-FRET/source/mod_transition_analysis/_callbacks/popupmenu_TA_mdlMeth_Callback.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function popupmenu_TA_mdlDtState_Callback(obj,evd,h_fig)
1+
function popupmenu_TA_mdlMeth_Callback(obj,evd,h_fig)
22

33
h = guidata(h_fig);
44
p = h.param.TDP;

MASH-FRET/source/mod_transition_analysis/clustering/clusterTDP.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@
104104
curr.lft_def = prm.lft_def;
105105
curr.lft_start = prm.lft_start;
106106
curr.lft_res = prm.lft_res;
107-
curr.mdl_start = prm.mdl_start;
108107
curr.mdl_res = prm.mdl_res;
109108

110109
p.proj{proj}.prm{tag,tpe} = prm;

MASH-FRET/source/mod_transition_analysis/kinetic_model/plotKinMdl.m

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function plotKinMdl(h_axes,prm,v_res)
1+
function plotKinMdl(h_axes,prm,def,v_res)
22

33
% defaults
44
norm = 1;
@@ -12,18 +12,13 @@ function plotKinMdl(h_axes,prm,v_res)
1212
end
1313

1414
% collect results
15-
if ~(isfield(prm,'mdl_res'))
16-
mdl_res = [];
17-
else
18-
mdl_res = prm.mdl_res;
19-
end
20-
if isempty(mdl_res)
15+
if ~(isfield(prm,'mdl_res')) || isequal(prm.mdl_res,def.mdl_res)
2116
states = [];
2217
else
23-
tp = mdl_res{1};
24-
simdat = mdl_res{4};
25-
states = mdl_res{5};
26-
BICres = mdl_res{6}{1};
18+
tp = prm.mdl_res{1};
19+
simdat = prm.mdl_res{4};
20+
states = prm.mdl_res{5};
21+
BICres = prm.mdl_res{6}{1};
2722
end
2823

2924
% draw state diagram

MASH-FRET/source/mod_transition_analysis/kinetic_model/ud_kinMdl.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function ud_kinMdl(h_fig)
2121
% set all control off-enabled
2222
setProp(h.uipanel_TA_kineticModel, 'Enable', 'off');
2323

24-
if ~(isfield(curr,'clst_res') && ~isempty(curr.clst_res{1}))
24+
if ~(isfield(prm,'clst_res') && ~isempty(prm.clst_res{1}))
2525
return
2626
end
2727

MASH-FRET/source/mod_transition_analysis/management/downCompatibilityTDP.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
if isfield(prm,'plot') && size(prm.plot{1},1)<4
1818
prm.plot = def.plot;
1919
end
20+
2021
% add boba parameters if none
2122
if isfield(prm,'clst_start') && size(prm.clst_start,2)>=1 && ...
2223
size(prm.clst_start{1},2)<8
@@ -251,6 +252,11 @@
251252
prm.lft_start{2} = [prm.kin_start{2},bin,excl,rearr];
252253
end
253254

255+
% adjust current state id after state binning
256+
if prm.lft_start{2}(2)>V
257+
prm.lft_start{2}(2) = V;
258+
end
259+
254260
% recalculate histograms
255261
prm2 = ud_kinPrm(prm,def,J);
256262
prm.clst_res{4} = prm2.clst_res{4};
@@ -270,6 +276,14 @@
270276
prm = rmfield(prm,'kin_res');
271277
end
272278

279+
if ~isfield(prm,'mdl_start')
280+
prm.mdl_start = def.mdl_start;
281+
end
282+
283+
if ~isfield(prm,'mdl_res')
284+
prm.mdl_res = def.mdl_res;
285+
end
286+
273287
p_proj.prm{tag,tpe} = prm;
274288

275289

MASH-FRET/source/mod_transition_analysis/management/updateTAplots.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ function updateTAplots(h_fig,varargin)
4040

4141
tag = p.curr_tag(proj);
4242
tpe = p.curr_type(proj);
43+
def = p.proj{proj}.def{tag,tpe};
4344
curr = p.proj{proj}.curr{tag,tpe};
4445
prm = p.proj{proj}.prm{tag,tpe};
4546
v_lft = curr.lft_start{2}(2);
@@ -55,5 +56,5 @@ function updateTAplots(h_fig,varargin)
5556
end
5657
if strcmp(opt,'all') || strcmp(opt,'mdl')
5758
plotKinMdl([h.axes_TDPplot3,h.axes_TA_mdlPop,h.axes_TA_mdlTrans,...
58-
h.axes_TA_mdlDt,h.axes_TA_mdlBIC],prm,v_mdl);
59+
h.axes_TA_mdlDt,h.axes_TA_mdlBIC],prm,def,v_mdl);
5960
end

0 commit comments

Comments
 (0)