Skill Tracer
Skills › Scientific Agent Skills › exploratory-data-analysis › spectroscopy_analytical_formats.md

spectroscopy_analytical_formats.md

196 lines · skills/exploratory-data-analysis/references/spectroscopy_analytical_formats.md at 5f2bc03

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1# Spectroscopy and Analytical Chemistry Formats
2
3**Reviewed:** 2026-09-30
4**Executable scope:** No spectroscopy-native parser is bundled. General
5CSV/TSV/JSON/NumPy/HDF5 inspectors apply only when a file is truly one of those
6registered formats and do not add spectroscopy semantics.
7

Spectroscopy and Analytical Chemistry Formats

Reviewed: 2026-09-30 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.

Raw lines 1 to 7
8## Capability boundary
9
10| Format | Bundled native inspection | Status |
11|---|---|---|
12| mzML/mzXML, MGF | No | Reference-only MS tooling |
13| JCAMP-DX (`.jdx`, `.dx`) | No | Reference-only technique/version-aware parser |
14| SPC and vendor spectroscopy binaries | No | Reference-only producer-specific parser |
15| Vendor `.raw`, `.d`, `.fid`, `.dat`, `.out` | No | Ambiguous suffix/path; producer and format must be confirmed |
16| CSV/TSV exports | General tabular scripts | Bounded aggregates only after delimiter, units, axes, and missing codes are confirmed |
17| NPY/NPZ/HDF5 exports | General container scripts | Structural/bounded numeric inspection only; no instrument semantics |
19Unknown formats fail closed. Directory-based acquisitions are rejected by the
20regular-file CLIs. No archive or compressed stream is unpacked.

Capability boundary

FormatBundled native inspectionStatus
mzML/mzXML, MGFNoReference-only MS tooling
JCAMP-DX (.jdx, .dx)NoReference-only technique/version-aware parser
SPC and vendor spectroscopy binariesNoReference-only producer-specific parser
Vendor .raw, .d, .fid, .dat, .outNoAmbiguous suffix/path; producer and format must be confirmed
CSV/TSV exportsGeneral tabular scriptsBounded aggregates only after delimiter, units, axes, and missing codes are confirmed
NPY/NPZ/HDF5 exportsGeneral container scriptsStructural/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.

Raw lines 8 to 21
22## mzML and related mass-spectrometry formats
24HUPO-PSI identifies mzML 1.1.0 as the long-term stable format; its index schema
25and controlled vocabulary continue to receive compatible updates. mzML is XML
26with encoded binary arrays and controlled-vocabulary metadata. The current
27official links use main schema 1.1.1 and optional indexed wrapper 1.1.3; distinguish
28the stable specification from schema revision numbers. The IM-MS/DIA proposal
29updated August 2026 has not yet entered the PSI Document Process. A generic XML
30parser is not sufficient. Use a local validator: PSI reports the former online
31validators no longer function.
33Use pinned pymzML, Pyteomics, OpenMS, or ProteoWizard tooling and inspect:
35- schema/version, controlled-vocabulary terms, source files, checksums, and
36 conversion software;
37- run/instrument configuration, polarity, scan modes, MS levels, isolation,
38 activation, and data processing;
39- spectrum/chromatogram counts, retention/mobility time, m/z and intensity
40 array lengths, precision, compression, and units;
41- profile versus centroid data, TIC/BPC, calibration, lock mass, blanks, pooled
42 QC, standards, carryover, drift, and batch order; and
43- truncated scans, empty arrays, non-finite values, and metadata consistency.
45Do not describe mzXML, mzData, mzMLb, or vendor RAW as equivalent to mzML.
46Conversion can alter metadata, precision, centroiding, and compression; record
47the converter/version/options and retain the original.

mzML and related mass-spectrometry formats

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. The current official links use main schema 1.1.1 and optional indexed wrapper 1.1.3; distinguish the stable specification from schema revision numbers. The IM-MS/DIA proposal updated August 2026 has not yet entered the PSI Document Process. A generic XML parser is not sufficient. Use a local validator: PSI reports the former online validators no longer function.

