CAPSChain Assembly and Packing Suite

Command line · guide

The caps command line

How the caps command is organised, the conventions every command shares, which command to reach for at each step of a project, and the scripts CAPS writes for you to run on a workstation or a cluster.

First steps

Run caps with no arguments to see every command and its main options on one screen. The workflow commands (coarse-graining and DFT surfaces) also take --help, which prints every option with its default and the reason for that default:

caps                      # the usage: every command
caps cgfit --help         # one command's options, defaults and reasons
caps info ps.data          # any structure: atoms, molecules, bonds, cell, frames

caps info is the quickest check that a file reads as you expect. Sample structures and recipes ship in the program's samples folder.

Conventions every command shares

Units

CAPS works in LAMMPS real units throughout: lengths in Å, time in fs (time steps) or ps (run lengths, where an option says so), temperature in K, pressure in atm, energy in kcal/mol, density in g/cm³, charge in e. Options name their unit in the usage when it is not one of these.

Files

The format follows the extension, both ways:

KindReadWritten
Structures.data (LAMMPS), .pdb, .xyz, .mol2, .sdf/.mol, .cif, .car/.mdf, .gro + .top, .vasp/POSCAR/CONTCAR, AMBER prmtop with coordinatesthe same, chosen by -o
TrajectoriesLAMMPS dump (.lammpstrj), .dcd, .xtc, .trr, multi-frame .xyz, AMBER NetCDF / mdcrdcaps frames writes .lammpstrj, .dcd, .xyz, .pdb, .gro, .trr
Force fieldsCAPS force-field JSON (data/forcefields), or a library name such as opls2005, pcff, compassLAMMPS data + input, GROMACS .top/.itp/.gro/.mdp, DL_POLY
Recipes, pipelinesYAML or JSON—

A trajectory carries no bonds, so commands that read one take --topology DATA (the data file of the same atoms). -o names the output; a folder for the commands that write several files.

Seeds and threads

Everything random takes --seed (default 1): the same command, input and seed give the same result on the same build. The commands that run in parallel (md, run, pack) take --threads N (default: all cores).

Provenance

The recipe runner and the coarse-graining and DFT commands write FILE.provenance.json beside what they make: the program's version, the inputs' SHA-256, every step with its parameters, seed and the methods it follows. caps provenance FILE --methods turns it into a methods paragraph with numbered references, --bibtex into BibTeX, and --compare OTHER lists what differs between two runs.

Output and exit codes

Commands print a short report and the files they wrote. --json (recipes, coarse-graining and DFT commands) prints the result as JSON for scripts. A command exits 0 on success and non-zero on an error. caps run distinguishes 2 (bad input), 3 (parameters missing from the force field) and 4 (a failed run); caps validate exits 1 when a slab fails a check, so it can stop a batch script.

Which command for what

Each command links to its full entry in the command reference, which is generated from the program itself.

Build structures

Molecules, chains, cells, crystals, surfaces and fillers.

CommandWhat it does
caps builda 3D molecule from SMILES, with conformers and a force-field clean-up
caps growpolymer chains of any repeat units grown in a periodic cell (tacticity, copolymer sequences)
caps blendtwo or more polymers in one cell: mixed, as slabs or as a droplet
caps peptidean all-atom peptide from a sequence: helix, strand or your secondary structure, at a pH
caps crystala crystal from a space group and sites, or a CIF's symmetry found
caps surfacea slab cut from a crystal at (hkl), terminations listed
caps interfacea polymer film grown on a crystal surface
caps nanonanotubes, graphene sheets and nanoparticles, alone or in a polymer matrix
caps porea fluid in a slit, cylindrical or framework pore
caps solvatesolvent and ions packed around a solute
caps packmolecules packed by a packmol-style input
caps editscripted edits: elements, bonds, hydrogens, geometry, stereo, supercells, vacuum

Force fields

Types, charges and parameters; exports for LAMMPS, GROMACS and DL_POLY.

