Skip to content

Commit

Permalink
Merge pull request #107 from RNA-FRETools/improve-tm
Browse files Browse the repository at this point in the history
Various improvements and bug fixes in VP, TP and HA
  • Loading branch information
mca-sh authored Nov 3, 2023
2 parents e8881a5 + 68d9f23 commit f552d1c
Show file tree
Hide file tree
Showing 81 changed files with 1,218 additions and 682 deletions.
4 changes: 2 additions & 2 deletions MASH-FRET/.release_version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"tag" : "1.3.3.1",
"prev_commit_hash" : "4f414d4c"
"tag" : "1.3.3.2",
"prev_commit_hash" : "cbe25179"
}
33 changes: 4 additions & 29 deletions MASH-FRET/source/GUI/mod-histogram-analysis/buildPanelHA.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,13 @@
htxt0 = 14;
wedit0 = 40;
fact = 5;
fntsz2 = 10;
str0 = 'data';
str1 = {'Select data'};
str2 = 'subgroup';
str3 = {'Select subgroup'};
str5 = 'Gaussian fitting';
str6 = 'relative pop.:';
str7 = 'EXPORT...';
ttl0 = 'Histogram and plot';
ttl1 = 'State configuration';
ttl2 = 'State populations';
tabttl0 = 'Histograms';
tabttl1 = 'Model selection';
ttstr0 = wrapHtmlTooltipString('<b>Select data</b> to histogram and analyze.');
Expand All @@ -56,13 +52,7 @@
wcb0 = getUItextWidth(str5,p.fntun,p.fntsz1,'normal',p.tbl)+p.wbox;
wtxt0 = getUItextWidth(str6,p.fntun,p.fntsz1,'normal',p.tbl);
wbut0 = getUItextWidth(str7,p.fntun,p.fntsz1,'bold',p.tbl)+p.wbrd;
htxt1 = (fntsz2/p.fntsz1)*htxt0;
hpan0 = p.mgpan+htxt0+hedit0+p.mg/2+hedit0+p.mg;
hpan1 = p.mgpan+hedit0+p.mg+htxt0+(hpop0-hedit0)/2+hedit0+p.mg/fact+hedit0+p.mg+...
htxt1+p.mg/2+htxt0+hpop0+p.mg;
hpan2_1 = p.mgpan+p.mg+p.mg/2+4*p.mg/fact+6*hedit0;
hpan2_2 = 2*p.mgpan+2*p.mg+3*p.mg/2+2*p.mg/fact+5*hedit0+hpop0+htxt0;
hpan2 = p.mgpan+p.mg+p.mg/2+hpan2_1+hpan2_2;
hpan0 = pospan(4)-p.mgpan-htxt0-hpop0-2*p.mg-hedit0-p.mg;
wpan0_1 = wcb0+2*p.mg;
wpan0_2 = 2*p.mg+2*p.mg/fact+2*wedit0+wtxt0;
wpan0 = 3*p.mg+wpan0_1+wpan0_2;
Expand Down Expand Up @@ -119,24 +109,9 @@
x = p.mg+wtab+p.mg;
y = y-p.mg-hpan0;

h.uipanel_HA_histogramAndPlot = uipanel('parent',h_pan,'units',p.posun,...
'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',...
[x,y,wpan0,hpan0],'title',ttl0);
h = buildPanelHAhistogramAndPlot(h,p);

y = y-p.mg-hpan1;

h.uipanel_HA_stateConfiguration = uipanel('parent',h_pan,'units',p.posun,...
'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',...
[x,y,wpan0,hpan1],'title',ttl1);
h = buildPanelHAstateConfiguration(h,p);

y = y-p.mg-hpan2;

h.uipanel_HA_statePopulations = uipanel('parent',h_pan,'units',p.posun,...
'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',...
[x,y,wpan0,hpan2],'title',ttl2);
h = buildPanelHAstatePopulations(h,p);
h.uipanel_HA_scroll = uipanel('parent',h_pan,'units',p.posun,'fontunits',...
p.fntun,'fontsize',p.fntsz1,'position',[x,y,wpan0,hpan0],'title',[]);
h = buildPanelScrollHA(h,p);

x = pospan(3)-p.mg-wbut0;
y = p.mg;
Expand Down
56 changes: 56 additions & 0 deletions MASH-FRET/source/GUI/mod-histogram-analysis/buildPanelScrollHA.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
function h = buildPanelScrollHA(h,p)

