Common options and selectors¶
This page collects the conventions shared by every mlmm command: flags, ML/MM options, residue and atom selectors, charge and multiplicity, exit codes, and configuration precedence.
Boolean options¶
Turn a stage or behavior on or off with paired flags:
Form |
Example |
|---|---|
Positive flag |
|
Negative flag |
|
--tsopt --thermo --no-dft
Progressive help¶
mlmm <subcmd> --help # core options
mlmm <subcmd> --help-advanced # full option set
Every subcommand accepts both.
To check a run before starting it, add --show-config to print the YAML file given with --config and its top-level keys, and --dry-run to check the options and inputs without running the calculation:
mlmm opt -i input.pdb --parm7 real.parm7 -q -1 --config my_settings.yaml --show-config --dry-run
A passing check ends with [Dry run] --dry-run completed. Input command is valid.
Verbosity levels¶
-v/--verbose LEVEL is an integer from 0 to 3 (default 2) that sets how much each command prints to the console. It is a per-command option, so write it with the subcommand, e.g. mlmm opt -v 1 .... The same four levels apply to every command; command pages describe only what their own command adds.
Level |
What you see |
|---|---|
|
Silent. Confirm success from the exit code and the output files. |
|
Milestones only: version, input summary, key settings, output location, dry-run / final status. No banner, |
|
Default. Adds the banner, |
|
Debug: the full configuration in effect, backend DEBUG, raw optimizer and internal-coordinate output, |
The level changes only what is printed, not the exit code; judge a run by its exit code.
ML/MM options¶
-q is the charge of the ML region, not of the whole system. The individual ML/MM commands need the full-system topology (--parm7) and the ML region; all builds both.
Each command takes the ML region from the first of these that is given: --model-pdb, then --model-indices, then the ML atoms (B-factor 0) of the input PDB with --detect-layer. Even with an explicit ML region, --detect-layer still reads the Movable-MM and Frozen-MM layers from the B-factors.
Option |
Meaning |
Default |
|---|---|---|
|
Amber parm7 topology of the whole enzyme complex (the full system). |
Required ( |
|
PDB of the ML region only, without link hydrogens; atom names and order match the full-system PDB and parm7. When given, it defines the ML region. |
None |
|
1-based atom indices of the ML region, comma-separated; ranges such as |
None |
|
Reads B-factors 0 / 10 / 20 as the ML, Movable-MM, and Frozen-MM layers. With an explicit ML region, only the MM layers are read. |
|
|
PDB that gives the atom order and residue information for an XYZ input. |
None |
|
Distance (Å) from the ML region: MM atoms within it move, and atoms beyond it are frozen. |
None (layers from the B-factors or |
|
MM engine: |
|
|
Placement of link atoms: |
|
|
Keeps the CMAP terms of the parm7, when present, in both the real-system and model-system MM calculations. |
|
mlmm all builds the topology when --parm7 is omitted, and takes the ML region from the extracted model with -c.
mlmm path-search -i R.pdb P.pdb --parm7 real.parm7 --model-pdb ml_region.pdb -q 0 -m 1
The choice of MLIP backend, precision, and --uma-workers is described in MLIP Backends.
Residue selectors¶
-c/--center (on extract and all) names the residues at the center of the model.
Form |
Example |
What it selects |
|---|---|---|
Chain + name + number (recommended) |
|
Exactly one residue per entry. |
Chain + name |
|
Every SAM in chain A; a warning is logged when more than one matches. |
Chain + number |
|
Residue 123 of chain A; a trailing letter is the insertion code. |
Name only |
|
Every residue with that name in any chain; a warning is logged when more than one matches. |
Number only |
|
The residue with that number in every chain. |
Structure file |
|
The residues whose coordinates match a separate PDB / mmCIF file. |
Long mmCIF chain IDs and residue numbers above 9999 use the same forms. Chain IDs are case-sensitive; residue names are not. A PDB with an empty chain column, such as the bundled example PDBs, takes only the name or number forms (-c 'SAM,GPP,MG', --selected-resn '44,63,186').
mlmm extract -i complex.cif -c 'LONG_CHAIN:SAM' -o pocket.pdb # every SAM in chain LONG_CHAIN
mlmm extract -i complex.cif -c 'LONG_CHAIN:SAM:10001' -o pocket.pdb # one SAM
mlmm extract -i complex.cif -c 'LONG_CHAIN:10001' -o pocket.pdb # chain + number
--selected-resn uses the same residue selectors¶
--selected-resn on extract and all force-includes residues in the model and accepts the same forms. For example, A:TYR:44 includes one residue, A:SAM every SAM in chain A, and A:123A one insertion-code residue. A name without a chain, such as TYR, includes every match and warns when more than one is present.
Charge specification¶
-q/--charge is the charge of the ML region. For PDB/mmCIF inputs, --ligand-charge/-l lets you specify charges only for non-standard residues (substrates, cofactors); the ML-region charge is then automatically derived by summing standard amino-acid charges, ions, and your ligand charges. Ions in the built-in table take their charge from it (MG is +2); listing one in -l with the same value is accepted, and a different value is ignored with a warning.
-l 'SAM:1,GPP:-3' # per-residue mapping (recommended)
-l 'LIG:-2' # single mapping
-l -3 # single integer = total ligand charge
-q 0 # explicit ML-region charge
Resolution order (highest priority first):
Explicit
-q/--charge.With
--ligand-charge/-l: the total of the standard residues, ions, and your ligand charges in the ML region.calc.model_chargefrom--config.Otherwise, stop with an error.
The console prints the derived charge as Total active site model charge; Check the model lists the lines to read after extract.
Tip
Always provide --ligand-charge/-l for non-standard residues (substrates, cofactors, unusual ligands) to ensure correct charge propagation.
Spin multiplicity¶
-m 1 # singlet (default)
-m 2 # doublet
-m 3 # triplet
-m/--multiplicity is the multiplicity of the ML region; without it, calc.model_mult from --config is used, and then 1. Use the same value in all and per-stage subcommands. mm-parm takes the separate --ligand-mult for the per-residue multiplicities used in parameterization.
Atom selectors¶
Atom selectors name single atoms in --scan-lists and in --distance-restraint of opt; --freeze-atoms takes only 1-based atom numbers (see Freeze atoms and restrain distances).
--scan-lists '[(1, 5, 2.0)]' # 1-based integer indices
--scan-lists '[("SAM,320,CS1", "GPP,321,C7", 1.60)]' # residue name, number, atom name
--scan-lists '[("A:SAM:320:CS1", "A:GPP:321:C7", 1.60)]' # with chain ID
A three-field selector gives the residue name, residue number, and atom name in any order, separated by spaces, commas, colons, slashes, backticks, or backslashes ("SAM,320,CS1", "SAM 320 CS1", and "320,SAM,CS1" select the same atom). Three fields never include a chain; to name the chain, use the four-field form CHAIN:RESNAME:RESSEQ[ICODE]:ATOM in this order, with any insertion code after the number (A:SAM:12B:C1).
Scan-list spec¶
--scan-lists/-s (on scan, scan2d, scan3d, and all) accepts one or more inline Python literals. The standalone scan / scan2d / scan3d commands additionally accept a YAML / JSON spec file path; use a file for complex multi-stage runs, inline literals for short cases.
YAML / JSON spec file (root = mapping; key is stages for scan, pairs for scan2d / scan3d):
one_based: true # optional; defaults to the command's --one-based/--zero-based (1-based)
stages: # scan
- [[1, 5, 1.35]]
- [[1, 5, 2.20], [2, 8, 1.80]]
one_based: true
pairs: # scan2d (exactly 2 entries) / scan3d (exactly 3 entries)
- [1, 5, 1.30, 3.10]
- [2, 8, 1.20, 3.20]
In a YAML spec, a scan stage may mix distance targets with distance, angle, or dihedral ranges. Each scan2d / scan3d axis is (i,j,low,high), (i,j,k,low,high), or (i,j,k,l,low,high). Indices may be integers, three-field selectors, or positional CHAIN:RESNAME:RESSEQ[ICODE]:ATOM selectors. Distances are in Å, angles and dihedrals in degrees.
Inline literal: wrap in single quotes so the shell does not interpret parens / spaces; use double-quoted PDB selectors inside.
-s '[(atom1, atom2, target_Å), ...]' # scan: triples
-s '[(atom1, atom2, low_Å, high_Å), ...]' # distance range
-s '[(atom1, atom2, atom3, low_deg, high_deg)]' # angle range
-s '[("SAM,320,CS1","GPP,321,C7",1.60)]' # quoted selectors
-s "[(\"SAM,320,CS1\",\"GPP,321,C7\",1.60)]" # avoid: double-quoted outer literal requires escaping inner quotes
For scan, one literal = one stage; multiple stages → multiple literals after a single --scan-lists flag. For scan2d / scan3d, only one literal is accepted (no multi-stage support). A two-stage scan that first forms one bond and then moves a proton:
mlmm scan -i r.pdb --parm7 real.parm7 --model-pdb ml_region.pdb -q 0 \
-s '[("SAM,320,CS1","GPP,321,C7",1.60)]' '[("GPP,321,H11","GLU,186,OE2",0.90)]'
Command |
Accepted scan specification |
|---|---|
|
Inline distance targets |
|
Inline targets only: distance |
|
One literal/file containing exactly two distance, angle, or dihedral axes |
|
One literal/file containing exactly three distance, angle, or dihedral axes |
A four-element tuple is therefore a distance range in scan and an angle target in all.
Input file requirements¶
PDB — must contain hydrogens (add via
reduce/pdb2pqr/ Open Babel /mlmm mm-parm --add-h) and element symbols in cols 77–78 (mlmm add-elem-infoif missing). Multiple PDBs must share identical atoms in the same order.mmCIF — accepted by the 14 commands listed in mmCIF and large structures below.
XYZ — the calculation commands, including
all, accept XYZ together with--ref-pdb, which gives the atom order and residue information.Amber parm7 (
--parm7) — force-field parameters of the full system; its atoms must be the same, in the same order, as in every coordinate input.
mmCIF and large structures¶
all, extract, define-layer, sp, opt, tsopt, freq, irc, dft, scan, scan2d, scan3d, path-opt, and path-search accept .cif and .mmcif, and so does --ref-pdb. The standalone mm-parm reads PDB only; all converts an mmCIF input before it builds the parameters. Use mmCIF for chain IDs longer than one character, residue numbers beyond four digits, atom serial numbers beyond five digits, or structures with 10,000 or more residues.
mlmm reads the first coordinate model and keeps one alternate location (altLoc) per residue, the one with the highest mean occupancy. During the calculation the atoms carry temporary chain IDs and residue numbers; output CIF files restore the original chain IDs, residue numbers, and insertion codes. Large or non-standard PDB files (10,000 or more residues, 99,999 or more atoms, hybrid-36 numbering, or numbers that overflow their columns, for example) are handled the same way.
mlmm all -i reactant.cif product.cif -c 'enzyme_A:SAM:10001,enzyme_A:GPP:10002' \
-l 'SAM:1,GPP:-3' --tsopt --thermo -o result
mlmm tsopt -i hei.xyz --ref-pdb full_system.mmcif --parm7 full_system.parm7 -q -2 -o result_tsopt
The second command takes the coordinates from the XYZ file and the topology from the mmCIF file. Residue and atom selectors use the original chain IDs and residue numbers:
Context |
Form |
Example |
|---|---|---|
|
|
|
|
|
|
Scan atom |
|
|
For the .cif files written next to each output, see Output Directory Layout.
Extract one frame from a trajectory¶
A _trj.xyz file is a plain multi-frame XYZ file (each frame is an atom-count line, a comment line, and the atom lines), so frame k (counted from 1) can be extracted with:
N=$(head -1 scan_trj.xyz); k=12
sed -n "$(( (k-1)*(N+2)+1 )),$(( k*(N+2) ))p" scan_trj.xyz > frame_12.xyz
To continue with the PDB topology, pass the original PDB to --ref-pdb of the next calculation command; the coordinates come from the frame.
Exit codes¶
Code |
Meaning |
|---|---|
|
Success or usable partial results |
|
Non-convergence, no usable result, runtime exception, or output failure |
|
CLI arguments the command rejects, or a malformed configuration YAML |
|
User interruption (SIGINT) |
Exit codes do not depend on JSON output. Exit code 0 covers both success and partial; tell them apart by scientific_status. all and path-search write it to summary.log (all also prints Scientific status: on the console), and the other commands record it in result.json when run with --out-json (see Execution and requested-stage completion). Without --out-json, read the console lines that the command’s page lists, for example Judging the IRC for irc (intrinsic reaction coordinate).
--opt-mode (subcommand-dependent)¶
--opt-mode picks the optimizer. L-BFGS (limited-memory BFGS) and RFO (rational function optimization) find minima; Dimer, RS-P-RFO (restricted-step partitioned RFO), RS-I-RFO (restricted-step image RFO), and TRIM (trust-region image minimization) search for a TS (transition state).
Subcommand |
|
|
Default |
|---|---|---|---|
|
L-BFGS ( |
RFO ( |
|
|
Dimer ( |
RS-P-RFO ( |
|
|
L-BFGS |
RFO |
|
|
L-BFGS |
RFO |
|
|
L-BFGS |
RFO |
|
|
L-BFGS |
RFO |
|
|
Dimer |
RS-P-RFO |
|
|
L-BFGS |
RFO |
|
When --opt-mode-post is omitted and --opt-mode is given explicitly, all uses that value for the TS and endpoint optimizations as well.
The same --opt-mode value selects a different algorithm on each subcommand, and the defaults differ, so check the table before copying a recipe. Algorithm names are accepted on opt (lbfgs / rfo) and tsopt (dimer / rsirfo / trim / rsprfo); all other subcommands accept only grad / hess. On tsopt, --opt-mode grad is therefore a Dimer TS search, not an L-BFGS minimization, and this Dimer periodically computes the Hessian to update its direction. Write --opt-mode dimer or rsirfo on tsopt and --opt-mode lbfgs or rfo on opt to make a recipe unambiguous.
--microiter/--no-microiter (on by default) alternates one Hessian-based step of the ML region with an L-BFGS relaxation of the MM atoms: in opt with RFO, and in tsopt with RS-P-RFO, RS-I-RFO, and TRIM. It is not used with Dimer or with electrostatic embedding (--embedcharge).
CLI ↔ YAML name mismatches¶
A few CLI flags use slightly different names than their YAML counterparts, and a few are renamed when wrapped in all. The main flags and their YAML keys are in YAML Reference › Common CLI-to-YAML mapping. The most-asked cases:
--pressure(CLI) vspressure_atm(YAML) — onfreqthe flag is--pressure FLOAT; inallit is exposed as--freq-pressure. YAML key:thermo.pressure_atm. Both carry atm values (default 1.0).--step-size(CLI) vsstep_length(YAML) — onircthe flag is--step-size FLOAT(bohr, default 0.10); inallit is--irc-step-size. YAML key:irc.step_length.
--dft-engine(CLI) vsengine(YAML) —--dft-engine(alias--engine) selectsgpu(GPU4PySCF, the default) orcpu(PySCF). YAML key:dft.enginefordftand the DFT stage ofall, andcalc.dft.enginefor the other calculation commands run with--backend dft.
mlmm irc -i ts.pdb --parm7 real.parm7 --model-pdb ml_region.pdb -q 0 --step-size 0.05
mlmm all -i r.pdb p.pdb -c 'SAM,GPP' -l 'SAM:1,GPP:-3' --tsopt --irc-step-size 0.05
YAML configuration¶
mlmm all -i r.pdb p.pdb -c 'SAM,GPP' -l 'SAM:1,GPP:-3' --config my_settings.yaml --out-dir result/
built-in defaults < --config (YAML) < CLI options
mlmm <subcmd> --help-advanced and the Command Reference show the built-in default of each option ([default: …]). Only explicitly supplied CLI values override YAML; options left at their CLI default do not mask YAML values. This order holds for every command that takes --config. Full schema: YAML Reference.
Output directory¶
-o/--out-dir ./my_results/ sets the output directory of a calculation command; each command has its own default, listed in Output Directory Layout. The preparation commands take file paths instead: extract takes one or more -o/--output paths, mm-parm an -o/--out-prefix, and define-layer an -o/--output path.
Notes¶
Put the chain before a residue name and number.
TYR:44is read as chainTYR, residue 44, and stops with a “not found” error; writeA:TYR:44.Use one kind of residue selector per list. The forms in the table fall into three kinds: names only (
SAM), chain + name with or without a number (A:SAM,A:TYR:44), and numbers with or without a chain (A:123,123). Kinds cannot be mixed in one list:A:TYR:44,A:SAMworks, whileA:SAM,SAM,A:44,A:SAM, andSAM,TYR:44stop with an error.Atom selectors on PDB files with an empty chain column take three fields, such as
'SER:11:HG'or'SER 11 HG'._does not stand for an empty chain, so'_:SER:11:HG'matches no atom and stops with an error.--model-indicesand the derived charge: the charge cannot be derived from--ligand-chargewith--model-indices; give-q, or define the ML region with--model-pdbor the B-factor layers (--detect-layer).--movable-cutoffturns off--detect-layer: with--movable-cutoff, the MM layers come from the distance cutoff, and the B-factor layers of the input are not read.B-factor layers need both ML and MM atoms: the B-factors are read as layers only when at least one atom is ML (0), at least one is MM (10 or 20), and at least 80% of the atoms carry one of these values (±1.0); an all-zero PDB is not a layer assignment.
Inline scan literals: one inline literal, and all literals of one run, hold either distance targets or ranges. To combine them, list them under
stages:in a YAML/JSON spec.mmCIF and large structures: up to 619,938 residues can be handled (62 one-character chain IDs × 9,999 residue numbers in the internal PDB used during the calculation).
fix-altlocandadd-elem-inforead PDB only; for mmCIF, the altLoc is chosen and element symbols are taken from_atom_site.type_symbolwhen the file is read. A row without_atom_site.type_symbol, a non-finite coordinate, or a different atom count between the reaction states stops with an error. Coordinates must fit the fixed-width PDB columns; move a structure that lies far from the origin closer to it.
See Also¶
Installation — setup and dependencies
Getting Started — the shortest run and which page to read next
Output Directory Layout — file names and default output directories
Troubleshooting — common errors and fixes
YAML Reference — all configuration options
MLIP Backends — backend choice, precision, and workers
ML/MM Calculator — how the ML/MM energy, forces, and Hessian are computed