pub trait ErrorModel {
// Required method
fn error_probability(&self, cycle: usize, read_end: ReadEnd) -> f64;
// Provided method
fn base_quality_phred33(&self, cycle: usize, read_end: ReadEnd) -> u8 { ... }
}Expand description
Trait for position-dependent sequencing error models.
Implementors produce an error probability for each cycle position, allowing realistic simulation of position-dependent error rates. The trait is the extensibility point for future platform support (Element, Ultima, etc.).
Required Methods§
Sourcefn error_probability(&self, cycle: usize, read_end: ReadEnd) -> f64
fn error_probability(&self, cycle: usize, read_end: ReadEnd) -> f64
Return the probability of a sequencing error at the given cycle position (0-based) for the given read end.
Provided Methods§
Sourcefn base_quality_phred33(&self, cycle: usize, read_end: ReadEnd) -> u8
fn base_quality_phred33(&self, cycle: usize, read_end: ReadEnd) -> u8
Return the Phred+33 base quality score for the given cycle and read end (before per-base noise).
The default implementation computes Q = -10*log10(p_err) clamped to
[2, 41] and adds the Phred+33 offset. Implementors may override this
with a precomputed lookup for speed.