Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
joadwe committed Sep 21, 2021
1 parent 3b582c8 commit 606265d
Show file tree
Hide file tree
Showing 11 changed files with 142 additions and 73 deletions.
Binary file modified Import_GUI.mlapp
Binary file not shown.
2 changes: 1 addition & 1 deletion MPAPASS_Developer_Access.m
Expand Up @@ -3,7 +3,7 @@
Selection = getpref('MPAPASS','DeveloperAcess');

app.TestMenu.Visible = Selection;
app.PreferencesMenu.Visible = Selection;
app.PreferencesMenu.Visible = 'on';
app.MergeMenu.Visible = Selection;

app.ThresholdDropDown.Visible = Selection;
Expand Down
168 changes: 111 additions & 57 deletions MPAPASS_FigureProperties.m
@@ -1,69 +1,123 @@
function [app] = MPAPASS_FigureProperties(app)

% figure position
switch getpref('MPAPASS','GlobalFigure_FigureOutputSize')
case 'Auto'
switch get(gcf,'Tag')
case 'boxplot'
set(gcf, 'Units','Normalized','position',[0 0.5 1 0.5]);
otherwise
set(gcf, 'Units','Normalized','position',[0 0 1 1]);
end
case 'Manual'
pos = getpref('MPAPASS','GlobalFigure_FigureOutputDim');
set(gcf, 'Units','pixels','position',[0 0 pos]);
set(gcf, 'color', getpref('MPAPASS','GlobalFigure_FigureBackground'))
% get all figure handles
figHandles = findall(groot, 'Type', 'figure');
for i = 1:numel(figHandles)
figvis(i) = figHandles(i).Visible;
end

plot = gcf;
% if a new figure is being plotted apply to only it, otherwise apply to all
visInd = figvis=='off';
if max(visInd) == 1
gcfhandles = figHandles(visInd);
else
gcfhandles = figHandles;
end

if numel(plot.Children) == 1
switch plot.Children.Type
case 'tiledlayout'
subplots = plot.Children;
otherwise
subplots = plot;
end
% remove the GUI from figures being modified
for i = 1:numel(gcfhandles)
ind(i) = strcmp(gcfhandles(i).Name,'MPAPASS');
end
gcfhandles = gcfhandles(~ind);

for i = 1:numel(plot.Children)
try
Fig = subplots.Children(i);
% axes properties
Fig.FontSize = getpref('MPAPASS','GlobalFigure_AxesFontSize');
Fig.FontName = getpref('MPAPASS','GlobalFigure_LabelFontStyle');
switch getpref('MPAPASS','GlobalFigure_AxesFontBold')
case 'off'
Fig.FontWeight = 'normal';
case 'on'
Fig.FontWeight = 'bold';
end

% label properties
Fig.XLabel.FontSize = getpref('MPAPASS','GlobalFigure_LabelFontSize');
Fig.YLabel.FontSize = getpref('MPAPASS','GlobalFigure_LabelFontSize');
Fig.XLabel.FontName = getpref('MPAPASS','GlobalFigure_LabelFontStyle');
Fig.YLabel.FontName = getpref('MPAPASS','GlobalFigure_LabelFontStyle');

switch getpref('MPAPASS','GlobalFigure_LabelFontBold')
case 'off'
Fig.XLabel.FontWeight = 'normal';
Fig.YLabel.FontWeight = 'normal';
case 'on'
Fig.XLabel.FontWeight = 'bold';
Fig.YLabel.FontWeight = 'bold';
for ii = 1:numel(gcfhandles)
plot = gcfhandles(ii);

% figure position
switch getpref('MPAPASS','GlobalFigure_FigureOutputSize')
case 'Auto'
switch get(plot,'Tag')
case 'boxplot'
set(plot, 'Units','Normalized','position',[0 0.5 1 0.5]);
otherwise
set(plot, 'Units','Normalized','position',[0 0 1 1]);
end
case 'Manual'
pos = getpref('MPAPASS','GlobalFigure_FigureOutputDim');
set(gcfhandles(ii), 'Units','pixels','position',[0 0 pos]);
set(gcfhandles(ii), 'color', getpref('MPAPASS','GlobalFigure_FigureBackground'))
end

if numel(plot.Children) == 1
switch plot.Children.Type
case 'tiledlayout'
subplots = plot.Children;

% label properties
subplots.XLabel.FontSize = getpref('MPAPASS','GlobalFigure_LabelFontSize');
subplots.YLabel.FontSize = getpref('MPAPASS','GlobalFigure_LabelFontSize');
subplots.XLabel.FontName = getpref('MPAPASS','GlobalFigure_LabelFontStyle');
subplots.YLabel.FontName = getpref('MPAPASS','GlobalFigure_LabelFontStyle');

