nx_chem_report_csv.nx
buildroot/runtime/nx_chem_report_csv.nx
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
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
| 21 | const K_MAGIC_10000: i64 = 10000 |
functions
| 28 | func nx_chem_emit_csv_field(buf: *u8, offset: nx_int, src: *u8) -> nx_int |
| 84 | func nx_chem_emit_csv_header(buf: *u8, offset: nx_int) -> nx_int |
| 92 | func nx_chem_emit_csv_row(buf: *u8, offset: nx_int, sample_id: *u8, p: *PeakObservation, db: *AdulterantDB, r: *MatchResult) -> nx_int |
| 126 | func nx_chem_emit_report_csv(buf: *u8, peaks: *PeakList, db: *AdulterantDB, sample_id: *u8, tolerance_ppm: nx_int) -> nx_int |
| 150 | func nx_chem_emit_report_csv_rows_only(buf: *u8, peaks: *PeakList, db: *AdulterantDB, sample_id: *u8, tolerance_ppm: nx_int) -> nx_int called by 2: process_one_csv_rowprocess_one_csv calls 2: nx_chem_adulterant_db_lookup_with_rtnx_chem_emit_csv_row |