mod table_io

module table_io

TSV table I/O for markers depth tables.

Functions

fn fast_parse_u16(bytes: &[u8]) -> u16

Fast integer parsing for non-negative integers (matching C++ fast_stoi). Saturates at u16::MAX instead of wrapping, to avoid silent corruption on high-depth tags (>65535 reads of one RAD marker in one individual).

Depth fields in RAD tables are almost always 1–3 ASCII digits; a short unrolled path avoids the saturating mul loop and its overflow branch for the common case (still saturates correctly for longer digit strings).

Structs and Unions

struct TableHeader

Header information parsed from a markers depth table.

n_markers: u64

Total number of markers (from the comment line).

n_individuals: u16

Number of individuals (columns - 2: id and sequence).

columns: Vec<String>

All column names from the header line.

Implementations

impl TableHeader

Functions

fn from_file(path: &Path) -> io::Result<Self>

Parse the header from a markers depth table file. The file starts with an optional comment line #Number of markers : N followed by a tab-separated header line id\tsequence\tind1\t...\tindN.