mod marker

module marker

Marker: a DNA sequence with per-individual depth counts.

Structs and Unions

struct AlignedMarker

A marker that has been aligned to a reference genome.

id: String
contig: String
position: i64
bias: f64
p: f64
struct Marker

A single RAD-seq marker with its depth across all individuals.

id: String

Marker ID (row number in the depth table).

sequence: String

DNA sequence.

individual_depths: Vec<u16>

Depth of this marker in each individual (ordered by table columns).

presence: BitsetRow

Bitset: bit i set iff individual i has depth >= min_depth. Group counting via presence.count_masked(&group_mask).

n_individuals: u32

Total number of individuals where marker is present (depth >= min_depth).

p: f64

P-value of association with group.

p_corrected: f64

Bonferroni-corrected p-value.

Implementations

impl Marker

Functions

fn new(n_individuals: u16) -> Self

Create a new marker with space for n_individuals depth slots.

fn reset(&mut self, keep_sequence: bool)

Reset marker fields for reuse (avoids reallocation).

fn write_as_fasta_bitset<W: Write>(&self, w: &mut W, min_depth: u32, group_names: &[(String, &GroupMask)]) -> io::Result<()>

Write this marker in FASTA format with group counts computed from bitset. >id_group1:count_group2:count_p:pval_pcorr:pcorr_mindepth:md followed by the sequence on the next line.

fn write_as_table<W: Write>(&self, w: &mut W) -> io::Result<()>

Write this marker in TSV table format: idtsequencetdepth1t…tdepthNn