CommandWhat it does
caps ffforce fields: import, inspect, type atoms by SMARTS rules, apply parameters and export
caps fieldthe default force field's types, terms and energy for a structure

Relax and run

Minimisation, molecular dynamics, equilibration protocols, regrowth, crosslinking and recipes.

CommandWhat it does
caps relaxenergy minimisation (L-BFGS, CG, FIRE) with push-off and box relaxation
caps mdmolecular dynamics: NVE, NVT, NPT, constraints, checkpoints
caps equilibrateequilibration protocols: Larsen's 21 steps, annealing cycles, push-off, until converged
caps cbmcconfigurational-bias Monte Carlo regrowth of chain ends
caps reactcrosslinking and curing by reaction templates, cycle by cycle
caps runa recipe (build to export in one file) or a saved pipeline over many inputs

Properties

Mechanics, glass transition, elastic constants and interfaces.

CommandWhat it does
caps tensileuniaxial tension: stress–strain curve, modulus, yield
caps tgglass transition from a cooling scan of density
caps elasticelastic constants by static strain or stress fluctuations
caps pullpull-out of a film from a surface: interfacial shear strength, work of separation

Inspect and analyse

Files, structure, trajectories and figures.

CommandWhat it does
caps infowhat a file holds: atoms, molecules, bonds, cell, frames
caps checkfile checks: counts, bonds, contacts, charges, cell
caps contactsthe closest distance between atoms of different molecules
caps chainsbackbones and mean-square internal distances
caps shapeper-molecule radius of gyration and shape
caps rdfradial distribution function of one structure
caps analyzeproperties over a trajectory: density, g(r), S(q), Rg, C∞, MSD, CED, free volume, interfaces
caps framesa trajectory thinned or converted
caps converta structure in another format
caps rendera picture (PNG or SVG) of a structure without the Studio
caps pipelinean analysis pipeline on one frame: attributes and tables

Reproducibility

Provenance, bundles and the validation suite.

CommandWhat it does
caps provenancehow a file was made: steps, methods paragraph, BibTeX, comparison of two runs
caps bundlea figure's data with its pipeline, provenance and hashes
caps reproducea bundle rebuilt from its input, checked by SHA-256
caps benchthe built-in validation suite against reference values

Coarse-graining

Chemistry-aware mapping, bonded and non-bonded potentials, melts, entanglements, backmapping.

CommandWhat it does
caps cgmapchemistry-aware mapping to beads by SMARTS rules; trajectories mapped frame by frame
caps cgfitCG potentials: bonded Boltzmann inversion, per-pair IBI, fits, T_g, σ/ε calibration
caps cgbuilda CG melt of repeat units with real sequence statistics
caps ppaentanglements: primitive paths and the N_e estimators
caps mechtension decks for CG melts and their analysis (modulus, yield, strain hardening)
caps cgdynchain dynamics: g₁, g₂, g₃, D, τ_R, τ_e; CG-to-AA time mapping
caps backmapCG beads back to all atoms, fragment by fragment, with a relaxation deck

Biomolecular coarse-graining

Secondary structure and Martini proteins.

CommandWhat it does
caps dsspDSSP secondary structure of a protein
caps martinia Martini 2.2 or 3 protein model

DFT surfaces

2D sheets, terminations, adsorption complexes and VASP case folders.

CommandWhat it does
caps sheeta 2D sheet from a preset or cut from a bulk structure
caps terminateterminations (O, OH, F …) on both faces of a sheet
caps validatePASS/FAIL checks of a 2D slab
caps adsorb-dfta molecule on a slab in several placements, for DFT
caps vasp-setone VASP case folder: POSCAR, INCARs with reasons, KPOINTS, job script
caps vasp-convENCUT and k-mesh convergence
caps vasp-scanscans: make the cases, fit the curve
caps vasp-derivedfollow-up runs: charges, charge-density difference, frequencies, AIMD
caps vasp-jobssubmit, update, reset, clean up and store many VASP jobs
caps vasp-checkcheck a case before or after running
caps vasp-progressprogress of running cases
caps vasp-healthstuck or failing runs
caps vasp-bindadsorption energies from slab, molecule and complex
caps vasp-analyzegeometry, work function, DOS, Δρ, Bader, frequencies, AIMD, the summary table