Use pinned pymzML, Pyteomics, OpenMS, or ProteoWizard tooling and inspect:

  • schema/version, controlled-vocabulary terms, source files, checksums, and conversion software;
  • run/instrument configuration, polarity, scan modes, MS levels, isolation, activation, and data processing;
  • spectrum/chromatogram counts, retention/mobility time, m/z and intensity array lengths, precision, compression, and units;
  • profile versus centroid data, TIC/BPC, calibration, lock mass, blanks, pooled QC, standards, carryover, drift, and batch order; and
  • truncated scans, empty arrays, non-finite values, and metadata consistency.

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.

Raw lines 22 to 48
49## JCAMP-DX
51IUPAC describes JCAMP-DX as a family of standards for spectral data exchange.
52It has technique- and version-specific specifications (IR, NMR, MS, IMS, and
53others). Choose the applicable published recommendation instead of assuming
54all JCAMP files share one interchangeable schema.
56Before parsing, identify the technique and specification/version. Validate:
58- label/value records and required metadata;
59- X/Y units, first/last X, point count, spacing, factors, and encoded numeric
60 representation;
61- NTUPLES versus simpler XY forms;
62- page/block boundaries and compound/instrument identifiers; and
63- whether data are absorbance, transmittance, counts, complex NMR, peaks, or
64 continuous spectra.
66Metadata and comments are untrusted and should not be copied into a report.
67The generic tabular scanner is not a JCAMP parser.

JCAMP-DX

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). Choose the applicable published recommendation instead of assuming all JCAMP files share one interchangeable schema.

Before parsing, identify the technique and specification/version. Validate:

  • label/value records and required metadata;
  • X/Y units, first/last X, point count, spacing, factors, and encoded numeric representation;
  • NTUPLES versus simpler XY forms;
  • page/block boundaries and compound/instrument identifiers; and
  • whether data are absorbance, transmittance, counts, complex NMR, peaks, or continuous spectra.

Metadata and comments are untrusted and should not be copied into a report. The generic tabular scanner is not a JCAMP parser.

Raw lines 49 to 68
69## NMR data
71`.fid`, Bruker directory layouts, Varian/Agilent layouts, processed spectra,
72and NMR exchange files require producer-aware tooling such as nmrglue. Record:
74- vendor/software/version and complete acquisition directory;
75- nucleus, field strength, spectral width, dwell time, point count, quadrature,
76 digital filter, scans, temperature, pulse sequence, and reference;
77- raw FID versus processed spectrum, apodization, zero filling, Fourier
78 transform, phase, baseline, referencing, and solvent suppression;
79- dimensional axes/units and whether data are real, imaginary, magnitude, or
80 complex; and
81- sample preparation, concentration, pH, replicates, and batch/order.
83Peak picking, integration, baseline correction, phase correction, alignment,
84binning, and normalization are transformations. Preserve raw data and report
85parameter sensitivity; do not apply them automatically.

NMR data

.fid, Bruker directory layouts, Varian/Agilent layouts, processed spectra, and NMR exchange files require producer-aware tooling such as nmrglue. Record:

  • vendor/software/version and complete acquisition directory;
  • nucleus, field strength, spectral width, dwell time, point count, quadrature, digital filter, scans, temperature, pulse sequence, and reference;
  • raw FID versus processed spectrum, apodization, zero filling, Fourier transform, phase, baseline, referencing, and solvent suppression;
  • dimensional axes/units and whether data are real, imaginary, magnitude, or complex; and
  • sample preparation, concentration, pH, replicates, and batch/order.

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.

