<!-- https://docs.dseams.info/reference/cli.md -->

# seams CLI {#seams-cli}

The engine command is `seams`. The parser is Argum. Help, errors,
ice-type counts, and `--features` are colorized through Argum’s
`environmentColorStatus`. `NO_COLOR` turns the colors off.

```text
seams --help
seams --version
seams --features
seams read FILE
seams chill FILE
seams chill-plus FILE
seams cages FILE
seams rdf FILE
seams cn FILE
seams hbonds FILE
seams pairs FILE
seams density-z FILE
seams domains FILE
```

The same commands on the bundled multi-type frame. `pairs` and `domains`
need `--site`, so the runnable lines include it:

```bash
seams read input/traj/il_tiny.lammpstrj
seams chill input/traj/il_tiny.lammpstrj
seams chill-plus input/traj/il_tiny.lammpstrj
seams cages input/traj/il_tiny.lammpstrj
seams rdf input/traj/il_tiny.lammpstrj
seams cn input/traj/il_tiny.lammpstrj
seams hbonds input/traj/il_tiny.lammpstrj
seams pairs input/traj/il_tiny.lammpstrj --site '1=cationHead,2=anion'
seams density-z input/traj/il_tiny.lammpstrj
seams domains input/traj/il_tiny.lammpstrj --site '1=cationHead,2=anion,3=tail' --subset polar
```

A positional `command` and a positional `file` are required. Missing
either, an unknown command, or a parse error exits 2.

Every command accepts `--format text|json`. Text is the human-readable
format documented below. JSON writes one object per line, one object
per output frame, with the fields `schema` (`dseams.cli/v1`), `command`,
`frame`, `status`, and `text`. The `text` field is the command’s text
output, with JSON escapes for characters that need them.
`--strict-input` returns 2 when a requested
frame has no atoms; without it, empty input retains the legacy text output.
An MPI build appends a sentence to the `--last` help: under `mpiexec` the
ranks share a dump’s frames, each with `--jobs` workers, and `SEAMS_MPI=0`
keeps MPI off.

## Commands {#commands}

The `command` positional help string is `read | chill | chill-plus | ovito-chill+ | cages | symmetry | rings | prisms | cluster | fingerprint | ions | f4 | steinhardt | rdf | cn | hbonds | pairs | density-z | domains`. `chill_plus` is an accepted alias of
`chill-plus`, and `ovito_chill_plus` is an accepted alias of
`ovito-chill+` (neither alias is listed in that help string).

| command | action | stdout |
| --- | --- | --- |
| read | print the loaded cloud | nop N frame F box Lx Ly Lz and, when box.size() >= 6, xy xz yz |
| chill | CHILL labels | nop N then name count for each ice type present |
| chill-plus | published CHILL+ (shell of 4, four-nearest q3, neighbour test) | same as chill. --rule selects the rule. --layers adds phi-c P stack S. --tum-layers adds tum-phi-c P tum-stack S |
| ovito-chill+ | OVITO 3.17.2 CHILL+ (shell of 4, full-shell q3, no neighbour test) | same as chill-plus |
| symmetry | space group, one shell overlay, and the ice-label tally | symmetry backend NAME, then space-group NUMBER SYMBOL, space-group off, or space-group none. A matching whole cell adds the overlay and point-group SYMBOL N. One shell overlay, then shells LABEL N ... unmatched U. IRA, SOFI, and spglib run only when that build linked them. No atoms or no box prints symmetry needs a frame and a box and exits 2 |
| rings | primitive rings on the cutoff list. --max-ring N is the largest size (default 6). A value below 3 is read as 6 | nop N rings R then one SIZE COUNT line for each size that occurs |
| prisms | perfect and imperfect prisms of size 3 to 6 on the mutual four-nearest graph | nop N, then size S perfect P imperfect I for each size, then perfect P imperfect I |
| cluster | largest connected component of the loaded atoms | nop N largest L subset S percolation P |
| cages | ice score on six-membered rings. The four counts are disjoint and sum to the water atoms: hexagonal only, cubic only, both, water | nop N graph KIND hexagonal IH cubic IC both B water W |
| cages --signature SPEC | closed polyhedra whose ring-size census matches SPEC; each vertex lies on at least three faces that close around it, V - E + F = 2, and rings that wind the periodic cell are left out | one line per signature, nop N graph KIND signature S cages C atoms A. --incomplete adds incomplete K. --guest-types adds guests G occupied O multiple M free F, inside 1 with --inside, and occ K:N when the histogram is not empty. --shape adds shape N:GROUP |
| fingerprint | topology keys of the bonded graph | nop N graph KIND hops H method M key K classes C rings 3:a 4:b ... top key=count ... |
| fingerprint --by-atom | the summary, then one row per atom | atom I species S coord C homopolar H rings SIZE:COUNT ... |
| fingerprint --emit-library LABEL | the frame’s distinct keys as library lines | # method M hops H colors C then key LABEL rows |
| fingerprint --library FILE[,FILE...] | atoms named by key libraries | nop N graph KIND hops H method M matched X label=count ... unmatched=U and, with several libraries, depth H1=n1 H2=n2 |
| ions | ions classed by their first water shell against the seeded cages. An empty cloud prints nop 0 | nop N ice A ions I in-ice X front Y liquid Z shell S shell-ice F clusters C ions-in-ice J capped K broken B |
| f4 | Rodger F4 on H-O…O-H pairs | nop N f4 MEAN n M |
| steinhardt | cutoff-shell Steinhardt parameters for the degrees named by --l (default 4,6) and their Lechner-Dellago averages. Degrees 4 and 6 use the solid-harmonic kernel. --l 3,4,6,12 is the former four-degree line | nop N then qL A qLbar B for each requested degree, in the order given |
| rdf | partial site-site g_{IJ}(r) | # r g count then # types I J rmax R bins N volume V then one r g count row per bin |
| cn | site-site coordination number | # site-site then # types I J cutoff R cn X nI N nJ M volume V |
| cn --ions --site | cage degree on ionCloud | cage ionCloud types 1 2 cutoff R degree D nCation N nAnion M |
| hbonds | geometric hydrogen-bond count | nop N hbonds E |
| pairs --site | mutual-nearest contact pairs | contact-pair count N nCation C nAnion A |
| density-z | type-resolved \rho along one axis | # z rho then one z rho row per bin |
| domains --site | polar/apolar Stoddard component. --subset defaults to polar; tail is apolar | subset polar n N largest L P P_inf |

