dual_threshold_optimization 2.0.1

Dual Threshold Optimization compares two ranked lists of features (e.g. genes) to determine the rank threshold for each list that minimizes the hypergeometric p-value of the overlap of features. It then calculates a permutation based empirical p-value and an FDR. Details can be found [in this paper](https://doi.org/10.1101/gr.259655.119)
Documentation
//! # Objects to represent the results of the optimization process.
use serde::{Deserialize, Serialize};

use crate::collections::Feature;

/// An enum to represent the gene1, gene2 sets output by optimize().
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub enum FeatureSets {
    Both(Vec<Feature>, Vec<Feature>),
    None,
}

/// An enum to represent the result of optimize().
#[derive(Clone, Debug, Serialize, Deserialize)]
pub enum OptimizationResult {
    Debug(Vec<OptimizationResultRecord>), // All results
    Best(OptimizationResultRecord),       // Single best result
}

/// A struct to record the result of optimize().
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub struct OptimizationResultRecord {
    pub rank1: usize,
    pub rank2: usize,
    pub set1_len: usize,
    pub set2_len: usize,
    pub population_size: u64,
    pub intersection_size: usize,
    pub pvalue: f64,
    pub permuted: bool,
    pub feature_sets: FeatureSets,
}