Skip to content

Commit

Permalink
Merge pull request #85 from RNA-FRETools/MASH-FRET-1.3.3-doc
Browse files Browse the repository at this point in the history
Documentation updates
  • Loading branch information
mca-sh authored Dec 4, 2022
2 parents fe967df + 3f9deab commit cedff61
Show file tree
Hide file tree
Showing 513 changed files with 5,167 additions and 5,041 deletions.
2 changes: 1 addition & 1 deletion MASH-FRET/.release_version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"tag" : "1.3.2",
"prev_commit_hash" : "8fcf5539"
"prev_commit_hash" : "849a07f1"
}
Binary file modified MASH-FRET/source/GUI/charDimTable.mat
Binary file not shown.
5 changes: 5 additions & 0 deletions MASH-FRET/source/GUI/figure_MASH_CloseRequestFcn.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ function figure_MASH_CloseRequestFcn(obj, evd)
delete(h.figure_dummy)
end

setContPan('save interface parameters in default_param.ini file ...',...
'process',obj);

p = h.param;
if ~isempty(p.proj) && isfield(p.ttPr,'defProjPrm')
% remove background intensities
Expand All @@ -40,4 +43,6 @@ function figure_MASH_CloseRequestFcn(obj, evd)
[mfile_path,o,o] = fileparts(which('MASH'));
save([mfile_path filesep 'default_param.ini'], '-struct', 'p');

setContPan('closing MASH-FRET ...','process',obj);

delete(obj);
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
ylabel(h_axes,ylbl0);
tiaxes = get(h_axes,'tightinset');
posaxes = getRealPosAxes([x,y,waxes0,haxes0],tiaxes,'traces');
set(h_axes,'position',posaxes);
set(h_axes,'position',posaxes,'nextplot','replacechildren');

if ~isempty(p.fname_boba)
x = posaxes(1)+posaxes(3)-waxes1;
Expand All @@ -47,7 +47,8 @@
ico_boba = repmat(ico_boba, [1,1,3]);
image(ico_boba,'parent',h.axes_hist_BOBA);
axis(h.axes_hist_BOBA,'image');
set(h.axes_hist_BOBA,'xtick',[],'ytick',[]);
set(h.axes_hist_BOBA,'xtick',[],'ytick',[],'nextplot',...
'replacechildren');
end

x = p.mg;
Expand All @@ -62,5 +63,5 @@
ylabel(h_axes,ylbl1);
tiaxes = get(h_axes,'tightinset');
posaxes = getRealPosAxes([x,y,waxes0,haxes0],tiaxes,'traces');
set(h_axes,'position',posaxes);
set(h_axes,'position',posaxes,'nextplot','replacechildren');

Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@
y = postab(4)-p.mgtab-haxes0;