`chill` / `chill-plus` default to `--graph cutoff`: `nneigh::neighListO`,
every pair closer than `--cutoff`. `--graph mutual` (alias `knn`) calls
`nneigh::kNearestNeighbourList` with `k = 4`, mutual; there `--cutoff`
is only the cell-size hint (`cutoff + 1.5`). Other graphs exit 2.
Published cutoff `chill-plus` classifies in `chill::chillPlusPublishedCutoff`
(one cutoff CSR and the fused $q_3$). Every other published call goes
through `chill::applyChillPlus`, which builds that same CSR from the
neighbour rows and calls `chill::chillPlusFromCsr`. `ovito-chill+` stays
on `chill::getCorrelPlus` / `chill::getIceTypePlusNoPrint` with open
edges. `chill` calls `chill::getCorrel` / `chill::getIceTypeNoPrint`.
`--water-types T,U` is the neighbour mask (OW only); `--type` is the
load filter and is not that mask. Ice names are the
`molSys::atom_state_type` enumerators: `cubic`, `hexagonal`,
`water`, `interfacial`, `clathrate`, `interClathrate`, `reCubic`,
`reHex`, `unclassified`.

`cages` reports cage membership, not CHILL labels. Hexagonal is
HC only (Ih), cubic is DDC only (Ic), both is an atom on both,
and water is neither. The bond graph is `--graph`.

`rdf` and `cn` call `rdf::partialRdf` on LAMMPS type IDs from
`--pair-types I,J` (default `I = J = --type`). `--cutoff` is rmax. `--bins`
is optional. The volume is `nneigh::dumpVolume` (det of dump `H`).
`cn` integrates the site-site RDF to that cutoff
(`rdf::coordinationNumber`). Help text and the `cn` header say
`site-site`. `cn --ions --site` is the cage degree, documented in the
next paragraph.

`cn --ions --site SPEC` builds `site::ionCloud` and prints the mean
unlike degree of type-1 (cation) vertices from
`nneigh::neighList(cutoff, ions, 1, 2)`. The line contains `cage`.
`pairs --site SPEC` prints the size of
`nneigh::mutualNearestUnlike(ions, 1, 2)`. That line contains
`contact-pair`, not ionicity. Both need `--site`.

`density-z` calls `site::densityZ`. `--type 0` (default) keeps
every atom; `--type I` keeps that LAMMPS type. `--axis` is `x`,
`y`, or `z` (default `z`). `--bins` defaults to the bound span
over $0.1$. Each slab volume is $A_\perp \times dz$, with
$A_\perp$ from dump H (recovered `lx, ly, lz`, not bound
spans). This is not an ice score.

`chill`, `chill-plus`, and `cages` call `site::iceScoreAllowed`.
When `--family` is not `waterIce` they print `site::refuseIceScore`
(the message names the family) and exit 2. They do not fall through
to `atom_state_type::water`. Unflagged `seams chill` stays
`waterIce`. If `--family` is absent and the frame has more than two
LAMMPS types, one stderr line names `--family` and the command
still exits 0.

An empty cloud (`nop 0`) still prints. `chill` / `chill-plus` print
`nop 0`. `cages` prints `nop 0 graph KIND hexagonal 0 cubic 0 both 0 water 0`. A signature on an empty cloud prints
`nop 0 graph KIND signature S cages 0 atoms 0` for each signature.
`rdf` / `cn` still emit their headers. `hbonds` prints
`nop 0 hbonds 0`. `f4` prints `nop 0 f4 nan`. `density-z` prints
`# z rho` and zero-density bins. `ions` prints `nop 0`.

