pub struct IlluminaErrorModel { /* private fields */ }Expand description
Illumina-style position-dependent error model.
Error rate starts at min_error_rate for early cycles and linearly ramps
to max_error_rate by the last cycle. The ramp begins at approximately
70% of the read length, mimicking the quality decay caused by phasing and
dephasing in Illumina sequencing.
Read 2 has a higher error rate than read 1 (controlled by
r2_multiplier), reflecting the typically worse quality of the second
read in a pair.
Error probabilities and base quality scores are precomputed at construction time for each cycle and read end, so the per-base hot path is a table lookup rather than repeated floating-point math.
Implementations§
Source§impl IlluminaErrorModel
impl IlluminaErrorModel
Sourcepub fn new(read_length: usize, min_error_rate: f64, max_error_rate: f64) -> Self
pub fn new(read_length: usize, min_error_rate: f64, max_error_rate: f64) -> Self
Create a new Illumina error model with default R2 multiplier (1.5x).
§Arguments
read_length— Number of cycles (bases) per read.min_error_rate— Per-base error rate at the start of reads.max_error_rate— Per-base error rate at the end of reads.
§Panics
Panics if read_length is 0 or if min_error_rate > max_error_rate.
Sourcepub fn with_r2_multiplier(
read_length: usize,
min_error_rate: f64,
max_error_rate: f64,
r2_multiplier: f64,
) -> Self
pub fn with_r2_multiplier( read_length: usize, min_error_rate: f64, max_error_rate: f64, r2_multiplier: f64, ) -> Self
Create a new Illumina error model with a custom R2 multiplier.
The r2_multiplier scales the entire error curve for read 2 relative
to read 1. A value of 1.0 means R1 and R2 have identical error rates.
§Panics
Panics if read_length is 0 or if min_error_rate > max_error_rate.