use std::collections::HashMap;
use serde::{Serialize, Deserialize};
#[derive(Debug, Clone)]
pub struct RecombinationResult {
pub is_recombination: bool,
pub confidence_score: f64, pub method_specific_data: HashMap<String, String>,
pub statistical_significance: Option<f64>, pub distance_forward: Option<usize>,
pub distance_reverse_complement: Option<usize>,
pub best_distance: usize,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct RecombinationDetectorConfig {
pub detector_type: String,
pub parameters: HashMap<String, String>,
pub bidirectional_alignment: bool,
}
pub trait RecombinationDetector: Send + Sync {
fn name(&self) -> &'static str;
fn description(&self) -> &'static str;
fn detect(
&self,
seq1: &[u8],
seq2: &[u8],
locus: &str,
distance_forward: usize,
distance_reverse_complement: Option<usize>
) -> RecombinationResult;
fn get_config(&self) -> RecombinationDetectorConfig;
fn requires_bidirectional(&self) -> bool;
fn validate_config(config_str: &str) -> Result<(), String> where Self: Sized;
}
pub mod threshold;
pub mod phi_test;
pub mod rm_ratio;
pub mod factory;
pub use threshold::ThresholdDetector;
pub use phi_test::PhiTestDetector;
pub use rm_ratio::RMRatioDetector;
pub use factory::RecombinationDetectorFactory;