nx_align_match.nx
buildroot/runtime/nx_align_match.nx
about
nx_align_match.nx -- minimizer-based seed match (query vs reference).
license_tier: INDEPENDENT_REDERIVE
genealogy_id: international-research-sources/li-2018-minimap2
G1.2 of NISHI_GENOMICS_SUBSTRATE_ROADMAP.md. Composes the
minimizer-extraction primitive (G1.1) into the seeding stage of
read alignment.
Pipeline:
reference: bases -> minimizer_extract -> (r_vals, r_pos)
query : bases -> minimizer_extract -> (q_vals, q_pos)
seeds : minimizer_match(q, r) -> {(q_pos, r_pos) : q_val == r_val}
Each emitted (q_pos, r_pos) pair is a candidate seed: a k-mer of
the query that occurs at r_pos in the reference. Downstream
(G1.3 chaining + G1.4 SW extension) groups compatible seeds into
chains and extends them into full alignments.
Naive O(q_count * r_count) impl for G1.2. For real-world use
the reference minimizer index is sorted-by-value or hashed so
match is O(q_count * log r_count) or O(q_count) -- those live in
nx_align_match_indexed.nx (G1.4).
API:
minimizer_match(q_vals, q_pos, q_count,
r_vals, r_pos, r_count,
out_q_pos, out_r_pos, max_out) -> i64 pair count
nx_safety_envelope: (schema: nishi-library/seeds/safety-critical-standards.toml)
intended_use: "Seed match in read-to-reference alignment;
composes with nx_align Smith-Waterman to
complete the seed-and-extend pipeline"
sil_target: SIL2
asil_target: QM
dal_target: DAL C
iec_62304_class: B
evidence: [no_floating_point, deterministic,
bit_equal_reproducible,
composes_nx_align_minimizer_KAT,
dependencies 1 imports · 3 importers
imports: nx_syscalls.nx
imported by: nx_align_match_stranded.nxnx_align_match_test.nxnx_align_score_test.nx
structs
| none |
consts
| none |
functions
| 84 | func sort_minimizers_by_value(vals: *i64, positions: *i64, n: i64) -> i64 called by 1: main |
| 117 | func nx_bsearch_lower(sorted_vals: *i64, n: i64, target: i64) -> i64 |
| 135 | func minimizer_match_indexed(q_vals: *i64, q_pos: *i64, q_count: i64, |
| 185 | func minimizer_match(q_vals: *i64, q_pos: *i64, q_count: i64, |