Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified +nla/+net/+result/+plot/NetworkTestPlotApp.mlapp
Binary file not shown.
101 changes: 53 additions & 48 deletions +nla/+net/+result/+plot/NetworkTestPlotApp_exported.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,36 @@
UIFigure matlab.ui.Figure
Menu matlab.ui.container.Menu
SaveasMenu matlab.ui.container.Menu
Panel_2 matlab.ui.container.Panel
Panel matlab.ui.container.Panel
PlotScaleDropDownLabel matlab.ui.control.Label
PlotScaleDropDown matlab.ui.control.DropDown
UpperLimitEditFieldLabel matlab.ui.control.Label
UpperLimitEditField matlab.ui.control.NumericEditField
LowerLimitEditFieldLabel matlab.ui.control.Label
LowerLimitEditField matlab.ui.control.NumericEditField
pvalueThresholdEditFieldLabel matlab.ui.control.Label
pvalueThresholdEditField matlab.ui.control.NumericEditField
CohensDThresholdEditFieldLabel matlab.ui.control.Label
CohensDThresholdEditField matlab.ui.control.NumericEditField
ColormapDropDownLabel matlab.ui.control.Label
ColormapDropDown matlab.ui.control.DropDown
LegendVisibleDropDownLabel matlab.ui.control.Label
LegendVisibleDropDown matlab.ui.control.DropDown
MultipleComparisonCorrectionDropDownLabel matlab.ui.control.Label
MultipleComparisonCorrectionDropDown matlab.ui.control.DropDown
CohensDThresholdCheckBox matlab.ui.control.CheckBox
ROIcentroidsonbrainplotsCheckBox matlab.ui.control.CheckBox
ViewChordPlotsButton matlab.ui.control.Button
ViewEdgeChordPlotsButton matlab.ui.control.Button
EdgeChordPlotTypeDropDownLabel matlab.ui.control.Label
EdgeChordPlotTypeDropDown matlab.ui.control.DropDown
ViewConvergenceMapButton matlab.ui.control.Button
ConvergencePlotColorDropDownLabel matlab.ui.control.Label
ConvergencePlotColorDropDown matlab.ui.control.DropDown
ApplyButton matlab.ui.control.Button
PlotValueDropDownLabel matlab.ui.control.Label
PlotValueDropDown matlab.ui.control.DropDown
Panel_2 matlab.ui.container.Panel
PlotValueDropDownLabel matlab.ui.control.Label
ApplyButton matlab.ui.control.Button
ConvergencePlotColorDropDown matlab.ui.control.DropDown
ConvergencePlotColorDropDownLabel matlab.ui.control.Label
ViewConvergenceMapButton matlab.ui.control.Button
EdgeChordPlotTypeDropDown matlab.ui.control.DropDown
EdgeChordPlotTypeDropDownLabel matlab.ui.control.Label
ViewEdgeChordPlotsButton matlab.ui.control.Button
ViewChordPlotsButton matlab.ui.control.Button
ROIcentroidsonbrainplotsCheckBox matlab.ui.control.CheckBox
CohensDThresholdCheckBox matlab.ui.control.CheckBox
MultipleComparisonCorrectionDropDown matlab.ui.control.DropDown
MultipleComparisonCorrectionDropDownLabel matlab.ui.control.Label
LegendVisibleDropDown matlab.ui.control.DropDown
LegendVisibleDropDownLabel matlab.ui.control.Label
ColormapDropDown matlab.ui.control.DropDown
ColormapDropDownLabel matlab.ui.control.Label
CohensDThresholdEditField matlab.ui.control.NumericEditField
CohensDThresholdEditFieldLabel matlab.ui.control.Label
pvalueThresholdEditField matlab.ui.control.NumericEditField
pvalueThresholdEditFieldLabel matlab.ui.control.Label
LowerLimitEditField matlab.ui.control.NumericEditField
LowerLimitEditFieldLabel matlab.ui.control.Label
UpperLimitEditField matlab.ui.control.NumericEditField
UpperLimitEditFieldLabel matlab.ui.control.Label
PlotScaleDropDown matlab.ui.control.DropDown
PlotScaleDropDownLabel matlab.ui.control.Label
end


Expand Down Expand Up @@ -96,20 +96,8 @@ function getPlotTitle(app)
app.save_plot_settings();
end

switch app.MultipleComparisonCorrectionDropDown.Value
case "Benjamini-Hochberg"
mcc = "BenjaminiHochberg";
case "Benjamini-Yekutieli"
mcc = "BenjaminiYekutieli";
case "Holm-Bonferroni"
mcc = "HolmBonferroni";
case "Freedman-Lane"
mcc = "FreedmanLane";
case "Westfall-Young"
mcc = "WestfallYoung";
otherwise
mcc = app.MultipleComparisonCorrectionDropDown.Value;
end
mccObj = app.getMCCObjectFromString(app.MultipleComparisonCorrectionDropDown.Value);

app.getPlotTitle();

if isequal(app.old_data, true)
Expand All @@ -123,7 +111,7 @@ function getPlotTitle(app)
app.parameters = nla.net.result.NetworkResultPlotParameter(app.network_test_result,...
app.edge_test_options.net_atlas, app.network_test_options);
probability_parameters = app.parameters.plotProbabilityParameters(app.edge_test_options, app.edge_test_result,...
app.test_method, probability, sprintf(app.title), mcc, app.createEffectSizeFilter(),...
app.test_method, probability, sprintf(app.title), mccObj, app.createEffectSizeFilter(),...
app.PlotValueDropDown.Value);