h.axes_thm_BIC = axes('parent',h_tab,'units',p.posun,'fontunits',p.fntun,...
'fontsize',p.fntsz0,'position',[x,y,waxes0,haxes0],'xticklabelmode',...
'manual');
'fontsize',p.fntsz1,'position',[x,y,waxes0,haxes0]);
h_axes = h.axes_thm_BIC;
xlim(h_axes,xlim0);
ylim(h_axes,ylim0);
ylabel(h_axes,ylbl0);
xlabel(h_axes,xlbl0);
tiaxes = get(h_axes,'tightinset');
posaxes = getRealPosAxes([x,y,waxes0,haxes0],tiaxes,'traces');
set(h_axes,'position',posaxes);
set(h_axes,'position',posaxes,'nextplot','replacechildren');

Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
ttstr2 = wrapHtmlTooltipString('<b>Model selection:</b> overfitting is penalized using a <b>minimum improvement</b> in likelihood (the model is selected if further increase in complexity does not sufficiently improve the likelihood).');
ttstr3 = wrapHtmlTooltipString('<b>Improvement factor:</b> multiplication factor that expresses the minimum improvement in likelihood (example: 1.2 set a minimum improvement of 20%).');
ttstr4 = wrapHtmlTooltipString('<b>Model selection:</b> overfitting is penalized using the <b>BIC</b> (the selected model minimizes the BIC).');
ttstr4b = wrapHtmlTooltipString('<b>Likelihood calculation:</b> <u>complete data:</u> each transition is associated to one and only Gaussian; <u>incomplete data:</u> transitions have a non-null probability to belong to each Gaussian (subject to overestimation of model complexity).');
ttstr4b = wrapHtmlTooltipString('<b>Likelihood calculation:</b> <u>complete data:</u> each bin is associated to one and only Gaussian; <u>incomplete data:</u> bins have a non-null probability to belong to each Gaussian (subject to overestimation of model complexity).');
ttstr5 = wrapHtmlTooltipString('Select an inferred <b>state configuration</b> to show on the histogram plot: configurations are labelled with the corresponding number of Gaussians.');
ttstr6 = wrapHtmlTooltipString('<b>Export Gaussian parameters</b> of the selected state configuration to panel "State populations" as starting guesses for state population analysis.');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
str5 = 'refine';
str6 = 'binning';
str7 = 'deblurr';
str8 = {'Thresholds','vbFRET-1D','vbFRET-2D','One state','CPA','STaSI'};
str8 = {'Thresholds','vbFRET-1D','vbFRET-2D','One state','CPA','STaSI',...
'Imported'};
str9 = {'bottom','top','all'};
str10 = {'Select a trace'};
str11 = 'Results (19 states):';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
str6 = 'label';
str7 = {'Selecte a label'};
str8 = 'Del.';
str9 = 'Add>';
str9 = '<Add';
ttstr6 = wrapHtmlTooltipString('Open the <b>Trace manager</b> to visualize the ensemble and sort single molecules.');
ttstr7 = wrapHtmlTooltipString('<b>Clear excluded molecules</b> off the list: excluded molecules appear in black in the list.');
ttstr8 = wrapHtmlTooltipString('<b>Molecule selection</b>: when activated, the current molecule is included in the refined sample, otherwise, molecule is considered excluded and appear in black in the list.');
Expand Down Expand Up @@ -91,24 +91,25 @@
p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'position',...
[x,y,wpop0,htxt0],'string',str6);

y = y-hpop0;
x = p.mg;
y = y-hpop0+(hpop0-hedit0)/2;

h.popupmenu_TP_molLabel = uicontrol('style','popupmenu','parent',h_pan,...
h.togglebutton_TP_addTag = uicontrol('style','togglebutton','parent',h_pan,...
'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'position',...
[x,y,wpop0,hpop0],'string',str7,'tooltipstring',ttstr9);
[x,y,wbut5,hedit0],'string',str9,'tooltipstring',ttstr11,'callback',...
{@togglebutton_TP_addTag_Callback,h_fig});

x = x+wpop0+p.mg/fact;
y = y+(hpop0-hedit0)/2;
x = x+wbut5+p.mg/fact;

h.pushbutton_TP_deleteTag = uicontrol('style','pushbutton','parent',h_pan,...
'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'position',...
[x,y,wbut4,hedit0],'string',str8,'tooltipstring',ttstr10,'callback',...
{@pushbutton_TP_deleteTag_Callback,h_fig});

x = x+wbut4+p.mg/fact;
y = y-(hpop0-hedit0)/2;

h.togglebutton_TP_addTag = uicontrol('style','togglebutton','parent',h_pan,...
h.popupmenu_TP_molLabel = uicontrol('style','popupmenu','parent',h_pan,...
'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'position',...
[x,y,wbut5,hedit0],'string',str9,'tooltipstring',ttstr11,'callback',...
{@togglebutton_TP_addTag_Callback,h_fig});
[x,y,wpop0,hpop0],'string',str7,'tooltipstring',ttstr9);

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
file_icon1 = 'icon_zoom.png';
file_icon2 = 'icon_crosshair.png';
file_icon3 = 'icon_clear.png';
str0 = char(9668);
str0 = char(9650);
ttstr0 = wrapHtmlTooltipString('Switch to <b>cluster selection</b> mode');
ttstr1 = wrapHtmlTooltipString('<b>Clear</b> current selection');
ttstr2 = wrapHtmlTooltipString('Switch to <b>zoom</b> mode');
Expand All @@ -35,9 +35,9 @@

