code wiki / (root) / nx_align_match_stranded_test.nx

nx_align_match_stranded_test.nx

buildroot/runtime/nx_align_match_stranded_test.nx

6190 B173 linesdepth 4pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic align
docsdependenciesstructsconstsfunctions

about

nx_align_match_stranded_test.nx -- KAT for strand-aware seed matcher. End-to-end fixture demonstrating that canonical k-mer minimizers have STRAND-INVARIANT VALUES (same set for fwd and rc query) but the strand-aware matcher correctly tags pairs by which orientation the match came from. Query : "AACGT" (5 bases) Query rc : "ACGTT" (5 bases) Reference : "AACGTACGTT" (10 bases) -- contains AACGT at pos 0 + ACGTT at pos 5 Hand-traced canonical k-mers (k=4): Fwd query: pos 0: AACG raw 0x06 rc CGTT 0x6F canon 0x06 pos 1: ACGT palindrome 0x1B canon 0x1B Rc query: pos 0: ACGT palindrome 0x1B canon 0x1B pos 1: CGTT raw 0x6F rc AACG 0x06 canon 0x06 w=1 minimizers (every k-mer is its own window with w=1): Fwd query: (0x06, 0), (0x1B, 1) count 2 Rc query: (0x1B, 0), (0x06, 1) count 2 (same value set, different positions) Reference k-mers (k=4): pos 0: AACG canon 0x06 pos 1: ACGT canon 0x1B pos 2: CGTA raw 0x6C rc TACG 0xC6 canon 0x6C pos 3: GTAC palindrome 0xB1 pos 4: TACG raw 0xC6 rc CGTA 0x6C canon 0x6C pos 5: ACGT canon 0x1B pos 6: CGTT raw 0x6F rc AACG 0x06 canon 0x06 w=1 ref minimizers (7): (0x06, 0), (0x1B, 1), (0x6C, 2), (0xB1, 3), (0x6C, 4), (0x1B, 5), (0x06, 6) Strand-aware match output: Forward block (tag = +1): q=0 (val 0x06): hits ref 0x06 at positions 0, 6 -> (0,0)+, (0,6)+ q=1 (val 0x1B): hits ref 0x1B at positions 1, 5 -> (1,1)+, (1,5)+

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_const.nx nx_sequence.nx nx_align_minimizer.nx nx_align_match_stranded.nx nx_align_match_stranded_test.n

imports: nx_syscalls.nxnx_const.nxnx_sequence.nxnx_align_minimizer.nxnx_align_match_stranded.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap dna_revcomp dna_get_base dna_complement_code dna_set_base minimizer_extract minimizer_count_windows dna_kmer_at dna_get_base ↻ dna_kmer_canonical dna_kmer_revcomp minimizer_match_stranded minimizer_match

structs

none

consts

none

functions

56func main() -> i64