Skip to main content

Function: parsePdbTrajectory()

parsePdbTrajectory(text, options): PdbTrajectory

Defined in: src/mobjects/molecular/pdb.ts:539

Parse a multi-MODEL PDB into an MD-style trajectory.

Each MODEL...ENDMDL block is one frame; a PDB with no MODEL records parses to a single-frame trajectory (backward compatible with parsePdb). The frames share the atom ordering of the first model, so a Molecule3D built from structure.atoms can be driven across frames.

Parameters​

text​

string

The PDB file contents.

options​

ParsePdbOptions = {}

Parse options (e.g. ParsePdbOptions.includeWater).

Returns​

PdbTrajectory

The parsed trajectory.

Throws​

If no model has any atoms, or if two models have different atom counts.