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

chemistry_molecular_formats.md

184 lines · skills/exploratory-data-analysis/references/chemistry_molecular_formats.md at 5f2bc03

Open on GitHub
1# Chemistry and Molecular Formats
2
3**Reviewed:** 2026-09-30
4**Executable scope:** No chemistry-native format has a bundled parser. This file
5is a reference-only routing guide, not a support claim.
6

Chemistry and Molecular Formats

Reviewed: 2026-09-30 Executable scope: No chemistry-native format has a bundled parser. This file is a reference-only routing guide, not a support claim.

Raw lines 1 to 6
7## Capability boundary
8
9| Format family | Bundled chemistry inspection | Required approach |
10|---|---|---|
11| PDB, PDBx/mmCIF/CIF | No | Dictionary/version-aware structural tooling |
12| Molfile/SDF, SMILES, XYZ | No | Chemistry-aware parser with explicit sanitization policy |
13| DCD/XTC/TRR and topology files | No | Topology-aware trajectory tooling |
14| Gaussian/QM outputs, cube grids | No | Program/version-aware parser |
15| Pickle/joblib/dill molecule/model files | **Never** | Obtain a non-executable interchange export |
16| Genuine CSV/TSV/JSON/NPY/NPZ/HDF5 exports | General inspector only | Apply the exact general-format capability; no chemical semantics are inferred |
18The `.cif`, `.log`, `.out`, `.raw`, and `.dat` suffixes are ambiguous. The
19capability manifest registers `.cif` and `.raw` as reference-only; unregistered
20`.log`, `.out`, and `.dat` fail closed. It does not sniff content or guess a producer.

Capability boundary

Format familyBundled chemistry inspectionRequired approach
PDB, PDBx/mmCIF/CIFNoDictionary/version-aware structural tooling
Molfile/SDF, SMILES, XYZNoChemistry-aware parser with explicit sanitization policy
DCD/XTC/TRR and topology filesNoTopology-aware trajectory tooling
Gaussian/QM outputs, cube gridsNoProgram/version-aware parser
Pickle/joblib/dill molecule/model filesNeverObtain a non-executable interchange export
Genuine CSV/TSV/JSON/NPY/NPZ/HDF5 exportsGeneral inspector onlyApply the exact general-format capability; no chemical semantics are inferred

The .cif, .log, .out, .raw, and .dat suffixes are ambiguous. The capability manifest registers .cif and .raw as reference-only; unregistered .log, .out, and .dat fail closed. It does not sniff content or guess a producer.

Raw lines 7 to 21
22## PDB and PDBx/mmCIF
24wwPDB states that PDBx/mmCIF is its official working and archive format.
25Legacy PDB format 3.30 remains distributed where representable but has field
26and size limitations.
28Use a pinned parser such as Gemmi, Biopython's `Bio.PDB`, or official wwPDB
29validation services/tools in a separately reviewed environment. Confirm:
31- file/dictionary version and experimental method;
32- model count, chain/entity mapping, assemblies, alternate locations,
33 insertion codes, occupancy, B factors, and missing residues/atoms;
34- unit cell, symmetry, resolution, R factors, validation metrics, and
35 biological versus crystallographic assembly;
36- ligand/component definitions, covalent links, protonation/charge assumptions,
37 and coordinate units; and
38- whether multiple models are alternatives, an ensemble, or time/order data.
40Do not interpret a low B factor, occupancy, model score, or missing atom as a
41quality verdict without experimental context. Do not claim binding, stability,
42function, or causality from a coordinate inventory.

PDB and PDBx/mmCIF

wwPDB states that PDBx/mmCIF is its official working and archive format. Legacy PDB format 3.30 remains distributed where representable but has field and size limitations.

Use a pinned parser such as Gemmi, Biopython's Bio.PDB, or official wwPDB validation services/tools in a separately reviewed environment. Confirm:

  • file/dictionary version and experimental method;
  • model count, chain/entity mapping, assemblies, alternate locations, insertion codes, occupancy, B factors, and missing residues/atoms;
  • unit cell, symmetry, resolution, R factors, validation metrics, and biological versus crystallographic assembly;
  • ligand/component definitions, covalent links, protonation/charge assumptions, and coordinate units; and
  • whether multiple models are alternatives, an ensemble, or time/order data.

