Skip to main content

Module fragment

Module fragment 

Source
Expand description

Fragment extraction and read base generation.

Handles extracting genomic fragments from haplotypes, reverse-complement operations, adapter sequence appending for short fragments, and R1/R2 base extraction from fragments.

§Lowercase-as-marker convention

crate::fasta::Fasta::load_contig stores bases resolved from IUPAC ambiguity codes (including N) in lowercase, while real A/C/G/T bases remain uppercase. Reads that carry those synthesized bases through from the reference can be detected by counting lowercase bytes via lowercase_fraction, and the buffers are upper-cased in place with uppercase_in_place before being emitted.

Structs§

Fragment
A simulated fragment extracted from a haplotype.

Functions§

extract_fragment
Extract a fragment from a haplotype at a given position and strand.
extract_read_bases
Extract read bases from a fragment, handling adapter sequences for short fragments.
lowercase_fraction
Fraction of lowercase ASCII bytes in bases.
reverse_complement
Reverse-complement a DNA sequence in place.
uppercase_in_place
Upper-case every ASCII letter in bases in place.