Raw lines 69 to 86
87## Optical, vibrational, and diffraction spectra
89SPC, OPUS, WDF, SPE, instrument `.raw`, `.dat`, and text exports are
90producer/variant dependent. Confirm:
92- physical X axis (wavelength, wavenumber, energy, angle, time) and units;
93- Y quantity (counts, intensity, absorbance, transmittance, reflectance) and
94 calibration;
95- point order/spacing, detector/channel, exposure/accumulations, resolution,
96 slit/grating/laser/source, and polarization;
97- background/reference/dark correction and all processing already applied; and
98- maps, time series, replicate spectra, and spatial coordinates.
100For XRD, crystallographic CIF/MTZ/HKL are also reference-only and need
101crystallography-aware validation. A `.cif` suffix is ambiguous between
102small-molecule CIF and PDBx/mmCIF.

Optical, vibrational, and diffraction spectra

SPC, OPUS, WDF, SPE, instrument .raw, .dat, and text exports are producer/variant dependent. Confirm:

  • physical X axis (wavelength, wavenumber, energy, angle, time) and units;
  • Y quantity (counts, intensity, absorbance, transmittance, reflectance) and calibration;
  • point order/spacing, detector/channel, exposure/accumulations, resolution, slit/grating/laser/source, and polarization;
  • background/reference/dark correction and all processing already applied; and
  • maps, time series, replicate spectra, and spatial coordinates.

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.

Raw lines 87 to 103
104## Chromatography and thermal/electrochemical exports
106Generic CSV/TSV can contain retention time, temperature, potential, wavelength,
107or another independent axis. The general scripts can profile the table only
108after the data dictionary confirms:
110- axis and signal columns, units, ordering, spacing, and replicate layout;
111- blanks, calibration standards, internal standards, dilution factors,
112 injection order, batch, and sample identifiers;
113- LOD/LOQ, saturation, censoring qualifiers, and negative/zero handling; and
114- whether peaks/integrals are raw, manually edited, or software-derived.
116Do not infer an axis from monotonic values or a column name. Do not
117automatically smooth, baseline-correct, align, integrate, normalize, subtract
118blanks, or delete peaks.

Chromatography and thermal/electrochemical exports

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:

  • axis and signal columns, units, ordering, spacing, and replicate layout;
  • blanks, calibration standards, internal standards, dilution factors, injection order, batch, and sample identifiers;
  • LOD/LOQ, saturation, censoring qualifiers, and negative/zero handling; and
  • whether peaks/integrals are raw, manually edited, or software-derived.

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.

Raw lines 104 to 119
120## Safe bounded tabular workflow
122For an approved values-only export:
124```bash
125python scripts/tabular_profile.py spectrum.csv \
126 --root /approved/project \
127 --max-rows 100000
129python scripts/missingness_leakage_audit.py spectrum.csv \
130 --root /approved/project \
131 --group-column sample_group \
132 --entity-column sample_id \
133 --split-column split \
134 --time-column acquisition_time
136python scripts/distribution_sensitivity.py spectrum.csv \
137 --root /approved/project \
138 --column intensity
139```
141Use only pseudonymous column roles in shared commands/logs. The outputs contain
142aggregates and tokens, not spectra or identifiers.

Safe bounded tabular workflow

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.

Raw lines 120 to 143
Runs code python scripts/tabular_profile.py :125
Runs code python scripts/missingness_leakage_audit.py :129
Runs code python scripts/distribution_sensitivity.py :136
144## Analytical EDA rigor
1461. Define the independent unit: scan, injection, spectrum, sample, batch,
147 subject, instrument, site, or experiment.
1482. Preserve raw acquisition files and processing audit trails.
1493. Record calibration, units, standards, blanks, internal standards,
150 acquisition order, maintenance, software, and method versions.
1514. Keep non-detects, below-LOQ values, saturation, missing scans, failed QC, and
152 true zeros distinct. Preserve qualifier and limit fields.
1535. Compare raw and processed summaries and sensitivity to baseline, smoothing,
154 peak picking, alignment, integration, normalization, and transformations.
1556. Investigate outliers against calibration, instrument state, carryover, and
156 sample handling; do not delete automatically.
1577. Split independent samples/batches/time before learned preprocessing. Never
158 fit normalization or feature selection on test data.
1598. Account for repeated spectra, technical replicates, correlated wavelengths/
160 peaks, and many comparisons.
1619. Label discovered peaks/patterns as exploratory and confirm independently.
16210. Do not make identity, purity, mechanism, exposure, diagnostic, or causal
163 claims from EDA alone.