Do not interpret a low B factor, occupancy, model score, or missing atom as a quality verdict without experimental context. Do not claim binding, stability, function, or causality from a coordinate inventory.

Raw lines 22 to 43
44## Molfile, SDF, and line notations
46Molfile/SDF records can represent atoms, bonds, coordinates, charges,
47stereochemistry, query features, and arbitrary property blocks. SMILES is a
48line notation whose interpretation depends on aromaticity, valence,
49stereochemistry, isotope, charge, and sanitization rules.
51Before EDA:
531. Identify CTfile/version and producer.
542. Parse with errors preserved; count invalid records rather than silently
55 dropping them.
563. Keep the original string/record and a separate standardized representation.
574. Record sanitization, aromaticity, tautomer, protonation, salt/fragment,
58 stereochemistry, isotope, and charge policies.
595. Distinguish 2-D drawing coordinates from experimentally or computationally
60 meaningful 3-D conformers.
616. Treat property names/values as untrusted metadata and redact identifiers.
63Descriptor distributions are conditional on these choices. Do not automatically
64neutralize, desalinate, canonicalize, deduplicate, generate conformers, or
65discard parser failures.

Molfile, SDF, and line notations

Molfile/SDF records can represent atoms, bonds, coordinates, charges, stereochemistry, query features, and arbitrary property blocks. SMILES is a line notation whose interpretation depends on aromaticity, valence, stereochemistry, isotope, charge, and sanitization rules.

Before EDA:

  1. Identify CTfile/version and producer.
  2. Parse with errors preserved; count invalid records rather than silently dropping them.
  3. Keep the original string/record and a separate standardized representation.
  4. Record sanitization, aromaticity, tautomer, protonation, salt/fragment, stereochemistry, isotope, and charge policies.
  5. Distinguish 2-D drawing coordinates from experimentally or computationally meaningful 3-D conformers.
  6. Treat property names/values as untrusted metadata and redact identifiers.

Descriptor distributions are conditional on these choices. Do not automatically neutralize, desalinate, canonicalize, deduplicate, generate conformers, or discard parser failures.

Raw lines 44 to 66
67## XYZ and coordinate text
69XYZ commonly starts each frame with atom count and a comment line, followed by
70element and Cartesian coordinates. Variants can contain trajectories,
71additional columns, or nonstandard units. Confirm:
73- atom-count/frame boundaries;
74- element/isotope labels and units (often Å, but not guaranteed);
75- periodic cell/charge/spin information stored elsewhere;
76- whether frames are independent molecules, optimization steps, or dynamics;
77 and
78- topology/bond inference policy.
80The generic tabular scanner is not an XYZ parser.

XYZ and coordinate text

XYZ commonly starts each frame with atom count and a comment line, followed by element and Cartesian coordinates. Variants can contain trajectories, additional columns, or nonstandard units. Confirm:

  • atom-count/frame boundaries;
  • element/isotope labels and units (often Å, but not guaranteed);
  • periodic cell/charge/spin information stored elsewhere;
  • whether frames are independent molecules, optimization steps, or dynamics; and
  • topology/bond inference policy.

The generic tabular scanner is not an XYZ parser.

Raw lines 67 to 81
82## Molecular dynamics trajectories
84DCD, XTC, TRR, NetCDF trajectories, and related files usually need a matching
85topology and sometimes unit-cell/time metadata. A suffix does not supply these.
86With MDAnalysis/MDTraj or another pinned reader, inspect:
88- topology/trajectory atom count and ordering;
89- frame count, time step, units, coordinates, velocities/forces, and box;
90- periodic-boundary and imaging/unwrapping choices;
91- equilibration, sampling interval, restraints, thermostat/barostat, and
92 replica identity; and
93- corrupted/truncated frames before calculating RMSD/RMSF or contacts.
95Frames are temporally dependent. Do not treat frames as independent replicates
96or split adjacent frames randomly across train/test.