Scripts CAPS writes for you to run

Long runs belong on a workstation or a cluster, not inside CAPS. For those, CAPS writes ready-to-run inputs and scripts, each with a comment block at the top saying how to run it and which variables it takes.

FileWritten byRun it with
STEM.in + STEM.datacaps ff apply … --lammps-input STEM.in, caps runlmp -in STEM.in
STEM.top, .itp, .gro, .mdp (+ STEM_em.mdp)caps ff apply … --gromacs STEM, caps rungmx grompp -f STEM.mdp -c STEM.gro -p STEM.top -o run.tpr then gmx mdrun -deffnm run
react.in, *_pre.mol, *_post.mol, *_map.txtPython Document.bond_react(...)lmp -in react.in (LAMMPS with REACTION)
bonded/bonded.in + tablescaps cgfit bondedinclude it after read_data, with -var BONDED bonded
ibi/run_ibi.sh, in.cg_run, in.cg_tgcaps cgfit ibi-startbash ibi/run_ibi.sh 20 (20 iterations; CAPS_LMP picks the LAMMPS binary)
melt/in.cg_equilcaps cgbuildlmp -in in.cg_equil -var DATA melt.cg.data -var BONDED ../bonded -var PAIR ../lj -var OUT equil
in.cg_ppa + STEM.ends.incaps ppa … --method lammpslmp -in in.cg_ppa -var DATA equil.data -var OUT ppa, then caps ppa MAP equil.data ppa.lammpstrj
tension/run_tension.sh, in.cg_tensile_*caps mech decksDATA=equil.data bash run_tension.sh, then caps mech analyze
aa/in.backmap, pair_coeffs.incaps backmaplmp -in in.backmap -var DATA backmapped.data -var OUT relaxed, then caps backmap check
job.slurm, make_potcar.sh, INCAR.*, KPOINTScaps vasp-set, caps adsorb-dftbash make_potcar.sh (your PAW set), sbatch job.slurm; caps vasp-jobs submits and tracks many

Putting commands together

A shell loop over seeds

Independent replicas differ only in the seed; the provenance records it, so caps provenance --compare shows exactly that difference.

for s in 1 2 3; do
  caps grow -o ps_$s.data --chains 4 --dp 10 --density 0.5 --units '*CC(*)c1ccccc1' --seed $s
  caps relax ps_$s.data -o ps_${s}_min.data --quiet
  caps md ps_${s}_min.data -o ps_${s}_md.data --steps 2000 --barostat berendsen --seed $s --quiet
done
caps analyze ps_1_md.data --props density

A recipe instead of a script

When the chain is fixed (build, type, grow, relax, equilibrate, run, analyse, export), write it once as a recipe and run it with caps run. The recipe's hash, every stage's parameters and the seed go into the provenance, so the whole study can be rebuilt; see Tutorial 03.

Pipelines over many trajectories

caps pipeline FILE --steps STEPS.yaml runs a chain of analysis steps (the Studio's pipeline, including Python steps) on one frame; caps run PIPELINE.yaml --input 'runs/*/traj.lammpstrj' --csv results.csv runs it over many inputs and writes one row per input.

Command line, Python or Studio?

All three call the same core, so results agree. Use the command line for batch work, shell scripts and clusters; Python (import caps) when a study needs loops, conditions or your own analysis, or features with no command yet (CAPS React's fix bond/react export, polymer sweeps, χ by MD); the Studio to look at structures, build interactively, and read plots and the methods report. The Studio's Coarse-grain and DFT pages show the equivalent command line for what you set up, ready to copy.