code wiki / (root) / nx_supplement_batch.nx

nx_supplement_batch.nx

buildroot/runtime/nx_supplement_batch.nx

5140 B126 linesdepth 12pulls 19 transitivereach 0 importersview sourcekind tooltopic supplement
docsdependenciesstructsconstsfunctions

about

nx_supplement_batch.nx -- C5.4 + C4.4: batch CLI with user-extensible compound DB + RT calibration + multi-file processing. USAGE (3 positional args, then peak files): nx_supplement_batch <compounds-or-dash> <cal-or-dash> <peak1> [peak2] ... compounds-or-dash: path to user-defined compound TSV file, or "-" to use only the 24-compound built-in seed DB. Format (one per line, '#' comments): id|name|SMILES|reg_code|citation reg_code: 0=UNK 1=APPROVED 2=RESTRICTED 3=BANNED 4=RX cal-or-dash: path to RT calibration CSV, or "-" for mass-only. Format (per C7.1): # id ref_rt_seconds tolerance_seconds 4 740.0 30.0 peak1, peak2, ...: one or more peak text files to process. EXAMPLES: # Built-in DB, no RT cal, 3 samples $ nx_supplement_batch - - lot_A.txt lot_B.txt lot_C.txt # Built-in DB + RT cal, 3 samples $ nx_supplement_batch - rt_cal.csv lot_A.txt lot_B.txt lot_C.txt # Lab's extended DB + RT cal, 50 samples $ nx_supplement_batch lab_compounds.tsv rt_cal.csv samples/*.txt EXIT CODE: Total banned detections summed across all samples. Pipe straight to LIMS: $ nx_supplement_batch - - samples/*.txt | \ jq -r 'select(.verdict.recommendation=="REJECT") | .sample_id'

dependencies 10 imports · 0 importers

nx_chem.nx nx_chem_molecule.nx nx_chem_smiles.nx nx_chem_periodic.nx nx_chem_valence.nx nx_chem_mass.nx nx_chem_isotope_pattern.nx nx_chem_adulterant_db.nx nx_chem_peak_list.nx nx_chem_report_json.nx nx_supplement_batch.nx

imports: nx_chem.nxnx_chem_molecule.nxnx_chem_smiles.nxnx_chem_periodic.nxnx_chem_valence.nxnx_chem_mass.nxnx_chem_isotope_pattern.nxnx_chem_adulterant_db.nxnx_chem_peak_list.nxnx_chem_report_json.nx

imported by: nobody (leaf or entry point)

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

main nx_chem_adulterant_db_seed nx_chem_atomic_data_table_ nx_chem_adulterant_db_new sys_mmap sys_mmap ↻ nx_chem_adulterant_seed_sm nx_chem_adulterant_db_add nx_chem_parse_smiles nx_chem_mol_new smi_is_digit nx_chem_mol_atom nx_chem_mol_bond_add nx_chem_mol_bond smi_parse_bracket smi_is_digit ↻ smi_is_upper smi_is_lower smi_bracket_symbol_two_cha smi_bracket_symbol_single_ smi_aromatic_lower_to_z nx_chem_mol_atom_add smi_connect nx_chem_mol_atom ↻ nx_chem_mol_bond_add ↻ nx_chem_mol_bond ↻ smi_aromatic_lower_to_z ↻ smi_is_upper ↻ smi_organic_atom nx_chem_smiles_populate_st nx_chem_compute_implicit_h nx_chem_default_valence nx_chem_atom_bond_summary nx_chem_mol_monoisotopic_m nx_chem_mol_mh_plus_q4 nx_chem_mol_monoisotopic_m ↻ nx_chem_halogen_signature nx_chem_isotope_m1_q4 nx_chem_isotope_m2_q4 nx_chem_adulterant_name

structs

none

consts

none

functions

50func process_one_sample(db: *AdulterantDB, peak_path: *u8) -> nx_int
92func is_dash_sentinel(p: *u8) -> nx_int
called by 1: main
98func main(argc: i64, argv: *i64) -> i64