tramarobin / fctSnPM

Using spm1d package (v.0.4.3), compute anova and post-hoc tests from anova1 to anova3rm, with a non-parametric approach (permutation tests)
GNU General Public License v3.0
2 stars 2 forks source link

[JOSS Review] Suggestion: improve file output options #6

Closed 0todd0000 closed 3 years ago

0todd0000 commented 3 years ago

Please consider:

tramarobin commented 3 years ago

When a savedir is not specified (default option), a dialog box opens to create/chose a directory. If the directory is not empty, a dialog box ask if the user want to overwrote files (might delete previous analysis or just add new folders). In case a save directory is specified, the function will overwrite files. I let the function does this in case multiples tests are performed within a for loop and the user need to let the computer runs several ours without intervention.

In case of complexe analysis (ANOVA3), several hundreds of figures can be created (1.4 Go in one of the example) and it might be difficult to just display the figures instead of saving them. However, doAllInteractions input can be employed to limit the analysis to the significant effects according to the ANOVA. This might reduce the time and storage.

0todd0000 commented 3 years ago

When a savedir is not specified (default option), a dialog box opens to create/chose a directory.

OK, this is good. In this case, please ensure that this default behavior exists in all example scripts. Some use savedir=[];, but others specify a directory. No example script should create files or folders without the user's permission.

In case of complexe analysis (ANOVA3), several hundreds of figures can be created.

It seems non-ideal to generate hundreds of figures for a single hypothesis test. However, this is a stylistic choice and not directly relevant to the purpose of the package, so I will not request any changes if this indeed the desired behavior.

tramarobin commented 3 years ago

The savedir = [] was modified on all examples.

The default size and resolution of figures were modified (see issue #4). The time and storage in the description of the script were the one when the outputs were saved on the same hard drive, in other location. There will be differences between users but it gives a general idea of how long it will take.

0todd0000 commented 3 years ago

OK, thank you.

"D1_ANOVA1rm.m" now runs in 30 s on my PC, and the results are 7.5 MB (compared to the previous 742 MB).

tramarobin commented 3 years ago

I know we have closed this issue but I have consider your point of view on the outputs. The following functions are not yet implemented as we have other important issues to resolve before, but I think it would be relevant to add them once we agreed on the statistical analysis.

Firstly I add a variable output to fctSPM. spmAnalysis contains the anova.mat and posthoc.mat in a form of a structure.

The general usage is now:

spmAnalysis=fctSPM(data, independantEffects, repeatedMeasuresEffects, varargin)

Nothing changed except that this output replaces the previously saved anova.mat and posthoc.mat. Note that this output is automatically save at savedir.

I created two other functions: fctSPMS performs the same analysis than fctSPM, however, the figures are not ploted and saved. The inputs are the same at the exception that there is no savedir and no plot parameters. saveNplot permits to save and plot the analysis obtain with fctSPM and fctSPMS.

The general use of these funtion are :

spmAnalysis=fctSPMS(data, independantEffects, repeatedMeasuresEffects, 'Optional Input Name', value)
saveNplot(spmAnalysis,'Optional Input Name', value)

The analysis with fctSPMS is way faster than fctSPM. It may be useful to use saveNplot when a 2D analysis is performed, as it permits to redo quickly figures without the long time of computing for the 2D analysis. This function is less relevant in 1D as some of the plot can't be done. Besides, 1D analysis is shorter and there is only a little gain in time. So I will suggest to keep with fctSPM in 1D.

0todd0000 commented 3 years ago

Nothing changed except that this output replaces the previously saved anova.mat and posthoc.mat.

This sounds like a nice solution.

*fctSPMS performs the same analysis than fctSPM, however, the figures are not ploted and saved. The inputs are the same at the exception that there is no savedir and no plot parameters.

I just tested this, it runs quite quickly (< 2 s). I expect that users who seek flexibility will greatly appreciate this functionality.

Thank you very much for these changes, all are satisfactory.