From: gammaMAXT: a fast multiple-testing correction algorithm
(1) Compute the test-statistics for all pairs, but only store the n highest tests values. The result is a Real data |
vector where T 0,1≥T 0,2≥…≥T 0,n . |
(2) Initialise a vector p of size n with 1’s. |
(3) Perform the following operations for i=1,…,B: |
(a) Generate a random permutation of the trait column. |
(b) Compute T i,1,…,T i,n and store them in a Permutation i vector. |
(c) Compute the maximum M i of the test-statistics values T i,n+1,…,T i,m . |
(d) Replace T i,n by M i if T i,n <M i . |
(e) Force the monotonicity of the Permutation i vector: for j=n−1,…,1 replace T i,j by T i,j+1 if T i,j <T i,j+1. |
(f) For each j=1,…,n, if T i,j ≥T 0,j increment p j by one. |
(4) Divide all values of vector p by B+1 to obtain the p-values vector. Force monotonicity: for j=1,…,n−1, |
replace p j+1 by p j if p j+1<p j . |