switch getpref('MPAPASS','GlobalFigure_LabelFontBold')
case 'off'
subplots.XLabel.FontWeight = 'normal';
subplots.YLabel.FontWeight = 'normal';
case 'on'
subplots.XLabel.FontWeight = 'bold';
subplots.YLabel.FontWeight = 'bold';
end

% title properties
subplots.Title.FontSize = getpref('MPAPASS','GlobalFigure_TitleFontSize');
subplots.Title.FontName = getpref('MPAPASS','GlobalFigure_LabelFontStyle');
switch getpref('MPAPASS','GlobalFigure_TitleFontBold')
case 'off'
subplots.Title.FontWeight = 'normal';
case 'on'
subplots.Title.FontWeight = 'bold';
end


otherwise
subplots = plot;
end

% title properties
Fig.Title.FontSize = getpref('MPAPASS','GlobalFigure_LabelFontSize');
Fig.Title.FontName = getpref('MPAPASS','GlobalFigure_LabelFontStyle');
switch getpref('MPAPASS','GlobalFigure_LabelFontBold')
case 'off'
Fig.Title.FontWeight = 'normal';
case 'on'
Fig.Title.FontWeight = 'bold';
end

for i = 1:numel(subplots.Children)
try
Type = subplots.Children(i).Type;
switch Type
case 'legend'
otherwise
Fig = subplots.Children(i);
% axes properties
Fig.FontSize = getpref('MPAPASS','GlobalFigure_AxesFontSize');
Fig.FontName = getpref('MPAPASS','GlobalFigure_LabelFontStyle');
switch getpref('MPAPASS','GlobalFigure_AxesFontBold')
case 'off'
Fig.FontWeight = 'normal';
case 'on'
Fig.FontWeight = 'bold';
end

% label properties
Fig.XLabel.FontSize = getpref('MPAPASS','GlobalFigure_LabelFontSize');
Fig.YLabel.FontSize = getpref('MPAPASS','GlobalFigure_LabelFontSize');
Fig.XLabel.FontName = getpref('MPAPASS','GlobalFigure_LabelFontStyle');
Fig.YLabel.FontName = getpref('MPAPASS','GlobalFigure_LabelFontStyle');

switch getpref('MPAPASS','GlobalFigure_LabelFontBold')
case 'off'
Fig.XLabel.FontWeight = 'normal';
Fig.YLabel.FontWeight = 'normal';
case 'on'
Fig.XLabel.FontWeight = 'bold';
Fig.YLabel.FontWeight = 'bold';
end

% title properties
Fig.Title.FontSize = getpref('MPAPASS','GlobalFigure_TitleFontSize');
Fig.Title.FontName = getpref('MPAPASS','GlobalFigure_TitleFontStyle');
switch getpref('MPAPASS','GlobalFigure_TitleFontBold')
case 'off'
Fig.Title.FontWeight = 'normal';
case 'on'
Fig.Title.FontWeight = 'bold';
end
end
catch
end
catch
end
end
end
Binary file modified MPAPASS_Pref_GUI.mlapp
Binary file not shown.
17 changes: 16 additions & 1 deletion MPAPASS_Preference_Check.m
Expand Up @@ -36,7 +36,22 @@ function PrefVersionUpdate(Version)
'GlobalFigure_TitleFontBold', 'on';...
'GlobalFigure_FigureOutputSize','Auto'
'GlobalFigure_FigureOutputDim', [1280 720];...
'GlobalFigure_FigureBackground', [1 1 1]};
'GlobalFigure_FigureBackground', [1 1 1];...
'GlobalFigure_FigureColorOrder', {lines(7)};...

'GlobalFigure_defaultLabelFontStyle', 'Helvetica';...
'GlobalFigure_defaultLabelFontSize', 14;...
'GlobalFigure_defaultLabelFontBold', 'on';...
'GlobalFigure_defaultAxesFontSize', 12;...
'GlobalFigure_defaultAxesFontBold', 'off';...
'GlobalFigure_defaultTitleFontSize', 14;...
'GlobalFigure_defaultTitleFontBold', 'on';...
'GlobalFigure_defaultFigureOutputSize','Auto'
'GlobalFigure_defaultFigureOutputDim', [1280 720];...
'GlobalFigure_defaultFigureBackground', [1 1 1];...
'GlobalFigure_defaultFigureColorOrder', {lines(7)};...
'DatabaseExportFormat', '.mat'};


for i = 1:size(Prefs,1)
if ispref('MPAPASS',Prefs{i,1})
Expand Down
8 changes: 6 additions & 2 deletions MPAPASS_SoftwareUpdates.m
Expand Up @@ -2,7 +2,7 @@

d = uiprogressdlg(app.MPAPASS,'Title','Checking for updates',...
'Indeterminate','on');

try
url = 'https://nano.ccr.cancer.gov/mpapass';
text = webread(url);
ind = strfind(text,'v1.');
Expand All @@ -13,7 +13,7 @@

