scan (restrained coordinate scan)¶
scan drives chosen distances, angles, or dihedrals of a layered enzyme structure step by step with harmonic restraints, relaxing every other degree of freedom with the ML/MM calculator at each step, and so builds a candidate reaction path from a single structure. The coordinates in one literal (or the distance targets of one YAML stage) move together as one stage; several literals run as stages in sequence, each starting from the relaxed end of the previous one.
What it is for¶
A path from one structure: drive the reacting bonds of a reactant to get intermediate- and product-like structures for
path-search.Testing the order of events: drive bond formation and proton transfer in one stage or in separate stages, and compare the energy profiles.
Running the scan step of
allon its own: repeat the scan thatallruns for-s, with other step sizes or restraints.Judging the result: each stage reports whether covalent bonds formed or broke, and
result.jsongivesscientific_status. See Reading the result.
The ML region uses UMA (Meta) by default; -b/--backend also selects ORB, MACE, AIMNet2, or DFT (dft). For an energy grid over two or three independent coordinates, use scan2d or scan3d.
Examples¶
Here complex.pdb contains the full system matching real.parm7, and ml_region.pdb selects its ML region without link hydrogens.
The atoms are those of the bundled enzyme example (examples/beza/1.R.pdb), whose PDB has an empty chain column. Each atom is therefore written with three fields, residue name, residue number, and atom name, in any order and separated by commas or spaces.
1. From a YAML spec¶
Write the stages in a file and add --out-json for a summary.
# scan.yaml
stages:
- [["SAM,320,CS1", "GPP,321,C7", 1.60]]
- [["GPP,321,H11", "GLU,186,OE2", 0.90]]
mlmm scan -i complex.pdb --parm7 real.parm7 --model-pdb ml_region.pdb -q 0 \
-s scan.yaml --out-json -o ./result_scan
For each stage the console prints [stage k] Covalent-bond changes (start vs final): Yes (or No), and the run ends with a Summary of every stage and ====== Scan finished ======. In result_scan/result.json, scientific_status is success when every stage converged.
2. Inline literal¶
A short single-stage scan can be given on the command line.
mlmm scan -i complex.pdb --parm7 real.parm7 --model-pdb ml_region.pdb -q 0 \
-s '[("SAM,320,CS1","GPP,321,C7",1.60)]'
3. Two coordinates in one stage¶
Coordinates in the same literal move together (a concerted step).
mlmm scan -i complex.pdb --parm7 real.parm7 --model-pdb ml_region.pdb -q 0 \
-s '[("CS1 SAM 320","GPP 321 C7",1.60),("GPP 321 H11","GLU 186 OE2",0.90)]' -o ./result_concerted
4. Two stages in sequence¶
Give several literals after one -s; stage 2 starts from the relaxed result of stage 1.
mlmm scan -i complex.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)]' -o ./result_staged
5. Bidirectional scan¶
A 4-tuple scans one distance in both directions from the input geometry.
mlmm scan -i complex.pdb --parm7 real.parm7 --model-pdb ml_region.pdb -q 0 \
-s '[(12, 45, 1.35, 2.50)]'
6. Dump trajectories¶
Add --dump to keep the optimizer trajectory of every step.
mlmm scan -i complex.pdb --parm7 real.parm7 --model-pdb ml_region.pdb -q 0 \
-s scan.yaml --dump -o ./result_scan_dump
How it works¶
Reading the structure: the ML-region charge comes from
-qor-l. With--preopt, the structure is first optimized without restraints; if that does not converge, the input geometry is used.Splitting each stage into steps: for every coordinate,
scantakes the change Δ = target − current (for a dihedral, the shortest signed change, between −180° and 180°) and divides the stage into N = ceil(max(|Δ| / h)) steps, where h is--max-step-size(Å) for distances,--max-angle-step-sizefor angles, and--max-dihedral-step-sizefor dihedrals (degrees). Each coordinate moves by Δ / N per step, so all coordinates of a stage arrive together.Restrained relaxation: at each step, a harmonic restraint E = ½ k (q − q_target)² holds every scanned coordinate q at its step target (k from
--restraint-k), and the rest of the structure is relaxed with the ML/MM calculator by L-BFGS (--opt-mode grad, default) or RFO (rational function optimization,--opt-mode hess); the atoms of the frozen MM layer stay fixed. The energy written for each step is the ML/MM energy computed with the restraints removed. Cartesian coordinates (geom.coord_type: cart) are the default and recommended for ML/MM scans;dlccan be selected in YAML but can take much longer to converge.End of the stage: with
--endopt, the last structure of the stage is optimized once more without restraints.scanthen compares the first and last structures of the stage for covalent-bond changes and writes the stage result.Next stage: the next stage starts from this result. After the last stage, the trajectories of all stages are joined into one file.
Bidirectional scan (4-tuple)¶
A range (i, j, low, high) instead of a target (i, j, target) scans in both directions from the input geometry. It expands into two stages:
Pass 1: drive
i–jfrom the current distance towardlow.Pass 2: restore the input geometry and drive
i–jtowardhigh.
The joined trajectory runs low → input geometry → high, a continuous path through the starting structure. Angle ranges (i, j, k, low, high) and dihedral ranges (i, j, k, l, low, high) are scanned the same way.
Bond-change detection¶
Let T be the sum of the covalent radii of two atoms scaled by bond_factor (default 1.20). The atoms count as bonded when their distance is at most T − margin_fraction × T (margin_fraction defaults to 0.05). A pair is reported as formed or broken only when its distance changed by at least delta_fraction × T (delta_fraction defaults to 0.05). path-search uses the same rules; the keys are in the YAML bond section.
Reading the result¶
Where |
What to check |
|---|---|
Console, each stage |
|
Console, end of run |
|
|
|
|
|
A partial run exits with 0 and a failed run with 1. See Exit codes. A converged scan with the intended bond changes gives a candidate path; the highest-energy step is a TS candidate for tsopt, which you can extract from scan_trj.xyz.
Barrier sign¶
scan records energies but does not report a barrier. If you read a barrier off a scan (or a path, or a TS candidate made from one) that started from the product, the difference from the starting structure is the reverse barrier, E(TS) − E(product). The forward barrier is computed from the reactant:
You ran |
Forward barrier |
|---|---|
A scan from the reactant |
|
A scan from the product |
|
No option changes this. Before quoting a barrier, check which endpoint the scan started from, especially when the starting structure was a crystallographic product complex.
Output files¶
scan writes these files to --out-dir:
result_scan/
├─ preopt/
│ └─ result.xyz # Pre-optimized structure (--preopt)
├─ stage_01/ # One directory per stage (stage_NN)
│ ├─ result.xyz # Final geometry of the stage
│ ├─ scan_trj.xyz # Structure and energy of every step in the stage
│ └─ scan_s0001_optimization_trj.xyz # Optimizer trajectory of each step (--dump)
├─ scan_trj.xyz # All stages joined
└─ result.json # Summary (--out-json); summary.json has the same content
The structures and trajectories are also written as PDB under the same names (result.pdb, scan.pdb); --no-convert-files turns this off. mmCIF input, and PDB input too large for the PDB columns, also get .cif files that keep the original identifiers.
Stage results:
stage_NN/result.*is the structure at the end of stage NN. Forpath-search, give the starting structure followed by thestage_NN/result.*files in stage order.Energy profile: the comment line of each frame in
scan_trj.xyzholds the energy without restraints (Hartree); plot it withtrj2fig.
Main options¶
The options shared by every ML/MM calculation command are explained once in ML/MM options; the table below lists only the options specific to scan.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
path |
(required) |
Full-system structure ( |
|
integer |
|
Charge of the ML region. Required unless |
|
integer |
|
Spin multiplicity (2S+1) of the ML region |
|
text |
|
Total charge of the unknown ligand residues (for example |
|
text |
(required) |
A YAML/JSON spec file, or one or more inline literals (one per stage): distance targets |
|
path |
|
Output directory |
|
flag |
|
Read atom indices in |
|
float |
|
Largest change of a distance per step (Å) |
|
float |
|
Largest change of an angle per step (degrees) |
|
float |
|
Largest change of a dihedral per step (degrees) |
|
float |
|
Restraint strength k (eV/Ų for distances, eV/rad² for angles); alias |
|
flag |
|
Optimize the input structure without restraints before the scan |
|
flag |
|
Optimize the result of each stage without restraints |
|
flag |
|
Write the optimizer trajectory of every step |
|
|
|
Relaxation: L-BFGS / RFO (on |
|
text |
|
Comma-separated 1-based atom indices to freeze, added to YAML |
|
flag |
|
Write a summary to |
See the generated CLI reference for every option.
Notes¶
--preoptdepends on the caller: run on its own,scandoes not pre-optimize unless you pass--preopt. Insideall, the scan pre-optimizes whenall --preoptis on (the default), andall --scan-preopt/--no-scan-preoptoverrides it.Targets and ranges are not mixed inline: one inline literal, and all literals of one run, hold either targets
(i,j,target)or ranges. To combine them, list them understages:in a YAML/JSON spec.Stage numbers with ranges: a range gives two stages, toward
lowand then towardhigh(a single 4-tuple givesstage_01/andstage_02/). Inline, all ranges of one literal move together in these two stages; in a YAMLstages:list, each entry of a stage that holds a range becomes its own stage, one for a target and two for a range.Target distances must be positive, and one coordinate may appear only once per stage.
Check the spec without computing:
--dry-runreads the input, the charge and spin, and-s, prints the number of stages, and exits without any optimization.Frozen atoms: the atoms given by
--freeze-atomsor YAMLgeom.freeze_atoms, and the atoms of the frozen MM layer, stay fixed in every relaxation. A scanned coordinate whose atoms are all frozen is an error.Cycle limit:
--relax-max-cycles(default100000) limits each relaxation; when given, it overrides YAMLopt.max_cycles.
See also¶
Scan-list spec — YAML/JSON spec files, inline literals, and atom selectors
scan2d — energy map over two coordinates
scan3d — energy grid over three coordinates
path-search — minimum energy path (MEP) search from the scan results
all — the full workflow, including a scan from one structure with
-sTroubleshooting — what to do when a run fails