nx_align_score_test.nx
buildroot/runtime/nx_align_score_test.nx
about
nx_align_score_test.nx -- end-to-end seed-and-extend pipeline KAT.
Full chain composed in one test:
1. pack reference "ACGTACGTACGT" (12 bases) and query "ACGTACGT" (8 bases)
2. minimizer_extract from each (k=4 w=3)
3. minimizer_match to produce seed pairs
4. hand-sort seed pairs by (r_pos, q_pos)
5. seed_chain to find longest co-linear chain
6. score_chained_alignment to run SW over the chain region
Hand-traced expected values:
Reference minimizers (5): (0x1B, 0) (0x6C, 1) (0x1B, 4) (0x6C, 5) (0x1B, 8)
Query minimizers (3): (0x1B, 0) (0x6C, 1) (0x1B, 4)
Match pairs (outer q, inner r) = 8:
q_idx 0 (v=0x1B,q_pos=0): (0,0) (0,4) (0,8)
q_idx 1 (v=0x6C,q_pos=1): (1,1) (1,5)
q_idx 2 (v=0x1B,q_pos=4): (4,0) (4,4) (4,8)
After sort by (r,q) ascending:
index 0: (q=0, r=0)
index 1: (q=4, r=0)
index 2: (q=1, r=1)
index 3: (q=0, r=4)
index 4: (q=4, r=4)
index 5: (q=1, r=5)
index 6: (q=0, r=8)
index 7: (q=4, r=8)
Chain DP picks chain length 3 at end-index 4 (leftmost tie):
indices [0, 2, 4] -> seeds (q=0,r=0), (q=1,r=1), (q=4,r=4)
Alignment region:
q_start = 0, q_end = 4 + 4 = 8
r_start = 0, r_end = 4 + 4 = 8
q[0..8) = "ACGTACGT" == r[0..8) -> perfect 8-base match
SW score (m=+2 mis=-1 gap=-2) = 8 * 2 = 16, end (8, 8)
expect_exit: 0
dependencies 7 imports · 0 importers
imports: nx_syscalls.nxnx_sequence.nxnx_align.nxnx_align_minimizer.nxnx_align_match.nxnx_align_chain.nxnx_align_score.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 52 | func main() -> i64 |