code wiki / _hdl_build / nx_bio_sequence.nx
nx_bio_sequence.nx
buildroot/runtime/_hdl_build/nx_bio_sequence.nx
about
nx_bio_sequence.nx -- SOVEREIGN EXACT molecular-biology sequence engine (science-exceed arc, rung
BIO-SEQUENCE; lifts the weakest domain). Exact, DETERMINISTIC DNA/RNA/protein transforms -- no float,
no cloud, no license:
transcribe DNA -> RNA (T -> U)
translate RNA -> protein (codon table = knowledge/registry/sci_codon_table.tsv, stop-aware)
revcomp DNA -> reverse complement (A<->T, C<->G, reversed)
gc_count exact integer G+C count
EXCEED vs Mathematica GenomeData/SequenceAlignment (cloud-tethered, proprietary): Nishi does the core
transforms sovereign + offline + exact (the universal genetic code is a DATA table, not a service call).
Honest scope: not GenomeData's breadth -- the exact deterministic primitives every downstream bio rung
builds on (hardware-rung-up).
BAKED GATE proves each transform on known sequences + a negative control (unknown codon rejected) before
verdict=GREEN.
module: nishi-core.science.bio_sequence
depends: nishi-core.sys.syscalls
capability: EXACT_DETERMINISTIC_BIOSEQUENCE
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_lib.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
| 23 | const BS_MAGIC_16384: i64 = 16384 |
| 25 | const BS_TABLE: *u8 = "knowledge/registry/sci_codon_table.tsv" |
| 26 | const BS_LOG: *u8 = "knowledge/status/bio_sequence.log" |
functions
| 28 | func bs_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 33 | func bs_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 } |
| 35 | func bs_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 45 | func bs_field(buf: *u8, ls: i64, le: i64, f: i64, dst: *u8, cap: i64) -> i64 called by 1: bs_codon_lookup |
| 58 | func bs_streq(a: *u8, b: *u8) -> i64 |
| 66 | func bs_transcribe(dna: *u8, dlen: i64, out: *u8) -> i64 called by 1: main |
| 78 | func bs_revcomp(dna: *u8, dlen: i64, out: *u8) -> i64 called by 1: main |
| 94 | func bs_gc_count(seq: *u8, slen: i64) -> i64 called by 1: main |
| 106 | func bs_codon_lookup(tbuf: *u8, tn: i64, codon: *u8, aa: *u8) -> i64 |
| 126 | func bs_translate(rna: *u8, rlen: i64, tbuf: *u8, tn: i64, out: *u8) -> i64 |
| 143 | func main() -> i64 |