`hbonds` loads the heavy-atom cloud with `--type` and the hydrogen
cloud with `--htype`, then builds a cutoff neighbour list. Without
`--donors` it uses the water two-hydrogen-per-molecule set
(`hAtomMolList`). `--donors` passes every hydrogen index to
`populateHbondsFromDonors`. `--hdist` and `--hangle` are the acceptor-H
distance and the acceptor-centered O-O-H angle cutoffs (angle
between OO and OH). The defaults are 2.42 Å and 30 degrees, the
water values in `bond::populateHbonds`. They are not an
ionic-liquid criterion.

## Options {#options}

Names and help text are the Argum `Option` / `Positional`
definitions in `src/seams_cli.cpp`. Defaults are the C++
initializers (Argum does not write defaults into the help).

| flag | default | Argum help |
| --- | --- | --- |
| -h, --help |  | show this help message and exit |
| -v, --version |  | Print version information |
| --features |  | Print compile-time backends |
| -f, --frame N | 1 | First frame (1-based) |
| --last N | omitted (0) | Last frame (inclusive). Omit for a single --frame |
| -j, --jobs N | 1 | Parallel frame workers (OpenMP). 1 is serial |
| --rebuild | off | Recompute rings and cages on every frame. A one-worker frame range otherwise updates them from the previous frame; the output is the same |
| --format KIND | text | Output format: text (default) or json |
| --strict-input | off | Fail when a requested frame produces no atoms |
| -t, --type I | 0 | Atom type (0 guesses oxygen then type 1; density-z: 0 is every atom) |
| --resname NAME[,NAME...] | unset | Keep chemfiles residues with these names |
| --exclude-resname NAME[,NAME...] | unset | Exclude chemfiles residues with these names |
| --atomname NAME[,NAME...] | unset | Keep chemfiles atoms with these names |
| --exclude-atomname NAME[,NAME...] | unset | Exclude chemfiles atoms with these names |
| --type-map NAME=ID[,NAME=ID...] | unset | Override chemfiles atom names with positive type IDs |
| --water-types T,U | unset | Neighbour graph on these LAMMPS types only (OW). Substrate and ions never enter the 4-NN list. A type that is not in the frame is an error |
| --mol SPEC | unset | Water oxygens by molecule: water, or ids such as 1,5-12. Neighbours, CHILL, CHILL+, rings and cages then ignore ions. A missing id is an error |
| --rule NAME | published chill+ | chill-plus rule: chill+ (published default) or ovito-chill+. A path to a readable file is scanned for a rule or chill-plus key. Comments are skipped. The file is not executed as Lua or YAML. CHILL_PLUS_RULE fills an unset flag |
| --layers | off | chill-plus: literature I_sd reference from CHILL+ molecule bins (Phi_c and H/C string) |
| --tum-layers | off | chill-plus: TUM stacking from HC-basal and DDC-equatorial rings, not CHILL+ molecules |
| --shape | off | cages --signature: point group of each found cage, from those vertices only |
| --inside | off | cages --guest-types: assign by ray-parity inside the fan-triangulated faces, not nearest centroid |
| --per-atom FILE |  | chill\vert{}chill-plus\vert{}cages\vert{}fingerprint\vert{}ions: append a LAMMPS dump frame with one extra per-atom column (label, cage, class or state) for OVITO or VMD |
| --subset KIND | polar | domains subset: polar \vert{} apolar. tail is accepted as apolar |
| --by-atom | off | fingerprint: one row per atom with coordination, same-species bonds, and primitive rings through that atom |
| --max-ring N | 6 | Largest primitive ring kept by rings (default 6) |
| --pair-types I,J | I = J = --type | Pair types for site-site rdf/cn (default I=J=--type) |
| --types I,J |  | Deprecated exact alias of --pair-types. The handler prints --types is deprecated; use --pair-types on stderr |
| --family NAME | waterIce | Material family (default waterIce): waterIce, ionicLiquid, moltenSalt, des, electrolyte, confinedIL, confinedWater, networkFormer |
| --site SPEC |  | Type-to-kind map for ionCloud (1=cationHead,2=anion) |
| --ions |  | cn on ionCloud cage degree (needs --site) |
| -c, --cutoff ANGSTROM | 3.5 | Neighbour cutoff (rdf/cn rmax; hbonds heavy-atom nList) |
| --l LIST | 4,6 | Steinhardt degrees, comma-separated. Default 4,6, the solid-harmonic pair. 3, 8 and 12 are computed only when named |
| --cage-edge SPEC | 2.65,3.15 | cages --signature: keep a face only when every edge lies in LO,HI (coordinate units of the file; default 2.65,3.15). none uses the face census alone (SEAMS_CAGE_EDGE) |
| --bins N | rmax / 0.1 or box[axis] / 0.1 | Histogram bins (rdf: rmax/0.1; density-z: L/0.1) |
| --axis XYZ | z | Histogram axis for density-z (x\vert{}y\vert{}z, default z). 0, 1, and 2 are accepted |
| -k N | 4 | k for knn / seeded cages |
| --graph KIND | seeded | Bond graph. cages: cutoff \vert{} knn \vert{} knn-union \vert{} seeded. chill and chill-plus: cutoff \vert{} mutual. Help then appends the stored name, seeded unless the runtime table changed it |
| --complete | off | Seeded cages: fill the last vertex of six-rings whose other vertices carry a label (ring completion) |
| --signature SPEC |  | cages: ring-size census (4:6,6:8) or a named table entry (sodalite\vert{}alpha\vert{}512\vert{}51262\vert{}51264\vert{}51268\vert{}sh\vert{}hc\vert{}ddc); join several with + for one line each. Joined signatures share one ring network and one cage search |
| --incomplete | off | cages --signature: also report cups and incomplete cages on the ring graph |
| --guest-types T,U |  | cages --signature: LAMMPS types of guests (methane, THF, ions) placed in the found cages by their periodic centroids |
| --guest-radius R | 4.0 | cages --signature: a guest belongs to the nearest cage center within R (default 4.0) |
| --hops N | 2 | fingerprint: bonds from the center in each local key (default 2) |
| --color-types | off | fingerprint: color vertices by LAMMPS type, so species never match across types. --colour-types is the same option and is left out of help |
| --library FILE |  | fingerprint: key library (from --emit-library) to name atoms by; several, comma separated, at different hop counts name each atom by the deepest that knows it |
| --emit-library LABEL |  | fingerprint: print the frame's distinct keys as library lines under LABEL instead of the summary |
| --ion-types I,J |  | ions: LAMMPS types read against the cage assignment |
| --ion-cutoff ANGSTROM | --cutoff | ions: first water shell radius (default --cutoff) |
| --htype I | 1 | Hydrogen atom type for hbonds and f4 |
| --hdist ANGSTROM | 2.42 | Acceptor-H distance cutoff for hbonds |
| --hangle DEG | 30 | O-O-H angle cutoff for hbonds (acceptor-centered) |
| --donors | off | Use every hydrogen as a donor candidate |
| --config FILE | SEAMS_CONFIG or ./seams.env | Dotenv of SEAMS_* / LINKCELL_* knobs. Env wins over the file |
| --print-config |  | Print the resolved runtime knobs and exit |
| --tpp N | 0 (occupancy picker) | Threads per particle for the device k-NN (LINKCELL_TPP) |
| --block N | 0 | CUDA block size (LINKCELL_BLOCK / SEAMS_BLOCK) |
| --resident FRAC | 0.80 | Fraction of free device memory for a resident batch (SEAMS_RESIDENT) |
| --cell ANGSTROM | 3 | Link-cell hint so NPT frames share a grid (SEAMS_CELL) |

