skills/exploratory-data-analysis/references/spectroscopy_analytical_formats.md
Reviewed: 2026-07-23 Executable scope: No spectroscopy-native parser is bundled. General CSV/TSV/JSON/NumPy/HDF5 inspectors apply only when a file is truly one of those registered formats and do not add spectroscopy semantics.
| Format | Bundled native inspection | Status |
|---|---|---|
| mzML/mzXML, MGF | No | Reference-only MS tooling |
JCAMP-DX (.jdx, .dx) | No | Reference-only technique/version-aware parser |
| SPC and vendor spectroscopy binaries | No | Reference-only producer-specific parser |
Vendor .raw, .d, .fid, .dat, .out | No | Ambiguous suffix/path; producer and format must be confirmed |
| CSV/TSV exports | General tabular scripts | Bounded aggregates only after delimiter, units, axes, and missing codes are confirmed |
| NPY/NPZ/HDF5 exports | General container scripts | Structural/bounded numeric inspection only; no instrument semantics |
Unknown formats fail closed. Directory-based acquisitions are rejected by the regular-file CLIs. No archive or compressed stream is unpacked.
HUPO-PSI identifies mzML 1.1.0 as the long-term stable format; its index schema and controlled vocabulary continue to receive compatible updates. mzML is XML with encoded binary arrays and controlled-vocabulary metadata. A generic XML parser is not sufficient.
Use pinned pymzML, Pyteomics, OpenMS, or ProteoWizard tooling and inspect:
Do not describe mzXML, mzData, mzMLb, or vendor RAW as equivalent to mzML. Conversion can alter metadata, precision, centroiding, and compression; record the converter/version/options and retain the original.
IUPAC describes JCAMP-DX as a family of standards for spectral data exchange. It has technique- and version-specific specifications (IR, NMR, MS, IMS, and others); active core development stopped in 2006, although the format remains in use.
Before parsing, identify the technique and specification/version. Validate:
Metadata and comments are untrusted and should not be copied into a report. The generic tabular scanner is not a JCAMP parser.
.fid, Bruker directory layouts, Varian/Agilent layouts, processed spectra,
and NMR exchange files require producer-aware tooling such as nmrglue. Record:
Peak picking, integration, baseline correction, phase correction, alignment, binning, and normalization are transformations. Preserve raw data and report parameter sensitivity; do not apply them automatically.
SPC, OPUS, WDF, SPE, instrument .raw, .dat, and text exports are
producer/variant dependent. Confirm:
For XRD, crystallographic CIF/MTZ/HKL are also reference-only and need
crystallography-aware validation. A .cif suffix is ambiguous between
small-molecule CIF and PDBx/mmCIF.
Generic CSV/TSV can contain retention time, temperature, potential, wavelength, or another independent axis. The general scripts can profile the table only after the data dictionary confirms:
Do not infer an axis from monotonic values or a column name. Do not automatically smooth, baseline-correct, align, integrate, normalize, subtract blanks, or delete peaks.
For an approved values-only export:
python scripts/tabular_profile.py spectrum.csv \
--root /approved/project \
--max-rows 100000
python scripts/missingness_leakage_audit.py spectrum.csv \
--root /approved/project \
--group-column sample_group \
--entity-column sample_id \
--split-column split \
--time-column acquisition_time
python scripts/distribution_sensitivity.py spectrum.csv \
--root /approved/project \
--column intensity
Use only pseudonymous column roles in shared commands/logs. The outputs contain aggregates and tokens, not spectra or identifiers.
EPA guidance treats non-detects/over-detects as censored observations carrying partial information and recommends preserving detection condition and limit type rather than forcing a numeric result. Apply the same principle to instrumental assays:
All links accessed 2026-07-23.