% default
hpop0 = 22;
hedit0 = 20;
htxt0 = 14;
wedit0 = 40;
fact = 5;
fntsz2 = 10;
str5 = 'Gaussian fitting';
str6 = 'relative pop.:';
ttl0 = 'Histogram and plot';
ttl1 = 'State configuration';
ttl2 = 'State populations';

% parents
h_pan = h.uipanel_HA_scroll;

% dimensions
pospan = get(h_pan,'position');
wcb0 = getUItextWidth(str5,p.fntun,p.fntsz1,'normal',p.tbl)+p.wbox;
wtxt0 = getUItextWidth(str6,p.fntun,p.fntsz1,'normal',p.tbl);
htxt1 = (fntsz2/p.fntsz1)*htxt0;
hpan0 = p.mgpan+htxt0+hedit0+p.mg/2+hedit0+p.mg;
hpan1 = p.mgpan+hedit0+p.mg+htxt0+(hpop0-hedit0)/2+hedit0+p.mg/fact+hedit0+p.mg+...
htxt1+p.mg/2+htxt0+hpop0+p.mg;
hpan2_1 = p.mgpan+p.mg+p.mg/2+4*p.mg/fact+6*hedit0;
hpan2_2 = 2*p.mgpan+2*p.mg+3*p.mg/2+2*p.mg/fact+5*hedit0+hpop0+htxt0;
hpan2 = p.mgpan+p.mg+p.mg/2+hpan2_1+hpan2_2;
wpan0_1 = wcb0+2*p.mg;
wpan0_2 = 2*p.mg+2*p.mg/fact+2*wedit0+wtxt0;
wpan0 = 3*p.mg+wpan0_1+wpan0_2;

% GUI
x = 0;
y = pospan(4)-p.mg-hpan0;

h.uipanel_HA_histogramAndPlot = uipanel('parent',h_pan,'units',p.posun,...
'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',...
[x,y,wpan0,hpan0],'title',ttl0);
h = buildPanelHAhistogramAndPlot(h,p);

y = y-p.mg-hpan1;

h.uipanel_HA_stateConfiguration = uipanel('parent',h_pan,'units',p.posun,...
'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',...
[x,y,wpan0,hpan1],'title',ttl1);
h = buildPanelHAstateConfiguration(h,p);

y = y-p.mg-hpan2;

h.uipanel_HA_statePopulations = uipanel('parent',h_pan,'units',p.posun,...
'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',...
[x,y,wpan0,hpan2],'title',ttl2);
h = buildPanelHAstatePopulations(h,p);

47 changes: 5 additions & 42 deletions MASH-FRET/source/GUI/mod-simulation/buildPanelS.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,12 @@

% default
fact = 5;
htxt0 = 14;
hedit0 = 20;
hpop0 = 22;
wedit0 = 40;
str0 = 'nb. of states (J)';
str1 = 'GENERATE';
str2 = 'UPDATE';
str3 = 'EXPORT';
ttl0 = 'Video parameters';
ttl1 = 'Molecules';
ttl2 = 'Experimental setup';
ttl3 = 'Export options';
tabttl0 = 'Video';
tabttl1 = 'Traces';
tabttl2 = 'Distributions';
Expand All @@ -55,20 +49,11 @@
wspan0 = p.mg+wtxt0+wedit0+p.mg/2+wedit0+p.mg/fact+wedit0+p.mg/fact+wedit0+...
p.mg;
wpan0 = 2*p.mg+wspan0;
hspan0 = p.mgpan+hpop0+p.mg/2+hedit0+p.mg/fact+hedit0+p.mg/fact+hedit0+...
p.mg/2;
hpan0 = p.mgpan+htxt0+hedit0+p.mg/2+htxt0+hedit0+p.mg/2+hspan0+p.mg/2;
hspan1 = p.mgpan+htxt0+hpop0+p.mg/2+htxt0+5*(1+hedit0)+htxt0+p.mg/2;
hspan2 = p.mgpan+htxt0+hedit0+p.mg/fact+hedit0+p.mg/2+htxt0+hedit0+p.mg/2+...
hedit0+p.mg/2;
hpan1 = p.mgpan+hedit0+p.mg/fact+hedit0+p.mg+hedit0+p.mg/2+hspan1+p.mg/2+...
hspan2+p.mg/2;
hspan3 = p.mgpan+hpop0+p.mg/2+htxt0+hedit0+p.mg/2+htxt0+hedit0+p.mg/2;
hpan2 = p.mgpan+htxt0+hedit0+p.mg/2+htxt0+hedit0+p.mg/2+hspan3+p.mg;
hpan3 = p.mgpan+7*hedit0+p.mg/2+hedit0+hpop0+p.mg/2;
wtab = pospan(3)-3*p.mg-wpan0;
htab = pospan(4)-2*p.mg;
hpan0 = htab-2*p.mg-hedit0;

