code wiki / (root) / nx_chem_report_csv.nx

nx_chem_report_csv.nx

buildroot/runtime/nx_chem_report_csv.nx

7094 B166 linesdepth 12pulls 19 transitivereach 3 importersview sourcekind librarytopic chem
docsdependenciesstructsconstsfunctions

about

nx_chem_report_csv.nx -- C6.1: CSV output format for lab analysts who work in Excel. Output: one row per match. Columns: sample_id, peak_mz, rt_seconds, intensity, compound_id, name, regulatory, delta_ppm, citation CSV escaping (RFC 4180-style): - Field containing comma, quote, or newline -> wrap in double quotes - Internal " -> "" (doubled) - Other fields: bare Compose nx_chem_report_json's emit_* helpers (emit_str/emit_int/ emit_q4) for type-format consistency with the JSON emitter.

dependencies 5 imports · 3 importers

nx_chem.nx nx_chem_molecule.nx nx_chem_adulterant_db.nx nx_chem_peak_list.nx nx_chem_report_json.nx nx_chem_report_csv.nx nx_chem_report_csv_test.nx nx_supplement.nx nx_supplement_csv.nx

imports: nx_chem.nxnx_chem_molecule.nxnx_chem_adulterant_db.nxnx_chem_peak_list.nxnx_chem_report_json.nx

imported by: nx_chem_report_csv_test.nxnx_supplement.nxnx_supplement_csv.nx

structs

none

consts

21const K_MAGIC_10000: i64 = 10000

functions

28func nx_chem_emit_csv_field(buf: *u8, offset: nx_int, src: *u8) -> nx_int
84func nx_chem_emit_csv_header(buf: *u8, offset: nx_int) -> nx_int
92func nx_chem_emit_csv_row(buf: *u8, offset: nx_int, sample_id: *u8, p: *PeakObservation, db: *AdulterantDB, r: *MatchResult) -> nx_int
126func nx_chem_emit_report_csv(buf: *u8, peaks: *PeakList, db: *AdulterantDB, sample_id: *u8, tolerance_ppm: nx_int) -> nx_int
150func nx_chem_emit_report_csv_rows_only(buf: *u8, peaks: *PeakList, db: *AdulterantDB, sample_id: *u8, tolerance_ppm: nx_int) -> nx_int