trim_start_end

Function trim_start_end 

Source
pub fn trim_start_end<'a>(
    seq: &'a [u8],
    fwd_start: &[u8],
    fwd_end: &[u8],
) -> &'a [u8] 
Expand description

Trim a basecall sequence to the amplicon region defined by a primer pair.

Searches seq for fwd_start (forward primer) and fwd_end (reverse primer) using case-insensitive matching. Both orientations are tried: if the read is reverse-complemented, rc(fwd_end) anchors the left boundary and rc(fwd_start) anchors the right. The returned slice starts at the earliest primer match and ends just after the latest, so both primers are included. If a boundary primer is not found, the corresponding end of seq is used as a fallback, leaving that side untrimmed.