MCPcopy Index your code
hub / github.com/SingleRust/SingleRust / apply_correction

Function apply_correction

src/memory/processing/diffexp/mod.rs:983–995  ·  view source on GitHub ↗

Apply multiple testing correction to a vector of p-values. Converts p-values to the appropriate numeric type and applies the specified correction method. All correction methods are implemented in the `single_statistics` crate with well-tested algorithms. # Arguments `p_value` - Raw p-values to correct `method` - Multiple testing correction method to apply # Returns Vector of corrected p-values

(p_value: &[T], method: CorrectionMethod)

Source from the content-addressed store, hash-verified

981/// - **Hochberg**: Requires independence assumption
982/// - **Storey Q-value**: Provides q-value estimates
983fn apply_correction<T>(p_value: &[T], method: CorrectionMethod) -> anyhow::Result<Vec<T>>
984where
985 T: FloatOps,
986{
987 match method {
988 CorrectionMethod::Bonferroni => bonferroni_correction(p_value),
989 CorrectionMethod::BejaminiHochberg => benjamini_hochberg_correction(p_value),
990 CorrectionMethod::BenjaminiYekutieli => benjamini_yekutieli_correction(p_value),
991 CorrectionMethod::HolmBonferroni => holm_bonferroni_correction(p_value),
992 CorrectionMethod::Hochberg => hochberg_correction(p_value),
993 CorrectionMethod::StoreyQValue => storey_qvalues(p_value, T::from(0.5).unwrap()),
994 }
995}
996
997#[allow(clippy::too_many_arguments)]
998fn store_results(

Callers 1

run_tests_for_groupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected