Function: computeFDRThreshold()
ts
function computeFDRThreshold(pValues, q): FDRResult;Defined in: src/utils/statistics.ts:54
Computes FDR threshold using the Benjamini-Hochberg procedure.
Algorithm:
- Sort p-values in ascending order
- For each rank i (1-indexed): criticalValue = (i / V) * q
- Find the largest i where pValues[i] <= criticalValue
- All p-values <= this threshold survive
Time complexity: O(V log V) due to sorting Space complexity: O(V) for sorted indices
Parameters
pValues
Float32Array
Array of p-values (one per vertex)
q
number
False discovery rate (typically 0.05)
Returns
FDR result with threshold, mask, and surviving count
Throws
If q is not in (0, 1]