For Developers
NLA allows for adding custom tests to the codebase
Creating additional edge-level tests
Current tests are located in +nla/+edge/+test. This is also where any user-created custom tests
will need to be saved. All edge-level test objects must inherit from nla.edge.BaseTest
Test object
Result object
A result object must be defined for the test edge-level results. If no custom data fields are needed, then the object in
+nla/+edge/+result/Base.mmay be used and this step can be skipped. If a new result is needed, a permutation result inheriting+nla/+edge/+result/PermBasemust also be created- class edge.result.Base
Base class of results of edge-level analysis
- Parameters:
size – The size of the Trimatrix being analyzed
prob_max – The threshold for the p-value
- output(net_atlas, flags, prob_label)
Plotting method for the edge-level analysis results
- Parameters:
net_atlas – The network atlas of the data
flags – Options from the front-end for plotting
prob_label – Extra information appended to title of plot
Creating additional network-level tests
All custom created tests must be saved in +nla/+net/+test; the tests present can also be used as templates.
All network-level results must fit into the NetworkTestResult object.
Since these tests are all different with different results and statistics, there is no base test to inherit. The only requirements are below
- Constant properties required
properties (Constant) name = "students_t" display_name = "Student's T-test" statistics = ["t_statistic", "single_sample_t_statistic"] ranking_statistic = "t_statistic" end
- name:
The name of the test with no special characters (spaces, &, etc)
- display_name:
A formal name that will be used for displaying in the GUI. Any string will work
- statistics:
All statistics that will be generated by the test. No special characters
- ranking_statistic:
The statistic used for ranking and calculating p-values. Note: if there is a single sample version of the statistic in addition to a two-sample statistic, the GUI will automatically add “single_sample_” during rankings for non-permuted and within network pair ranking.
A
runmethodresult = run(obj, test_options, edge_test_results, network_atlas, permutations)
- test_options:
Also called
input_structin edge-level tests. Parameters needed to run the test.- edge_test_results:
The output from the edge-level test.
- network_atlas:
A network atlas of the form
nla.NetworkAtlas- permutations:
Boolean to determine if the test is being run with permutations (
true) or without (false)- result:
requiredInputsSee Edge-level tests