CAPSChain Assembly and Packing Suite

Tutorial 07

Analysing trajectories

Density, structure, chain dimensions, dynamics, free volume and cohesive energy from any trajectory CAPS reads, with errors, curves for plotting, and figures.

Time 10 minutesLevel first stepsUses analyze · rdf · chains · frames · render · pipeline

One command, many properties

caps analyze computes any set of properties over the frames of a trajectory (from CAPS, LAMMPS, GROMACS or AMBER) and reports each with its method and a block-average error:

caps analyze ps.lammpstrj --topology ps_md.data --props density,rg,ree,cn --json props.json
caps analyze ps.lammpstrj --topology ps_md.data --props rdf,sq --pair C-C --inter --csv curves
PropertyWhat it gives
densitymass over cell volume
rdf, sq, xray, neutrong(r) by element pair (--pair C-C, --inter for different molecules only), S(q), scattering
rg, ree, cn, persistenceradius of gyration, end-to-end distance, characteristic ratio C\(_n\) and C\(_\infty\), persistence length
msd, diffusion, relaxationmean-square displacement, D from its slope, end-to-end relaxation
ced, deltacohesive energy density and the Hildebrand solubility parameter
ffv, psdfractional free volume and the pore-size distribution (--probe, --grid)
crosslinks, entanglementsnetwork measures, primitive-path entanglements
zprofile, adhesion, interaction, orientationinterfaces (--surface, --axis)

The diffusion coefficient comes from the Einstein relation in the mean-square displacement's linear range:

$$D = \lim_{t\to\infty} \frac{\langle |\mathbf{r}(t) - \mathbf{r}(0)|^2 \rangle}{6t}$$

so give the time between frames: --frame-ps 0.2 (or --timestep-fs 1 when the dump records step numbers).

Choosing frames

--first, --last and --stride pick frames; drop the equilibration part of a run with --first. caps frames writes a thinned or converted copy:

caps frames ps.lammpstrj thin.dcd --topology ps_md.data --stride 2

Quick looks

caps rdf ps_md.data --pair C-C --inter       # g(r) of one frame
caps chains ps_md.data                       # backbones and mean-square internal distances
caps shape ps_md.data                        # per-molecule Rg and shape
caps render ps_md.data -o ps.png --style sticks --colour molecule

Pipelines

For analysis you repeat, save the chain of steps (selections, modifiers, Python steps) as a pipeline, from the Studio or by hand, and run it on one frame or on many trajectories:

# steps.yaml: a pipeline saved from the Studio, or written by hand
caps pipeline ps_md.data --steps steps.yaml --out out
caps run steps.yaml --input 'runs/*/traj.lammpstrj' --csv results.csv

Next