Back to Claude Scientific Skills

Chemistry and Molecular Formats

skills/exploratory-data-analysis/references/chemistry_molecular_formats.md

2.55.08.4 KB
Original Source

Chemistry and Molecular Formats

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

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 reports reference-only status and does not sniff content or guess a producer.

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.

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.

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.

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.

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.

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.

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.

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.

Authoritative sources

All links accessed 2026-07-23.