Molecular dynamics trajectories

DCD, XTC, TRR, NetCDF trajectories, and related files usually need a matching topology and sometimes unit-cell/time metadata. A suffix does not supply these. With MDAnalysis/MDTraj or another pinned reader, inspect:

  • topology/trajectory atom count and ordering;
  • frame count, time step, units, coordinates, velocities/forces, and box;
  • periodic-boundary and imaging/unwrapping choices;
  • equilibration, sampling interval, restraints, thermostat/barostat, and replica identity; and
  • corrupted/truncated frames before calculating RMSD/RMSF or contacts.

Frames are temporally dependent. Do not treat frames as independent replicates or split adjacent frames randomly across train/test.

Raw lines 82 to 97
98## Quantum chemistry outputs and grids
100`.log`/`.out` files are program- and version-specific; use cclib or a
101producer-specific parser only after confirming the producer. Check:
103- method, basis set, charge, multiplicity, units, software/version, and job
104 termination;
105- optimization/frequency convergence and imaginary modes;
106- geometry/energy step count and whether the final structure is intended;
107- SCF convergence, warnings, symmetry, solvation, and corrections; and
108- whether values are raw, relative, thermal-corrected, or post-processed.
110Cube and similar volumetric grids require origin, axis vectors, shape, units,
111orbital/density identity, and integration conventions. Bound grid reads and do
112not eagerly load an unverified declared shape.

Quantum chemistry outputs and grids

.log/.out files are program- and version-specific; use cclib or a producer-specific parser only after confirming the producer. Check:

  • method, basis set, charge, multiplicity, units, software/version, and job termination;
  • optimization/frequency convergence and imaginary modes;
  • geometry/energy step count and whether the final structure is intended;
  • SCF convergence, warnings, symmetry, solvation, and corrections; and
  • whether values are raw, relative, thermal-corrected, or post-processed.

Cube and similar volumetric grids require origin, axis vectors, shape, units, orbital/density identity, and integration conventions. Bound grid reads and do not eagerly load an unverified declared shape.

Raw lines 98 to 113
114## HDF5, NumPy, and tabular chemistry exports
116If the file is genuinely `.npy`, `.npz`, `.h5`, `.hdf5`, `.csv`, `.tsv`, or
117strict `.json`, the general inspector can report container structure and
118aggregate numeric properties. It cannot infer:
120- atom/molecule/conformer axes;
121- coordinate or energy units;
122- descriptor definitions;
123- train/test compound grouping;
124- assay censoring or detection limits; or
125- chemical identity from field names.
127HDF5 object names/attributes are redacted, external/soft links are not followed,
128and dataset values are not read. NumPy object arrays are rejected. Pickled
129models or RDKit objects are never deserialized.

HDF5, NumPy, and tabular chemistry exports

If the file is genuinely .npy, .npz, .h5, .hdf5, .csv, .tsv, or strict .json, the general inspector can report container structure and aggregate numeric properties. It cannot infer:

  • atom/molecule/conformer axes;
  • coordinate or energy units;
  • descriptor definitions;
  • train/test compound grouping;
  • assay censoring or detection limits; or
  • chemical identity from field names.

HDF5 object names/attributes are redacted, external/soft links are not followed, and dataset values are not read. NumPy object arrays are rejected. Pickled models or RDKit objects are never deserialized.

Raw lines 114 to 130
131## Chemistry EDA rigor
1331. Define the independent unit: compound, batch, conformer, frame, calculation,
134 assay plate, specimen, or replicate.
1352. Preserve raw structures and measured values; record standardization as a
136 derived transformation.
1373. Create a data dictionary with units, assay endpoints, bounds, censoring,
138 LOD/LOQ, qualifiers, and provenance.
1394. Distinguish missing, failed, inactive, below detection, above quantitation,
140 and structurally invalid records.
1415. Split related analogues, scaffolds, batches, time, sites, or subjects before
142 learned preprocessing to prevent leakage. Random row splits can be
143 misleading.
1446. Compare robust/classical summaries and investigate outliers against
145 measurement and structure; do not delete automatically.
1467. Treat transformations (for example log concentration) as scientifically
147 defined and retain units/inverse interpretation.
1488. Label descriptor/property screening as exploratory and define multiplicity
149 control for inferential follow-up.
1509. Do not infer binding, efficacy, toxicity, mechanism, or causal effects from
151 EDA alone.