% dimensions
pospan = get(h_pan,'position');
hpan = p.mg/2+hedit0+p.mg/2;
hpan = p.mg/2+3*hedit0+2*p.mg/fact+p.mg/2+hedit0+p.mg/2;
wbut0 = getUItextWidth(str0,p.fntun,p.fntsz1,'normal',p.tbl)+p.wbrd;
wpan = p.mg/2+3*hedit0+2*p.mg/fact+p.mg/2+wbut0+p.mg/2;
wpan = p.mg/2+wbut0+p.mg/2;

% set panel dimensions
set(h_pan,'position',[pospan(1:2),wpan,hpan]);
Expand All @@ -48,29 +48,30 @@
img3 = imread(file_icon3);

% GUI
x = p.mg/2;
y = p.mg/2;
x = p.mg/2+(wbut0-hedit0)/2;
y = hpan-p.mg/2-hedit0;

h.tooglebutton_TDPselectZoom = uicontrol('style','togglebutton','parent',...
h_pan,'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,...
'position',[x,y,hedit0,hedit0],'tooltipstring',ttstr2,'callback',...
{@tooglebutton_TDPselect_Callback,h_fig,1},'cdata',img1);

x = x+hedit0+p.mg/fact;
y = y-hedit0-p.mg/fact;

h.tooglebutton_TDPselectCross = uicontrol('style','togglebutton','parent',...
h_pan,'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,...
'position',[x,y,hedit0,hedit0],'tooltipstring',ttstr0,'callback',...
{@tooglebutton_TDPselect_Callback,h_fig,2},'cdata',img2);

x = x+hedit0+p.mg/fact;
y = y-hedit0-p.mg/fact;

h.pushbutton_TDPselectClear = uicontrol('style','pushbutton','parent',...
h_pan,'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,...
'position',[x,y,hedit0,hedit0],'tooltipstring',ttstr1,'callback',...
{@tooglebutton_TDPselect_Callback,h_fig,3},'cdata',img3);

x = x+hedit0+p.mg/2;
x = x-(wbut0-hedit0)/2;
y = y-hedit0-p.mg/2;