`--help`, `--version`, `--features`, and `--print-config` print and
exit 0 before any file is opened.

`--tpp`, `--block`, `--resident`, and `--cell` apply to the device
TUM ice score (`seams cages`) only. CHILL and $q_{lm}$ stay on
the host.

`--cutoff` is in Angstrom. `-k` also applies to `knn-union` (the
same `k` feeds `nneigh::kNearestNeighbourList`). `--graph` is used
by `cages` and `fingerprint`; a fingerprint wants one graph, so
`seeded` (two graphs) falls back to `cutoff` there. `--complete` is used by `cages` and `ions`: it
passes `true` as the fifth argument of `seededCageAffiliation`.

## `--type` {#type}

| value | single frame (load) | --last range (forEachLammpsFrame) |
| --- | --- | --- |
| 0 | LAMMPS: type 2, then type 1 if that cloud is empty. chemfiles: keep every atom. XYZ: every atom is type 1 | LAMMPS: every atom (sinp::readLammpsTrj). Classification uses cloud.pts[0].type |
| I > 0 | LAMMPS readLammpsTrjO / chemfiles filter I | LAMMPS readLammpsTrjO with that type. The CLI does not pass a coordinate slice. |

XYZ always stores type 1. Classification still uses `--type` after
the read (type 0 then becomes 1).

A mixed-type dump that is not the water guess needs `--type I`.
`density-z` treats `0` as every atom, not the oxygen guess.
See [Ionic-liquid dumps](../user/howto/ionic-liquid.md).

## Chemfiles name filters {#chemfiles-name-filters}

`--resname` and `--atomname` are include filters. Comma-separated
names within one flag are alternatives; residue and atom filters are
both required when both are present. `--exclude-resname` and
`--exclude-atomname` take precedence over includes. Names are exact and
case-sensitive.

`--type-map NAME=ID` assigns a positive d-SEAMS type before chemfiles
element inference. Several assignments may be comma-separated. This is
useful when force-field atom names encode chemically distinct sites.
Without a map, names of the form `X_suffix` use the element prefix `X`;
for example, `O_2`, `N_2`, `C_3`, `C_2`, `C_R`, and `H_` become their
atomic-number types instead of type 0. Map every carbon site separately
when the analysis must distinguish those force-field names.

