Skip to content

Edgemers

snipe is an alignment-free QC tool: it computes coverage, depth, and error- and mutation-rate metrics from a k-mer sketch rather than from aligned reads. Most sketching tools reduce a genome to a set of k-mers — every substring of length k. snipe works instead with edgemers, k-mer pairs. The edgemer is what lets snipe separate a sequencing error from a real mutation without aligning anything.

An edgemer couples a base k-mer (K1) with a slightly longer extended k-mer (K2) that wraps K1 on both sides — K1 sits in the centre of K2, which adds (k2 − k1) / 2 bases to the left and the same number to the right:

ACGTGACCTGAGTCAG◀ extext ▶K1 · base k-mer (centre)K2 · extends K1 by (k2−k1)/2 on each sideedgemer = (K1, K2) pair
K1 is the base k-mer; K2 wraps it, extending by (k2−k1)/2 bases on each side. The pair is the edgemer.

By default k1 = 51 and k2 = 53, so the extension length is 2 — one base added on the left of K1 and one on the right. The diagram uses a shorter window for clarity — the concept is identical at any k.

  • K1 is the base window: a canonical, murmur3-hashed 51-mer (seed 42).
  • K2 is K1 flanked by one extra base on each side (a 53-mer, K1 centred). Whether that K2 can be formed — and whether it matches — is the extra signal the edgemer carries beyond a plain k-mer.

Against a reference, snipe takes the K1s that match and asks whether their K2 extension matches too. When a K1 matches but its K2 differs from the reference’s expected extension, that mismatch marks a base change. Abundance then separates noise from signal: a mismatch seen once (a singleton) is usually a sequencing error — a random miscall; a mismatch seen repeatedly (a polyton) is usually a true mutation. snipe’s sequencing_error_rate and mutation_rate are derived from these two counts, each normalized by the extension length (k2 − k1).

A separate case: sometimes a K2 window can’t be used — for example when a K1 sits too close to the end of a read to leave room for the extension, or when the K2 window would contain a non-A/C/G/T base. snipe tags these as FAILED_K2 (internally k2_hash == FAILED_K2_HASH) and counts them on their own — a benign bookkeeping case, not a base change and not what the error/mutation rates measure.

ACGTGACCTTAGTCAG◀ extext ▶K1 · base k-mer (centre)K2 · extension could not be formedFAILED_K2 → K1 too close to a read end
A K1 near a read's end whose K2 could not be formed — tagged FAILED_K2 (a benign edge effect, distinct from a K2 that forms but mismatches the reference).

Edgemers are stored in the native .snipesig format (Parquet-encoded) with full fidelity, and they drive every downstream comparison and QC step. The K2 extension is specific to .snipesig; a K1-only export carries just the base-k-mer layer.