Analytical EDA rigor

  1. Define the independent unit: scan, injection, spectrum, sample, batch, subject, instrument, site, or experiment.
  2. Preserve raw acquisition files and processing audit trails.
  3. Record calibration, units, standards, blanks, internal standards, acquisition order, maintenance, software, and method versions.
  4. Keep non-detects, below-LOQ values, saturation, missing scans, failed QC, and true zeros distinct. Preserve qualifier and limit fields.
  5. Compare raw and processed summaries and sensitivity to baseline, smoothing, peak picking, alignment, integration, normalization, and transformations.
  6. Investigate outliers against calibration, instrument state, carryover, and sample handling; do not delete automatically.
  7. Split independent samples/batches/time before learned preprocessing. Never fit normalization or feature selection on test data.
  8. Account for repeated spectra, technical replicates, correlated wavelengths/ peaks, and many comparisons.
  9. Label discovered peaks/patterns as exploratory and confirm independently.
  10. Do not make identity, purity, mechanism, exposure, diagnostic, or causal claims from EDA alone.
Raw lines 144 to 164
165## Detection limits and censoring
167EPA guidance treats non-detects/over-detects as censored observations carrying
168partial information and recommends preserving detection condition and limit
169type rather than forcing a numeric result. Apply the same principle to
170instrumental assays:
172- keep measured value, qualifier, limit type, and limit value in distinct
173 fields;
174- do not replace censored values automatically with zero, LOD/2, or LOQ;
175- summarize the censoring fraction by group/batch/time;
176- choose a model appropriate to censoring and scientific design; and
177- report sensitivity to plausible assumptions.

Detection limits and censoring

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:

  • keep measured value, qualifier, limit type, and limit value in distinct fields;
  • do not replace censored values automatically with zero, LOD/2, or LOQ;
  • summarize the censoring fraction by group/batch/time;
  • choose a model appropriate to censoring and scientific design; and
  • report sensitivity to plausible assumptions.
Raw lines 165 to 178
179## Authoritative sources
181Current parser APIs and format guidance reviewed 2026-09-30. Historical
182methodology citations are retained as source context.
184- HUPO-PSI, [mzML specification/status](https://www.psidev.info/mzml)
185 (mzML 1.1.0 long-term stable; current schema/CV links and 2026 IM-MS/DIA
186 proposal status).
187- HUPO-PSI, [mzML GitHub specification repository](https://github.com/HUPO-PSI/mzML).
188- IUPAC, [JCAMP-DX digital standard family](https://iupac.org/what-we-do/digital-standards/jcamp-dx/)
189 (page dated 2021-08-03; finalized technique-specific standards).
190- IUPAC, [JCAMP-DX 5.01 recommendation](https://doi.org/10.1351/pac199971081549).
191- nmrglue, [current documentation](https://nmrglue.readthedocs.io/en/latest/).
192- US EPA, [Detection Limits Best Practices Guide](https://www.epa.gov/system/files/documents/2025-09/wqxdetectionlimitsbestpracticesguide_final.pdf),
193 dated August 2025.
194- NIST/SEMATECH, [Exploratory Data Analysis](https://www.itl.nist.gov/div898/handbook/eda/eda.htm).
195- FDA/ICH E9(R1), [estimands and sensitivity analysis](https://www.fda.gov/regulatory-information/search-fda-guidance-documents/e9r1-statistical-principles-clinical-trials-addendum-estimands-and-sensitivity-analysis-clinical),
196 final guidance May 2021.

Authoritative sources

Current parser APIs and format guidance reviewed 2026-09-30. Historical methodology citations are retained as source context.

Raw lines 179 to 196