For topology-free trajectories, d-SEAMS uses a same-stem topology when
present: `run.xtc`, `run.trr`, and `run.nc` use `run.gro`; `run.dcd`
uses `run.pdb`. The topology supplies residue and atom names for these
filters and mappings. The committed example is
`input/traj/confined_water_40.xtc`, with the matching GRO beside it.

```bash
seams chill-plus input/traj/confined_water_40.xtc --frame 1 --last 3 \
  --exclude-resname SOLX --exclude-atomname MW \
  --type-map O_2=21,N_2=22,C_3=23,C_2=24,C_R=25,H_=26 --type 8
```

## `--water-types` {#water-types}

`--type` is a load filter (one LAMMPS type, or the oxygen guess).
It is not the neighbour mask. `--water-types T,U` loads the mixed
dump (`loadType = -1`) and builds `nneigh::kNearestNeighbourList`
/ `kNearestNeighbourPair` on that type set. Ag, I, protein and
ions stay in the cloud for guests and `ions`, but they never
enter the four neighbours of OW. `chill`, `chill-plus`, `cages`
and `ions` honour the flag. Ice and cage counts are the water
types only.

```bash
seams chill-plus FILE --water-types 1
seams cages FILE --graph seeded --water-types 1
seams ions FILE --ion-types 3,4 --water-types 1
```

The same flags on the bundled multi-type frame:

```bash
seams chill-plus input/traj/il_tiny.lammpstrj --water-types 1
seams cages input/traj/il_tiny.lammpstrj --graph seeded --water-types 1
seams ions input/traj/il_tiny.lammpstrj --ion-types 3,4 --water-types 1
```

## `--pair-types` {#pair-types}

Used by `rdf` and `cn`. The Argum form is `I,J` (one comma). A bad
string exits 2 (`bad --pair-types (want I,J)`). Omit the flag to set both
sides to `--type`. These are LAMMPS type IDs on the original cloud
(site-site). `cn --ions` is a different path (ionCloud cage degree).

`--types` is a deprecated exact alias of `--pair-types`. It accepts
the same `I,J` text and prints one warning on stderr. `--type` and
`--types` both bind, because an exact name is taken before a longer
name that starts with the same characters. `--ty` matches both and
is ambiguous.

| --pair-types | single-frame load | --last range |
| --- | --- | --- |
| omitted | same as --type (one species) | same as --type |
| I,I (like) | keep type I | keep type I |
| I,J with I != J | every atom (readLammpsTrj / chemfiles unfiltered) | every atom (typeFilter 0) |

`cmdRdf` / `cmdCn` then call `rdf::partialRdf` on those two integers.
`typeOf` still resolves a zero to the first atom (or 1).

## `seams read` and the box {#seams-read-and-the-box}

`seams read` prints `gen::formatDumpBox`: the three bound spans,
then `xy xz yz` when `box.size() >= 6`. There is no separate tilt
flag. `seams rdf` uses the same dump H (`gen::periodicDist` and
`nneigh::dumpVolume`). `seams density-z` uses recovered `lx, ly, lz` for $A_\perp$, not bound spans. The in-plane sampler remains
`rdf2::sampleRDF_AA`; see
[Sheared cells](../user/howto/sheared-cells.md).

## `--graph` {#graph}

`chill` and `chill-plus` take `cutoff` or `mutual`.
The default is `cutoff`: every pair closer than `--cutoff`.
The stored configuration name of that default is `seeded`, and those two commands map `seeded` onto the cutoff list.
`--graph mutual` keeps the mutual four nearest neighbours, with candidates inside `--cutoff + 1.5`.

`cages` does not make that mapping.

| value | graph |
| --- | --- |
| seeded | mutual k-nearest seeds, union completions (ring::seededCageAffiliation; --complete sets the fifth argument) |
| cutoff | pairs inside --cutoff (nneigh::neighListO) |
| knn | mutual k-nearest (nneigh::BondGraph::KnnMutual) |
| knn-union | union k-nearest (nneigh::BondGraph::KnnUnion) |

`nneigh::bondGraphFromName` also accepts `knn-mutual` and `mutual`
as `knn`, and `union` as `knn-union`. `seeded` is handled in the CLI
and is not a `BondGraph` enumerator. Any other name throws
`std::invalid_argument` (`unknown bond graph 'NAME' (use cutoff, knn, knn-union)`) and `cages` exits 2.

Candidate cutoff for the knn graphs is `--cutoff + 1.5`.

## `--cage-edge` {#cage-edge}

Used by `cages --signature`.
Each face is kept when every minimum-image edge lies in the window.
The default is `2.65,3.15`.
`none` (also `off` or `false`) leaves that test out, and the cage bound is the face census alone, which is the search from before the window existed.
`hc` and `ddc` keep their geometric finders. The window applies to the ring-census search.

