Skip to content

MD/NMR analysis

MD and NMR analysis are implemented through the same pipeline runtime described in the Pipeline section, which is why the lower-level execution details live there. This page gives a more focused, practical view.

In contrast to “many independent small files,” MD/NMR inputs are usually one large structure/trajectory stream that expands into many conformers (frames/models). That changes the performance problem: repeatedly rebuilding full structure state per frame would be too expensive, so the pipeline has to stream efficiently.

Lahuta’s streaming path is optimized for this pattern. It builds the structural description (system) and topology interpretation on the first frame, then updates positions for subsequent frames. In practice, this means frame-to-frame processing can stay fast because most expensive setup work is reused.

from lahuta.pipeline import Pipeline
from lahuta.sources import MdTrajectoriesSource, NmrSource

# MD stream
md = Pipeline(MdTrajectoriesSource([("traj.gro", ["traj.xtc"])]))

# NMR stream
nmr = Pipeline(NmrSource(["nmr_models.cif.gz"]))

Treat this area as experimental today. It works, but it has not yet been tested as extensively as other parts of the library.

Current caveats:

  • MD structure input currently supports GRO and PDB.
  • MD trajectory input currently supports XTC.
  • NMR streaming assumes every conformer has the same atom count.

That last NMR constraint is a hard assumption in the current streaming/update design, because coordinate updates rely on consistent atom indexing across conformers.