diff --git a/+nla/+net/+result/+plot/NetworkTestPlotApp.mlapp b/+nla/+net/+result/+plot/NetworkTestPlotApp.mlapp index 317585b..76077ab 100644 Binary files a/+nla/+net/+result/+plot/NetworkTestPlotApp.mlapp and b/+nla/+net/+result/+plot/NetworkTestPlotApp.mlapp differ diff --git a/+nla/+net/+result/+plot/NetworkTestPlotApp_exported.m b/+nla/+net/+result/+plot/NetworkTestPlotApp_exported.m index 1c7c565..c5f6773 100644 --- a/+nla/+net/+result/+plot/NetworkTestPlotApp_exported.m +++ b/+nla/+net/+result/+plot/NetworkTestPlotApp_exported.m @@ -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 @@ -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) @@ -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) @@ -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 @@ -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); @@ -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(); diff --git a/+nla/+net/+result/NetworkResultPlotParameter.m b/+nla/+net/+result/NetworkResultPlotParameter.m index 0d07581..835bae0 100644 --- a/+nla/+net/+result/NetworkResultPlotParameter.m +++ b/+nla/+net/+result/NetworkResultPlotParameter.m @@ -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_"; diff --git a/+nla/+net/unittests/NetworkResultPlotParameterTestCase.m b/+nla/+net/unittests/NetworkResultPlotParameterTestCase.m index d5f6525..90940b9 100644 --- a/+nla/+net/unittests/NetworkResultPlotParameterTestCase.m +++ b/+nla/+net/unittests/NetworkResultPlotParameterTestCase.m @@ -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(); @@ -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(); @@ -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;