% builds GUI
x = p.mg;
y = p.mg;

Expand All @@ -92,31 +77,9 @@
x = x+wtab+p.mg;
y = pospan(4)-p.mg-hpan0;

h.uipanel_S_videoParameters = uipanel('parent',h_pan,'title',ttl0,'units',...
p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold',...
'position',[x,y,wpan0,hpan0]);
h = buildPanelSimVideoParametes(h,p);

y = y-p.mg-hpan1;

h.uipanel_S_molecules = uipanel('parent',h_pan,'title',ttl1,'units',...
p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold',...
'position',[x,y,wpan0,hpan1]);
h = buildPanelSimMolecules(h,p);

y = y-p.mg-hpan2;

h.uipanel_S_experimentalSetup = uipanel('parent',h_pan,'title',ttl2,...
'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight',...
'bold','position',[x,y,wpan0,hpan2]);
h = buildPanelSimExperimentalSetup(h,p);

y = y-p.mg-hpan3;

h.uipanel_S_exportOptions = uipanel('parent',h_pan,'title',ttl3,'units',...
p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold',...
'position',[x,y,wpan0,hpan3]);
h = buildPanelSimExportOptions(h,p);
h.uipanel_S_scroll = uipanel('parent',h_pan,'units',p.posun,'fontunits',...
p.fntun,'fontsize',p.fntsz1,'position',[x,y,wpan0,hpan0],'title',[]);
h = buildPanelScrollSim(h,p);

y = p.mg;
x = pospan(3)-p.mg-wbut2-p.mg/2-wbut1-p.mg/2-wbut0;
Expand Down
64 changes: 64 additions & 0 deletions MASH-FRET/source/GUI/mod-simulation/buildPanelScrollSim.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
function h = buildPanelScrollSim(h,p)

% default
fact = 5;
htxt0 = 14;
hedit0 = 20;
hpop0 = 22;
wedit0 = 40;
str0 = 'nb. of states (J)';
ttl0 = 'Video parameters';
ttl1 = 'Molecules';
ttl2 = 'Experimental setup';
ttl3 = 'Export options';

% parents
h_pan = h.uipanel_S_scroll;

% dimensions
pospan = get(h_pan,'position');
wtxt0 = getUItextWidth(str0,p.fntun,p.fntsz1,'normal',p.tbl);
wspan0 = p.mg+wtxt0+wedit0+p.mg/2+wedit0+p.mg/fact+wedit0+p.mg/fact+wedit0+...
p.mg;
wpan0 = 2*p.mg+wspan0;
hspan0 = p.mgpan+hpop0+p.mg/2+hedit0+p.mg/fact+hedit0+p.mg/fact+hedit0+...
p.mg/2;
hpan0 = p.mgpan+htxt0+hedit0+p.mg/2+htxt0+hedit0+p.mg/2+hspan0+p.mg/2;
hspan1 = p.mgpan+htxt0+hpop0+p.mg/2+htxt0+5*(1+hedit0)+htxt0+p.mg/2;
hspan2 = p.mgpan+htxt0+hedit0+p.mg/fact+hedit0+p.mg/2+htxt0+hedit0+p.mg/2+...
hedit0+p.mg/2;
hpan1 = p.mgpan+hedit0+p.mg/fact+hedit0+p.mg+hedit0+p.mg/2+hspan1+p.mg/2+...
hspan2+p.mg/2;
hspan3 = p.mgpan+hpop0+p.mg/2+htxt0+hedit0+p.mg/2+htxt0+hedit0+p.mg/2;
hpan2 = p.mgpan+htxt0+hedit0+p.mg/2+htxt0+hedit0+p.mg/2+hspan3+p.mg;
hpan3 = p.mgpan+7*hedit0+p.mg/2+hedit0+hpop0+p.mg/2;

% builds GUI
x = 0;
y = pospan(4)-p.mg/2-hpan0;

h.uipanel_S_videoParameters = uipanel('parent',h_pan,'title',ttl0,'units',...
p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold',...
'position',[x,y,wpan0,hpan0]);
h = buildPanelSimVideoParametes(h,p);

y = y-p.mg-hpan1;

h.uipanel_S_molecules = uipanel('parent',h_pan,'title',ttl1,'units',...
p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold',...
'position',[x,y,wpan0,hpan1]);
h = buildPanelSimMolecules(h,p);

y = y-p.mg-hpan2;