% if ~isequal(app.UpperLimitEditField.Value, 0.3) && ~isequal(app.LowerLimitEditField.Value, 0.3)
Expand Down Expand Up @@ -228,6 +216,23 @@ function hideCohensDControls(app)
app.CohensDThresholdEditFieldLabel.Visible = false;

end

function mccObj = getMCCObjectFromString(app, stringName)
switch stringName
case "Benjamini-Hochberg"
mccObj = nla.net.mcc.BenjaminiHochberg();
case "Benjamini-Yekutieli"
mccObj = nla.net.mcc.BenjaminiYekutieli();
case "Holm-Bonferroni"
mccObj = nla.net.mcc.HolmBonferroni();
case "Freedman-Lane"
mccObj = nla.net.mcc.FreedmanLane();
case "Westfall-Young"
mccObj = nla.net.mcc.WestfallYoung();
otherwise
mccObj = nla.net.mcc.None();
end
end
end


Expand Down Expand Up @@ -276,10 +281,12 @@ function drawChords(app, event)

plot_type = app.chord_type;

mccObj = app.getMCCObjectFromString(app.MultipleComparisonCorrectionDropDown.Value);

probability = NetworkTestResult().getPValueNames(app.test_method, app.network_test_result.test_name);
p_value = strcat("uncorrected_", probability);
probability_parameters = app.parameters.plotProbabilityParameters(app.edge_test_options, app.edge_test_result,...
app.test_method, p_value, sprintf(app.title), app.MultipleComparisonCorrectionDropDown.Value, app.createEffectSizeFilter(),...
app.test_method, p_value, sprintf(app.title), mccObj, app.createEffectSizeFilter(),...
app.PlotValueDropDown.Value);

chord_plotter = nla.net.result.chord.ChordPlotter(app.edge_test_options.net_atlas, app.edge_test_result);
Expand All @@ -288,10 +295,8 @@ function drawChords(app, event)
chord_plotter.generateChordFigure(probability_parameters, plot_type)
end

% Value changed function: ColormapDropDown,
% LegendVisibleDropDown, LowerLimitEditField,
% MultipleComparisonCorrectionDropDown, PlotScaleDropDown,
% UpperLimitEditField
% Value changed function: ColormapDropDown, LegendVisibleDropDown,
% ...and 4 other components
function PlotScaleValueChanged(app, event)
if isequal(app.settings, false)
app.settings = struct();
Expand Down
6 changes: 3 additions & 3 deletions +nla/+net/+result/NetworkResultPlotParameter.m
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ function brainFigureButtonCallback(network1, network2)
test_method = "within_network_pair";
end

switch lower(erase(fdr_correction, "-"))
case "freedmanlane"
switch fdr_correction.name
case "Freedman-Lane"
fdr_method = "freedman_lane_";
case "westfallyoung"
case "Westfall-Young"
fdr_method = "westfall_young_";
otherwise
fdr_method = "uncorrected_";
Expand Down
6 changes: 3 additions & 3 deletions +nla/+net/unittests/NetworkResultPlotParameterTestCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function plotProbabilityParametersDefaultPlottingTest(testCase)
probability = NetworkTestResult().getPValueNames("full_connectome", permutation_result.test_name);

probability_parameters = plot_parameters.plotProbabilityParameters(testCase.edge_test_options,...
testCase.edge_test_result, "full_connectome", probability, 'Title', "Bonferroni",...
testCase.edge_test_result, "full_connectome", probability, 'Title', nla.net.mcc.Bonferroni(),...
false, "nla.gfx.PlotValue.PVALUE");

expected_p_value_max = testCase.network_test_options.prob_max / testCase.network_atlas.numNetPairs();
Expand Down Expand Up @@ -119,7 +119,7 @@ function plotProbabilityParametersLogPlottingTest(testCase)
probability = NetworkTestResult().getPValueNames("full_connectome", permutation_result.test_name);

probability_parameters = plot_parameters.plotProbabilityParameters(testCase.edge_test_options,...
testCase.edge_test_result, "full_connectome", probability, 'Title', "Bonferroni",...
testCase.edge_test_result, "full_connectome", probability, 'Title', nla.net.mcc.Bonferroni(),...
false, "nla.gfx.PlotValue.PVALUE");

expected_p_value_max = testCase.network_test_options.prob_max / testCase.network_atlas.numNetPairs();
Expand Down Expand Up @@ -157,7 +157,7 @@ function plotProbabilityParametersNegLogTest(testCase)
probability = NetworkTestResult().getPValueNames("full_connectome", permutation_result.test_name);

probability_parameters = plot_parameters.plotProbabilityParameters(testCase.edge_test_options,...
testCase.edge_test_result, "full_connectome", probability, 'Title', "Bonferroni",...
testCase.edge_test_result, "full_connectome", probability, 'Title', nla.net.mcc.Bonferroni(),...
false, "nla.gfx.PlotValue.PVALUE");

expected_p_value_max = 2;
Expand Down
Loading