h.pushbutton_TDPmanStart = uicontrol('style','pushbutton','parent',...
h_pan,'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
posbut = get(h.tooglebutton_TDPmanStart,'position');
pospan1 = get(h.uipanel_TA_clusters,'position');
pospan2 = get(h.uipanel_TA_selectTool,'position');
pospan2(1) = pospan1(1)+posbut(1)+posbut(3);
pospan2(2) = pospan1(2)+posbut(2)-(pospan2(4)-posbut(4))/2;
pospan2(1) = pospan1(1)+posbut(1)+(posbut(3)-pospan2(3))/2;
pospan2(2) = pospan1(2)+posbut(2)-pospan2(4);
set(h.uipanel_TA_selectTool,'position',pospan2);

7 changes: 4 additions & 3 deletions MASH-FRET/source/mod-histogram-analysis/plotHist.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ function plotHist(h_axes, P, lim, start, res, clr, boba, intUnits, h_fig)
ylabel(h_axes(3),'Improvement factor');
set(h_axes(3),'nextplot','replacechildren');
end
set(h_axes(3),'xtick',1:Jmax);
else
cla(h_axes(3));
set(h_axes(3),'visible','off');
Expand Down Expand Up @@ -167,7 +168,7 @@ function plotHist(h_axes, P, lim, start, res, clr, boba, intUnits, h_fig)
end
plot(h_axes(1), P(:,1), y_all, 'Color', [0.5 0.5 0.5], ...
'LineWidth', 2);
set(h_axes, 'NextPlot', 'replacechildren');
set(h_axes(1), 'NextPlot', 'replacechildren');

% plot most probable configuration
elseif ~isempty(res{3,1})
Expand Down Expand Up @@ -226,7 +227,7 @@ function plotHist(h_axes, P, lim, start, res, clr, boba, intUnits, h_fig)
plot(h_axes(1), [thresh(k) thresh(k)], y_lim, '-k', ...
'LineWidth', 2);
end
set(h_axes(1),'NextPlot','replace');
set(h_axes(1),'NextPlot','replacechildren');

if numel(h_axes)>1
plot(h_axes(2), P(:,1), P(:,3), '+k');
Expand All @@ -236,7 +237,7 @@ function plotHist(h_axes, P, lim, start, res, clr, boba, intUnits, h_fig)
plot(h_axes(2), [thresh(k) thresh(k)], y_cumlim, '-k', ...
'LineWidth', 2);
end
set(h_axes(2),'NextPlot','replace');
set(h_axes(2),'NextPlot','replacechildren');
end
end

Expand Down
29 changes: 21 additions & 8 deletions MASH-FRET/source/mod-simulation/export-options/exportResults.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
h = guidata(h_fig);
p = h.param;
proj = p.curr_proj;
inSec = p.proj{proj}.time_in_sec;
perSec = p.proj{proj}.cnt_p_sec;
prm = p.proj{proj}.sim.prm;

% check simulated state sequences
Expand Down Expand Up @@ -93,6 +91,7 @@
L = size(Idon,1);
dat = p.proj{proj};
dat.FRET_DTA = discr;
dat.FRET_DTA_import = discr;
dat.intensities = NaN(L,2*N);

% check for file overwriting (one file exported per format)
Expand Down Expand Up @@ -341,15 +340,16 @@
if isPresets && isfield(presets,'stateVal')
states = presets.stateVal(n,:);
end
statevals = dt(:,[2,3]);
for j = 1:J
dt(dt(:,2)==j,2) = states(j);
dt(dt(:,3)==j,3) = states(j);
statevals(dt(:,2)==j,1) = states(j);
statevals(dt(:,3)==j,2) = states(j);
end

f = fopen(fname_dt,'Wt');
fprintf(f,cat(2,'dwell-time (second)\tstate\tstate after ',...
'transition\n'));
fprintf(f,'%d\t%d\t%d\n',dt');
fprintf(f,cat(2,'dwell-time (second)\tstate\t',...
'state after transition\tFRET\tFRET after transition\n'));
fprintf(f,'%d\t%d\t%d\t%d\t%d\n',[dt,statevals]');
fclose(f);
end

Expand Down Expand Up @@ -415,7 +415,7 @@
dat.ES = {};
dat.intensities_DTA = nan(L,2*N);
dat.S_DTA = [];
dat.bool_intensities = true(L,N);
dat.bool_intensities = discr>0;

dat.molTag = false(N,numel(dat.molTagNames));

Expand All @@ -435,6 +435,19 @@
p = importHA(p,proj);
p = importTA(p,proj);

% set photobleaching cutoff
for m = 1:numel(p.proj{proj}.TP.curr)
id = find(discr(:,m)>0);
if isempty(id)
cutoff = 1;
else
cutoff = id(end);
end
p.proj{proj}.TP.curr{m}{2}{1}(1) = 1; % apply cutoff
p.proj{proj}.TP.curr{m}{2}{1}(2) = 1; % manual method
p.proj{proj}.TP.curr{m}{2}{1}(5) = cutoff; % cutoff frames
end

% save modifications
h = guidata(h_fig); % recover file overwrite options
p.proj{proj}.sim.prm = prm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ function popupmenu_TP_states_applyTo_Callback(obj, evd, h_fig)
val = get(obj, 'Value');
if meth==3 && val~=1
val = 1;
disp(['2D analysis is available for intensity ratio (bottom)',...
' traces only.']);
disp(['2D analysis is available for intensity ratio traces (bottom) ',...
'only.']);
elseif meth==7 && val~=1
disp(['"Imported" is available for FRET state sequences (bottom) ',...
'only.']);
val = 1;
end

switch val
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,32 @@ function popupmenu_TP_states_method_Callback(obj, evd, h_fig)
p = h.param;
proj = p.curr_proj;
mol = p.ttPr.curr_mol(proj);

meth = get(obj, 'Value');
p.proj{proj}.TP.curr{mol}{4}{1}(1) = meth;

h.param = p;
guidata(h_fig, h);

if meth==3 % 2D-vbFRET discretize bottom traces only
p.proj{proj}.TP.curr{mol}{4}{1}(1) = meth;
h.param = p;
guidata(h_fig, h);

set(h.popupmenu_TP_states_applyTo,'value',1);
popupmenu_TP_states_applyTo_Callback(h.popupmenu_TP_states_applyTo,...
[],h_fig)

elseif meth==7 % Imported
if ~(isfield(p.proj{proj},'FRET_DTA_import') && ...
~isempty(p.proj{proj}.FRET_DTA_import))
setContPan(['"Imported" method can not be used for this project: ',...
'no imported FRET state sequences were found.'],'warning',...
h_fig);
else
p.proj{proj}.TP.curr{mol}{4}{1}(1) = meth;
h.param = p;
guidata(h_fig, h);

set(h.popupmenu_TP_states_applyTo,'value',1);
popupmenu_TP_states_applyTo_Callback(h.popupmenu_TP_states_applyTo,...
[],h_fig)
end
end

ud_DTA(h_fig);
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ function pushbutton_TTrem_Callback(obj, evd, h_fig)
if nFRET > 0
incl_f = reshape(repmat(incl, [nFRET,1]),1,nFRET*numel(incl));
p.proj{proj}.FRET_DTA = p.proj{proj}.FRET_DTA(:,incl_f);
if isfield(p.proj{proj},'FRET_DTA_import') && ...
~isempty(p.proj{proj}.FRET_DTA_import)
p.proj{proj}.FRET_DTA_import = ...
p.proj{proj}.FRET_DTA_import(:,incl_f);
end
end

if nS > 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
% h_fig: handle to main figure

% defaults
file_icon0 = 'view.png';
str0 = 'data';
str1 = 'method';
str2 = 'param.';
Expand All @@ -18,7 +19,7 @@
str6 = 'XXXXX at 999nm';
str7 = 'Most frequent value';
str8 = 'auto';
str9 = 'Show';
str9 = 'Opt.';
str10 = 'current molecule';
str11 = 'BG value';
str12 = char(9668);
Expand All @@ -42,6 +43,10 @@
% parent
h_pan = q.uipanel_determine_bg;

% images
pname = [fileparts(mfilename('fullpath')),filesep,'..',filesep,'..',filesep,'..',filesep,'..',filesep,'GUI',filesep];
img0 = imread([pname,file_icon0]);

% dimensions
pospan = get(h_pan,'position');
wpop0 = getUItextWidth(str6,p.fntun,p.fntsz,'normal',p.tbl) + p.warr;
Expand Down Expand Up @@ -157,7 +162,7 @@

q.pushbutton_show = uicontrol('style','pushbutton','parent',h_pan,'units',...
p.posun,'fontunits',p.fntun,'fontsize',p.fntsz,'position',...
[x,y,wbut0,p.hbut],'string',str9,'tooltipstring',ttstr6,'callback',...
[x,y,wbut0,p.hbut],'cdata',img0,'tooltipstring',ttstr6,'callback',...
{@pushbutton_BA_show_Callback,h_fig});

x = p.mg;
Expand Down
Loading

0 comments on commit cedff61

Please sign in to comment.