h.uipanel_S_experimentalSetup = uipanel('parent',h_pan,'title',ttl2,...
'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight',...
'bold','position',[x,y,wpan0,hpan2]);
h = buildPanelSimExperimentalSetup(h,p);

y = y-p.mg-hpan3;

h.uipanel_S_exportOptions = uipanel('parent',h_pan,'title',ttl3,'units',...
p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold',...
'position',[x,y,wpan0,hpan3]);
h = buildPanelSimExportOptions(h,p);
91 changes: 91 additions & 0 deletions MASH-FRET/source/GUI/mod-trace-processing/buildPanelScrollTP.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
function h = buildPanelScrollTP(h,p)

% defaults
hedit0 = 20;
htxt0 = 13;
hpop0 = 22;
fact = 5;
ttl1 = 'Plot';
ttl2 = 'Sub-images';
ttl3 = 'Background correction';
ttl4 = 'Cross-talks';
ttl5 = 'Factor corrections';
ttl6 = 'Denoising';
ttl7 = 'Photobleaching';
ttl8 = 'Find states';

% parents
h_pan = h.uipanel_TP_scroll;

% dimensions
pospan = get(h_pan,'position');
wpan0 = pospan(3);
hpan1 = p.mgpan+htxt0+hpop0+p.mg/fact+htxt0+hpop0+p.mg/fact+htxt0+hedit0+...
p.mg+hedit0+p.mg;
hpan2 = p.mgpan+3*htxt0+p.mg/fact+htxt0+p.mg/fact+htxt0+hpop0+p.mg;
hpan3 = p.mgpan+htxt0+hpop0+p.mg/fact+htxt0+hedit0+p.mg/fact+hedit0+...
p.mg/fact+hedit0+p.mg;
hpan4 = p.mgpan+hpop0+p.mg/2+2*(htxt0+hpop0+p.mg/2)+p.mg/2;
hpan5 = p.mgpan+p.mg+p.mg/fact+hpop0+hedit0;
hpan6 = p.mgpan+p.mg+p.mg/fact+2*hpop0+2*htxt0;
hpan7 = p.mgpan+htxt0+hpop0+p.mg/fact+htxt0+hedit0+p.mg+p.mg/2;
hpan8 = p.mgpan+3*(htxt0+hpop0+p.mg)+htxt0+hedit0+p.mg/fact+hedit0+p.mg+...
htxt0+hpop0+p.mg;

% GUI
x = 0;
y = pospan(4)-hpan1;

h.uipanel_TP_plot = uipanel('parent',h_pan,'units',p.posun,...
'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',...
[x,y,wpan0,hpan1],'title',ttl1);
h = buildPanelTPplot(h,p);

y = y-p.mg-hpan2;

h.uipanel_TP_subImages = uipanel('parent',h_pan,'units',p.posun,...
'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',...
[x,y,wpan0,hpan2],'title',ttl2);
h = buildPanelTPsubImages(h,p);

y = y-p.mg-hpan3;

h.uipanel_TP_backgroundCorrection = uipanel('parent',h_pan,'units',...
p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold',...
'position',[x,y,wpan0,hpan3],'title',ttl3);
h = buildPanelTPbackgroundCorrection(h,p);

y = y-p.mg-hpan4;

h.uipanel_TP_crossTalks = uipanel('parent',h_pan,'units',p.posun,...
'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',...
[x,y,wpan0,hpan4],'title',ttl4);
h = buildPanelTPcrossTalks(h,p);

y = y-p.mg-hpan5;

h.uipanel_TP_denoising = uipanel('parent',h_pan,'units',p.posun,...
'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',...
[x,y,wpan0,hpan5],'title',ttl6);
h = buildPanelTPdenoising(h,p);

y = y-p.mg-hpan6;

h.uipanel_TP_photobleaching = uipanel('parent',h_pan,'units',p.posun,...
'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',...
[x,y,wpan0,hpan6],'title',ttl7);
h = buildPanelTPphotobleaching(h,p);

y = y-p.mg-hpan7;

h.uipanel_TP_factorCorrections = uipanel('parent',h_pan,'units',p.posun,...
'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',...
[x,y,wpan0,hpan7],'title',ttl5);
h = buildPanelTPfactorCorrections(h,p);

y = y-p.mg-hpan8;

h.uipanel_TP_findStates = uipanel('parent',h_pan,'units',p.posun,...
'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',...
[x,y,wpan0,hpan8],'title',ttl8);
h = buildPanelTPfindStates(h,p);
Loading

0 comments on commit f552d1c

Please sign in to comment.