Chemistry EDA rigor

  1. Define the independent unit: compound, batch, conformer, frame, calculation, assay plate, specimen, or replicate.
  2. Preserve raw structures and measured values; record standardization as a derived transformation.
  3. Create a data dictionary with units, assay endpoints, bounds, censoring, LOD/LOQ, qualifiers, and provenance.
  4. Distinguish missing, failed, inactive, below detection, above quantitation, and structurally invalid records.
  5. Split related analogues, scaffolds, batches, time, sites, or subjects before learned preprocessing to prevent leakage. Random row splits can be misleading.
  6. Compare robust/classical summaries and investigate outliers against measurement and structure; do not delete automatically.
  7. Treat transformations (for example log concentration) as scientifically defined and retain units/inverse interpretation.
  8. Label descriptor/property screening as exploratory and define multiplicity control for inferential follow-up.
  9. Do not infer binding, efficacy, toxicity, mechanism, or causal effects from EDA alone.
Raw lines 131 to 152
153## Recommended reference-only tooling
155Pin and validate tooling per project rather than treating this list as bundled
156support:
158- Gemmi or Biopython for PDBx/mmCIF/PDB;
159- RDKit or Open Babel for Molfile/SDF/SMILES;
160- ASE for XYZ and computational structures;
161- MDAnalysis or MDTraj for topology/trajectory pairs; and
162- cclib for supported quantum-chemistry outputs.
164Check each parser's current format table and release notes. Never pass untrusted
165property text to shell commands or dynamic evaluation.

Recommended reference-only tooling

Pin and validate tooling per project rather than treating this list as bundled support:

  • Gemmi or Biopython for PDBx/mmCIF/PDB;
  • RDKit or Open Babel for Molfile/SDF/SMILES;
  • ASE for XYZ and computational structures;
  • MDAnalysis or MDTraj for topology/trajectory pairs; and
  • cclib for supported quantum-chemistry outputs.

Check each parser's current format table and release notes. Never pass untrusted property text to shell commands or dynamic evaluation.

Raw lines 153 to 166
167## Authoritative sources
169Current parser APIs and format guidance reviewed 2026-09-30. Historical
170methodology citations are retained as source context.
172- wwPDB, [File Formats and the PDB](https://www.wwpdb.org/documentation/file-formats-and-the-pdb)
173 (PDBx/mmCIF is the official archive/working format; legacy PDB format 3.30
174 where representable).
175- wwPDB, [PDBx/mmCIF Dictionary Resources](https://mmcif.wwpdb.org/) and
176 [current user guide](https://mmcif.wwpdb.org/docs/user-guide/guide.html).
177- wwPDB, [legacy PDB format 3.30](https://www.wwpdb.org/documentation/file-format-content/format33/v3.3.html).
178- IUCr, [CIF format specifications](https://www.iucr.org/resources/cif/spec)
179 (links to CIF 1.1 and 2.0 syntax).
180- RDKit, [current file parsing API](https://www.rdkit.org/docs/GettingStartedInPython.html#reading-and-writing-molecules).
181- MDAnalysis, [supported topology and trajectory formats](https://userguide.mdanalysis.org/stable/formats/index.html).
182- cclib, [supported programs and data](https://cclib.github.io/data.html).
183- NIST/SEMATECH, [Exploratory Data Analysis](https://www.itl.nist.gov/div898/handbook/eda/eda.htm).
184- scikit-learn, [data leakage guidance](https://scikit-learn.org/stable/common_pitfalls.html).

Authoritative sources

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

Raw lines 167 to 184