Skip to content

Commit a8d3f4c

Browse files
authored
Merge branch 'master' into development
2 parents 3ed27ec + 585b51d commit a8d3f4c

4 files changed

Lines changed: 117 additions & 6 deletions

File tree

+nla/NetworkAtlas.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
% :param parcels: Optional MATLAB struct field for surface parcellations. Contains two sub-fields ``ctx_l`` and ``ctx_r``. N\ :sub:`verts`\ x 1 vectors. Each element of a vector corresponds to a vertex within the spatial mesh and contains the index of the ROI for that vertex.
1212
% :param space: Optional The mesh that the atlas` ROI locations/parcels are in. Two options - ``TT`` or ``MNI``
1313

14-
15-
properties
16-
nets
14+
properties (SetAccess = private)
15+
nets % This is the net_names
16+
1717
ROIs
1818
ROI_order
1919
name

.github/workflows/run_matlab_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
uses: matlab-actions/run-command@v2
2828
with:
2929
command: addpath(genpath(pwd)); results = runTests(); assertSuccess(results)
30-
use-parallel: true
30+
use-parallel: true

docs/source/edge_level_tests.rst

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,64 @@ Provided Tests
7373
:Permuted p: ``.mat`` file containing N\ :sub:`ROI_pairs`\ x N\ :sub:`permutations`\ of logical values. Observed, thresholded, permuted p-values.
7474
:Permuted coeff: ``.mat`` file containing N\ :sub:`ROI_pairs`\ x N\ :sub:`permutations`\ of permuted edge-level coefficients.
7575

76-
Creating additional edge-level tests
77-
-----------------------------------------------
76+
Creating an edge-level test
77+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7878

79+
1. All test objects must inherit from the ``nla.edge.test.Base`` class.
80+
2. All test objects must be saved into the ``+nla/+edge/+test`` directory
81+
3. There are a few required properties and methods that are required:
82+
83+
* **name**
84+
* All tests must be given a name. Example::
85+
86+
properties (Constant)
87+
name = "Kendall's tau"
88+
end
89+
90+
* **result**
91+
* This is a method. The function handle is::
92+
93+
function result = run(obj, test_options)
94+
95+
* **test_options**
96+
* This is a structure with options that are used either in the test or visualizing results
97+
98+
* **requiredInputs**
99+
* This is a static function to define the inputs for the test::
100+
101+
methods (Static)
102+
function inputs = requiredInputs()
103+
inputs = {nla.inputField.Number('prob_max', 'P <', 0, 0.05, 1), nla.inputField.NetworkAtlas(), nla.inputField.Behavior()};
104+
end
105+
end
106+
107+
* This defines a number field ``prob_max`` from [0, 1] with a default of 0.05. It also specifies a network atlas (:ref:`NetworkAtlas() <network_atlases>` input field, and a behavior input field.
108+
* These are all required. If the user does not supply them, the test not run in the GUI.
109+
110+
4. If the test is located in the correct folder, after a GUI restart (not MATLAB GUI) the test will populate in the Edge Level test list.
111+
112+
In addition to creating the test, a result object will also need to be created.
113+
114+
Creating a result
115+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
116+
117+
1. ``nla.edge.BaseResult`` will work if custom data fields are not required.
118+
2. The result must inherit from ``nla.edge.BaseResult``
119+
3. This result must be placed in ``+nla/+edge/+result/``
120+
4. Methods and properties
121+
122+
* **output**
123+
* This is the data that will be passed to create a figure of the data::
124+
125+
function output(obj, network_atlas, flags)
126+
127+
* Network atlas :ref:`NetworkAtas() <network_atlases>`
128+
* flags - a MATLAB structure that currently only has a field ``display_sig`` which is a boolean to determine if displayed p-values are thresholded
129+
130+
* **merge**
131+
* This is an optional method
132+
* It is used to merge blocks of results together (like in a parallel processing environment)::
133+
134+
function merge(obj, results)
135+
136+
* The ``results`` argument is a result to merge the object with. Afterwards, the current object will be the two merged blocks
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
Network-level Statistical Tests
2+
======================================
3+
4+
Methods
5+
--------------------------
6+
7+
The non-permuted method measures how significant each network is compared to the entire connectome using
8+
the given statistical test.
9+
10+
The full connectome method ranks the non-permuted (observed) significance of each network against the
11+
significance of the same network calculated over many permutations using the same test.
12+
I DON"T KNOW HOW TO EXPLAIN THE PROBABILITY BEING CALCULATED - Jim
13+
14+
The within network-pair method measures how significant each network is compared to all permutations of
15+
only the selected network.
16+
17+
Common Inputs
18+
------------------------
19+
20+
:P: Network level p-value threshold
21+
:Behavior Count: Number of different behavior vectors intended to test.
22+
23+
Provided Tests
24+
---------------------------
25+
26+
* **Hypergeomtric**
27+
28+
* MATLAB's `hypercdf <https://www.mathworks.com/help/stats/hygecdf.html>` used to find the probablity
29+
* **Chi-squred**
30+
31+
* Runs a :math:`\chi`\ :sup:`2` test.
32+
33+
.. math::
34+
35+
\chi^2 = \sum_{n=1}^n \frac{O_i - E_i)^2}{E_i}
36+
37+
* **Kolmogorov-Smirnov**
38+
39+
* MATLAB's `kstest2 <https://www.mathworks.com/help/stats/kstest2.html>`
40+
* **Wilcoxon**
41+
42+
* MATLAB's `ranksum <https://www.mathworks.com/help/stats/ranksum.html>`
43+
* **Welch's t-test**
44+
45+
* Uses a modified version of MATLAB's t-test found in `+nla/WelchT`
46+
47+
.. math::
48+
49+
t = \frac{\overline{X_1} - \overline{X_2}}{\sqrt{s_{\overline{X_1}}^2 - s_{\overline{X_2}}^2}}
50+
where
51+
s_{\overline{X_i}} = \frac{s_i}{\sqrt{N_i}}
52+
53+
*

0 commit comments

Comments
 (0)