The numbers are in the coordinate units of the file.
The LAMMPS dumps in the supplied examples are angstroms, and the default covers the oxygen-oxygen contacts of the reference cells (about 2.74 to 2.81).
Set the window to the heavy-atom contact range of the model.
Widen it for a compressed cell or a guest that stretches a cage.
A file in nanometers uses `0.265,0.315`, or `none` when the contact range is unknown.
Use a comma, a colon, or a slash. `2.65-3.15` is rejected.

```bash
seams cages FILE --graph cutoff --signature 512
seams cages FILE --graph cutoff --signature 512 --cage-edge none
seams cages FILE --graph cutoff --signature 512 --cage-edge 2.4,3.4
```

The same flags on the bundled multi-type frame:

```bash
seams cages input/traj/il_tiny.lammpstrj --graph cutoff --signature 512
seams cages input/traj/il_tiny.lammpstrj --graph cutoff --signature 512 --cage-edge none
seams cages input/traj/il_tiny.lammpstrj --graph cutoff --signature 512 --cage-edge 2.4,3.4
```

The same string is `SEAMS_CAGE_EDGE`.
`dseams.userframe.Frame.cages_by_signature("512", edge="none")` passes it through.
`pydseams.Frame.cages_by_signature` does not take `edge`.
Lua `dseams.cages_by_signature` calls `findBySignature` and does not read a window.
The C entry is `seams_frame_signature_edge`; a null edge string is the default window.

## Runtime knobs {#runtime-knobs}

Defaults live in the binary. An optional dotenv (`SEAMS_CONFIG` or
`./seams.env`) fills unset keys. The process environment wins the
file; CLI flags win the environment. `seams --print-config` dumps
the table.

| variable | default |
| --- | --- |
| SEAMS_FRAME / SEAMS_LAST | 1 / 0 |
| SEAMS_JOBS | 1 |
| SEAMS_CARRY | 1 (0 is --rebuild) |
| SEAMS_TYPE | 0 |
| SEAMS_CUTOFF | 3.5 |
| SEAMS_CAGE_EDGE | 2.65,3.15 (none turns the window off) |
| SEAMS_K | 4 |
| SEAMS_GRAPH | seeded |
| SEAMS_FAMILY | waterIce |
| SEAMS_RESIDENT | 0.80 |
| SEAMS_CELL | 3.0 |
| SEAMS_TPP / LINKCELL_TPP | occupancy picker (0) |
| SEAMS_BLOCK / LINKCELL_BLOCK | occupancy picker (0) |
| SEAMS_OFFLOAD | false (Steinhardt Ylm and TUM cages; 0 forces host) |
| YODA_FENNEL_PATH / YODA_LUA_PATH | empty |

Analysis choice (which command) is not this table.

## File suffix {#file-suffix}

`seams` picks a reader from the path suffix
(`path.find_last_of('.')`):

| suffix | reader | included when |
| --- | --- | --- |
| xyz | sinp::readXYZ | always |
| con | sinp::readCon | SEAMS_HAS_READCON. Otherwise the command fails: readcon-core is not in this build |
| pdb, gro, dcd, xtc, trr, nc, lammpsdata | sinp::readChemfiles | SEAMS_HAS_CHEMFILES. Otherwise the command fails: chemfiles is not in this build |
| the 33 VMD molfile suffixes below | sinp::readChemfiles (chemfiles’ VMD molfile readers) | SEAMS_HAS_CHEMFILES. Otherwise the command fails: chemfiles is not in this build |
| anything else | LAMMPS dump (readLammpsTrjO / readLammpsTrj) | always |

A missing reader does not parse those suffixes as LAMMPS dumps.
`seams --features` reports chemfiles, readcon-core, and readcon-db.

The molfile suffixes, compared exactly (case matters), with the plugin
that reads each and the holder of that plugin’s copyright and licence:

