nx_peptide_identify.nx
buildroot/runtime/nx_peptide_identify.nx
about
nx_peptide_identify.nx -- SOTA CAPSTONE: end-to-end peptide identification
from a RAW multiply-charged spectrum. One call chains the whole anchored
analytical stack: deconvolve the peak list to a neutral mass, screen that
mass against the catalog, and return an identity with a confidence that
REFUSES a guess. This is the "spectrum in, identity out" a lab actually
wants, and it is the recombination of every rung built before it.
THE PIPELINE, EACH STEP ALREADY LIAR-KILLED:
1. DECONVOLVE (nx_peptide_deconv): raw m/z peaks, no known charge -> the
neutral monoisotopic mass, plus how many charge-pairs corroborate it.
2. SCREEN (nx_supplement_screen catalog): match that mass against the
catalogued peptide actives within a ppm window.
3. JUDGE: an identification is CONFIDENT only if a catalog entry matches
AND at least one charge-pair corroborated the deconvolved mass. A
single spurious peak, or a mass with no catalog hit, returns
"no confident ID" -- it reports the mass it found and declines to name
it, rather than forcing a wrong answer.
WHY THE REFUSAL MATTERS. A screen that always returns its nearest catalog
entry is a liar generator -- it will "identify" noise. The confidence gate
here is the difference between an instrument and a rubber stamp: feed it a
real BPC-157 ladder and it says BPC-157; feed it noise and it says nothing.
The gate proves both.
ANCHORED where it is physics: the mass recovery and catalog masses are
anchored; the ppm arithmetic is exact. The catalog's regulatory STATUS is
asserted (that is nx_supplement_screen's domain), so a caller reads the
mass identity as verified and the legal call as advisory -- honestly split.
All INTEGER, _q4 = x10^4 Da.
Grounding (cited; researcher-groundable):
mann_1989_electrospray_charge_deconvolution
fda_tainted_supplements_peptide_actives
ppm_mass_accuracy_identification_window
genealogy_id: peptide_chemistry + analytical_sota + liar_killer
dependencies 4 imports · 1 importers
imports: nx_syscalls.nxnx_peptide.nxnx_peptide_deconv.nxnx_supplement_screen.nx
imported by: nx_qc_svc.nx
structs
| 56 | struct NxIdentResult |
consts
| 43 | const IDENT_MAGIC_10000000: i64 = 10000000 |
| 47 | const IDENT_MIN_SUPPORT: i64 = 1 |
| 52 | const IDENT_PPM_WINDOW: i64 = 50 |
| 54 | const IDENT_NO_MATCH: i64 = 0 - 1 |
functions
| 64 | func nx_ident_result_new() -> *NxIdentResult |
| 75 | func ident_ppm_q1(observed_q4: i64, reference_q4: i64) -> i64 |
| 84 | func ident_match_catalog(mass_q4: i64, ppm_window: i64) -> i64 |
| 106 | func nx_identify_spectrum(peaks: *i64, n: i64, tol_q4: i64) -> *NxIdentResult |
| 127 | func ident_is_confident(r: *NxIdentResult) -> i64 { return r.confident } |
| 129 | func ident_is_prohibited(r: *NxIdentResult) -> i64 |
| 135 | func ident_sequence(r: *NxIdentResult) -> *u8 |