close(d)
if app.version < max(versions)
selection = uiconfirm(app.MPAPASS,'There is a new version of FCMPASS. Would you like to download now?','Software update','options',{'Ok','Later'},...
selection = uiconfirm(app.MPAPASS,'There is a new version of MPAPASS. Would you like to download now?','Software update','options',{'Ok','Later'},...
'Icon','warning');
switch selection
case 'Ok'
Expand All @@ -24,4 +24,8 @@
else
uialert(app.MPAPASS,'Your software is the current version','Software update','Icon','success');
end
catch
uialert(app.MPAPASS,'Unable to connect to website to check for software updates','Software update','Icon','warning');

end
end
Binary file modified MPA_Master_GUI.mlapp
Binary file not shown.
2 changes: 1 addition & 1 deletion MPA_SampleIndex_v4.m
Expand Up @@ -25,7 +25,7 @@
SampleTable = Database.Sample(:, TableHeaders); % shrink table to selectable GUI variables

SampleInd = logical(ones(size(SampleTable,1),1));
for i = 1:size(SampleTable,2)
for i = 1:size(SampleTable,2)-2

SampleTable.(ListboxHeaders{i}) = categorical(SampleTable.(ListboxHeaders{i}));

Expand Down
16 changes: 7 additions & 9 deletions MPA_boxplot.m
Expand Up @@ -46,7 +46,8 @@
ord2 = 1:size(PlotData,1);
end

col = lines(numel(i1));
Colors = repmat(BPInfo.ColorOrder{1}, ceil(numel(i1)/7),1);
col = Colors(1:numel(i1),:);
col = [col repmat(BPInfo.FaceAlpha,size(col,1),1)];
Space = 0.4/1+numel(i1);
Gap = BPInfo.Spacing/2;
Expand Down Expand Up @@ -84,7 +85,7 @@
line([FactorGap(ii) FactorGap(ii+1)], [Y{ii}(ord2(i),5) Y{ii}(ord2(i),5)], 'LineWidth',1, 'Color','k')
line([center center], [Y{ii}(ord2(i),1) Y{ii}(ord2(i),2)], 'LineWidth',1, 'Color','k')
line([center center], [Y{ii}(ord2(i),5) Y{ii}(ord2(i),4)], 'LineWidth',1, 'Color','k')

otherwise
end
case 'Scatter'
Expand All @@ -99,8 +100,8 @@
yData = sort(Data(i,:));
scatter(xData, yData, 20, 'filled', 'MarkerFaceColor',col(ii,1:3),'MarkerEdgeColor','k')
hold on
line([FactorGap(ii) FactorGap(ii+1)], [Y{ii}(ord2(i),3) Y{ii}(ord2(i),3)], 'LineWidth',2, 'Color','k')

line([FactorGap(ii) FactorGap(ii+1)], [Y{ii}(ord2(i),3) Y{ii}(ord2(i),3)], 'LineWidth',2, 'Color','k')
case 'Box + Scatter'

R_B = FactorGap(ii); % bottom
Expand All @@ -115,17 +116,15 @@
rectangle('Position',[R_B R_L R_R R_T], 'FaceColor','none', 'EdgeColor','k','LineWidth',0.75);
hold on
line([FactorGap(ii) FactorGap(ii+1)], [Y{ii}(ord2(i),3) Y{ii}(ord2(i),3)], 'LineWidth',1, 'Color','k')

center = (R_B+(R_R/2));

xData = normrnd(center,0.025,[1 size(Data,2)]);
yData = sort(Data(i,:));
scatter(xData, yData, 40, 'filled', 'MarkerFaceColor',col(ii,1:3),'MarkerEdgeColor','k','LineWidth',0.1,'MarkerEdgeAlpha',0.5)
hold on

% xdata = repmat(FactorGap(ii)+0.5, size(RawGroup{ii}, ))

% scatter()

end

end
Expand Down Expand Up @@ -162,7 +161,6 @@
for ii = 1:numel(i1)
hline(ii) = patch([NaN,NaN NaN NaN],[NaN NaN NaN NaN],col(ii,:),'LineWidth',1,'LineStyle','-');
hline(ii).FaceColor = col(ii,1:3);
hline(ii).FaceAlpha = 0.5;
end

switch BPInfo.Orientation
Expand Down
2 changes: 0 additions & 2 deletions README.md
Expand Up @@ -9,8 +9,6 @@ Protocols for using the software can be found at https://nano.ccr.cancer.gov/pro

A fully compiled version of the software with no dependencies can be found at: https://nano.ccr.cancer.gov/mpapass

MATLAB users can also install through FileExchange <br> [![View MPAPASS - EV Multiplex Software on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/80936-mpapass-ev-multiplex-software)

Source code dependencies:
* MATLAB v2020b
* Statistics and Machine Learning Toolbox
Expand Down
Binary file added untitled.tif
Binary file not shown.

0 comments on commit 606265d

Please sign in to comment.