| suffix | format | plugin | copyright and licence |
| --- | --- | --- | --- |
| trj | TRJ | gromacsplugin | University of Illinois, NCSA |
| psf | PSF | psfplugin | University of Illinois, NCSA |
| molden | Molden | moldenplugin | University of Illinois, NCSA |
| bgf | MSI Biograf Format | bgfplugin | University of Illinois, NCSA |
| binpos | Scripps Binpos | binposplugin | University of Illinois, NCSA |
| car | InsightII car | carplugin | University of Illinois, NCSA |
| cor | CHARMM Coordinates | corplugin | University of Illinois, NCSA |
| coor | NAMD Binary Coordinates | namdbinplugin | University of Illinois, NCSA |
| cpmd | CPMD | cpmdplugin | University of Illinois, NCSA |
| cube | Gaussian Cube | cubeplugin | University of Illinois, NCSA |
| dlpolyconfig | DL_POLY CONFIG | dlpolyplugin | University of Illinois, NCSA |
| dlpolyhist | DL_POLY_C HISTORY | dlpolyplugin | University of Illinois, NCSA |
| dms | DESRES Molecular Structure | dmsplugin | Shaw Research, LLC, BSD-3-Clause |
| dtr | DESRES Trajectory | dtrplugin | Shaw Research, LLC, BSD-3-Clause |
| g96 | Gromacs g96 | gromacsplugin | University of Illinois, NCSA |
| js | js | jsplugin | University of Illinois, NCSA |
| log | GAMESS | gamessplugin | University of Illinois, NCSA |
| mae | Maestro File | maeffplugin | Shaw Research, LLC, BSD-3-Clause |
| mdf | InsightII MDF | mdfplugin | University of Illinois, NCSA |
| out | CPMD 3.x output | cpmdlogplugin | University of Illinois, NCSA |
| parm | AMBER Parm | parmplugin | University of Illinois, NCSA; ReadPARM.h Regents of the University of California |
| parm7 | AMBER7 Parm | parm7plugin | University of Illinois, NCSA; ReadPARM7.h Regents of the University of California |
| pqr | PQR | pqrplugin | University of Illinois, NCSA |
| rst7 | AMBER7 Restart | rst7plugin | University of Illinois, NCSA |
| OUTCAR | VASP_OUTCAR | vaspoutcarplugin | University of Illinois, NCSA (molfiles/LICENSE) |
| POSCAR | VASP_POSCAR | vaspposcarplugin | University of Illinois, NCSA (molfiles/LICENSE) |
| XDATCAR | VASP_XDATCAR | vaspxdatcarplugin | University of Illinois, NCSA (molfiles/LICENSE) |
| VASP_XDATCAR5 | VASP_XDATCAR5 | vasp5xdatcarplugin | University of Illinois, NCSA (molfiles/LICENSE) |
| xml | VASP_xml | vaspxmlplugin | University of Illinois, NCSA (molfiles/LICENSE) |
| vsf | VTF structure format | vtfplugin | University of Illinois, NCSA (molfiles/LICENSE) |
| vtf | VTF trajectory format | vtfplugin | University of Illinois, NCSA (molfiles/LICENSE) |
| xbgf | Internal Paratool Format | xbgfplugin | University of Illinois, NCSA |
| xsf | (Animated) XCrySDen Structure File | xsfplugin | University of Illinois, NCSA (molfiles/LICENSE) |

PSF, AMBER Parm, AMBER7 Parm, InsightII MDF and VTF structure format
files hold a topology and no coordinates, so every atom of such a frame
is at the origin. ABINIT, DL_POLY_4 HISTORY, VMD Tinker and Gaussian
Logfile have no suffix of their own (Gaussian’s `.log` is already
GAMESS) and the CLI does not reach them. `.out` is CPMD 3.x output;
nothing else in this tree uses that suffix for a trajectory.
[Data Formats](data-formats.md) lists every reader with its
authors, and `LICENSE.note` gives each licence.

## Frame ranges {#frame-ranges}

Omit `--last`, or set it equal to `--frame`, for one frame. That
path calls `load` and works for every linked suffix.

A range (`--last` > `--frame`) dispatches by suffix. LAMMPS dumps use
`sinp::forEachLammpsFrame`, with one handle per OpenMP worker and
deterministic output order. XYZ is a single-frame input and emits frame 1
at most. Chemfiles and readcon inputs are read serially until the requested
range or the first missing frame. The first requested frame of a
`.pdb`, `.gro`, `.dcd`, or `.con` range is an error when it is empty,
and so is a path that is missing, a directory, or not readable:
the CLI exits 2 and prints `cannot read PATH`. `--jobs 1` is serial;
non-LAMMPS readers do not use OpenMP workers.

A serial range carries rings and cage affiliation from one frame to the
next: `primitive::RingUpdater` and `ring::AffiliationUpdater` recompute only
the atoms whose bounded ball changed. LAMMPS ranges with `--jobs` above 1,
MPI ranks, single frames and `--rebuild` rebuild every frame. The output is
the same either way.

An MPI build (`-Dwith_mpi=enabled`) started by `mpiexec` shares a LAMMPS
dump’s frames among the ranks in serpentine rounds: of R ranks, rank r takes
slot r of even rounds and slot R-1-r of odd ones, so a cost that steps,
drifts or alternates along the run reaches every rank. Rank 0 prints every
frame in order; ranks past the frame count idle. Other readers stay on rank
0, `--per-atom` needs a single rank, ranks that differ in arguments,
directory or `SEAMS_` settings are refused, and color stays off unless the
environment forces it. Each rank runs `--jobs` frame workers, OpenMP threads
inside a frame, and linkcell’s rayon pool; on a launch of several ranks,
`OMP_NUM_THREADS` and `RAYON_NUM_THREADS` default to 1 when unset. For
hybrid runs set them per rank and bind each rank to its cores; with Open
MPI:

```sh
mpiexec -n 2 --map-by slot:PE=4 -x OMP_NUM_THREADS=4 -x RAYON_NUM_THREADS=1 \
  seams --jobs 4 --frame 1 --last 100 cages dump.lammpstrj
```

The same `seams` flags on the bundled multi-type frame, without `mpiexec`:

```bash
seams --jobs 4 --frame 1 --last 100 cages input/traj/il_tiny.lammpstrj
```

A run without a launcher, or with `SEAMS_MPI=0`, never initialises MPI.
The source notes that a singleton MPI start costs about a second.

