Skip to content

Commit 9822f9e

Browse files
committed
tests docs
1 parent 95d1f78 commit 9822f9e

2 files changed

Lines changed: 104 additions & 0 deletions

File tree

docs/source/edge_level_tests.rst

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,64 @@ Provided Tests
7676
Creating additional edge-level tests
7777
-----------------------------------------------
7878

79+
Creating an edge-level test
80+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
81+
82+
1. All test objects must inherit from the ``nla.edge.test.Base`` class.
83+
2. All test objects must be saved into the ``+nla/+edge/+test`` directory
84+
3. There are a few required properties and methods that are required:
85+
86+
* **name**
87+
* All tests must be given a name. Example::
88+
89+
properties (Constant)
90+
name = "Kendall's tau"
91+
end
92+
93+
* **result**
94+
* This is a method. The function handle is::
95+
96+
function result = run(obj, test_options)
97+
98+
* **test_options**
99+
* This is a structure with options that are used either in the test or visualizing results
100+
101+
* **requiredInputs**
102+
* This is a static function to define the inputs for the test::
103+
104+
methods (Static)
105+
function inputs = requiredInputs()
106+
inputs = {nla.inputField.Number('prob_max', 'P <', 0, 0.05, 1), nla.inputField.NetworkAtlas(), nla.inputField.Behavior()};
107+
end
108+
end
109+
110+
* 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.
111+
* These are all required. If the user does not supply them, the test not run in the GUI.
112+
113+
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.
114+
115+
In addition to creating the test, a result object will also need to be created.
116+
117+
Creating a result
118+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
119+
120+
1. ``nla.edge.BaseResult`` will work if custom data fields are not required.
121+
2. The result must inherit from ``nla.edge.BaseResult``
122+
3. This result must be placed in ``+nla/+edge/+result/``
123+
4. Methods and properties
124+
125+
* **output**
126+
* This is the data that will be passed to create a figure of the data::
127+
128+
function output(obj, network_atlas, flags)
129+
130+
* Network atlas :ref:`NetworkAtas() <network_atlases>`
131+
* flags - a MATLAB structure that currently only has a field ``display_sig`` which is a boolean to determine if displayed p-values are thresholded
132+
133+
* **merge**
134+
* This is an optional method
135+
* It is used to merge blocks of results together (like in a parallel processing environment)::
136+
137+
function merge(obj, results)
138+
139+
* The ``results`` argument is a result to merge the object with. Afterwards, the current object will be the two merged blocks
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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**

0 commit comments

Comments
 (0)