## `--features` {#features}

Heading `Compile-time features:` then one line per backend. Each
line is `NAME: enabled` or `NAME: disabled`.

| printed name | macro |
| --- | --- |
| OpenMP | SEAMS_HAS_OPENMP |
| MPI | SEAMS_HAS_MPI |
| Highway SIMD | SEAMS_HAS_HWY |
| linkcell pairs_within | SEAMS_HAS_LINKCELL |
| chemfiles | SEAMS_HAS_CHEMFILES |
| readcon-core | SEAMS_HAS_READCON |
| readcon-db | SEAMS_HAS_READCON_DB |
| IRA/SOFI | SEAMS_HAS_IRA |
| spglib | SEAMS_HAS_SPGLIB |
| sphericart | SEAMS_HAS_SPHERICART |
| nauty | SEAMS_HAS_NAUTY |

## Colors {#colors}

`colorizerForFile(environmentColorStatus(), stdout)`. Argum’s
`environmentColorStatus` (first match wins):

| condition | result |
| --- | --- |
| NO_COLOR set and non-empty | off |
| FORCE_COLOR set and non-empty | on |
| CLICOLOR_FORCE set, non-empty, not 0 / false | on |
| CLICOLOR_FORCE is 0 or false | off |
| CLICOLOR is 0 or false | off |
| CLICOLOR set and non-empty | allowed (TTY decides) |
| COLORTERM set and non-empty | allowed |
| TERM=dumb | off |
| otherwise | TTY / TERM heuristics |

Color roles on this binary:

| role | used for |
| --- | --- |
| heading | d-SEAMS banner, nop, Compile-time features: |
| progName | seams in --version; clathrate, interClathrate |
| longOption | frame, graph; ice name cubic |
| shortOption | box; ice name hexagonal |
| warning | usage line; interfacial; enabled |
| error | parse / missing-args / unknown-command; unclassified, reCubic, reHex, and any other ice name; disabled |
| uncolored | water, both |

## Exit status {#exit-status}

| code | when |
| --- | --- |
| 0 | success, including --help / --version / --features / --print-config |
| 2 | parse error, missing command or file, unknown command, bad --format, bad --cage-edge, bad --axis, bad --mol, bad --subset, bad --pair-types, --bins < 0, unknown --family, ice score refused by --family, ions without --ion-types, pairs or domains without --site, cn --ions without --site, steinhardt --l outside 3, 4, 6, 8, 12, CHILL --graph other than cutoff or mutual, symmetry with no atoms or no box, a missing input file, MPI ranks that differ, or --per-atom on more than one rank |

## Examples {#examples}

```bash
seams read input/traj/exampleTraj.lammpstrj
seams chill-plus input/traj/exampleTraj.lammpstrj --cutoff 3.5 --type 2
seams cages input/traj/mW_cubic.lammpstrj --type 1 --graph seeded
seams cages dump.lammpstrj --graph cutoff
seams cages dump.lammpstrj --graph knn
seams cages dump.lammpstrj --graph knn-union
seams chill-plus dump.lammpstrj --frame 1 --last 50 --jobs 8
seams rdf dump.lammpstrj --pair-types 1,2 --cutoff 10 --bins 100
seams cn dump.lammpstrj --pair-types 1,2 --cutoff 4.5
seams cn dump.lammpstrj --ions --site '1=cationHead,2=anion' --cutoff 6.0
seams pairs dump.lammpstrj --site '1=cationHead,2=anion'
seams hbonds dump.lammpstrj --type 2 --htype 1
seams hbonds dump.lammpstrj --donors
seams chill dump.lammpstrj --family ionicLiquid
```

The `dump.lammpstrj` lines on the bundled multi-type frame:

```bash
seams cages input/traj/il_tiny.lammpstrj --graph cutoff
seams cages input/traj/il_tiny.lammpstrj --graph knn
seams cages input/traj/il_tiny.lammpstrj --graph knn-union
seams chill-plus input/traj/il_tiny.lammpstrj --frame 1 --last 50 --jobs 8
seams rdf input/traj/il_tiny.lammpstrj --pair-types 1,2 --cutoff 10 --bins 100
seams cn input/traj/il_tiny.lammpstrj --pair-types 1,2 --cutoff 4.5
seams cn input/traj/il_tiny.lammpstrj --ions --site '1=cationHead,2=anion' --cutoff 6.0
seams pairs input/traj/il_tiny.lammpstrj --site '1=cationHead,2=anion'
seams hbonds input/traj/il_tiny.lammpstrj --type 2 --htype 1
seams hbonds input/traj/il_tiny.lammpstrj --donors
seams chill input/traj/il_tiny.lammpstrj --family ionicLiquid   # exits 2
```

Lua and Python are not this binary. See
[yodaStruct](https://github.com/d-SEAMS/yodaStruct)
(`require("dseams")`) and
[PydSEAMSlib](https://github.com/d-SEAMS/PydSEAMSlib)
(`pydseams`).
