scan3d¶
Overview¶
Summary: Perform a three-distance (d₁, d₂, d₃) grid scan with harmonic restraints and MLIP relaxations. Use
--scan-lists/-swith a YAML/JSON spec file (recommended) or an inline Python literal; or plot an existingsurface.csvvia--csv.
At a glance¶
Use when: A 3D potential-energy volume over three distances
(d₁, d₂, d₃)is needed, or an existingsurface.csvneeds re-plotting. Input is one structure +-s/--scan-lists scan3d.yaml(recommended) or one--scan-lists/-sinline literal (three quadruples);--csvenables plot-only mode.Method: Nested loops d₁ → d₂ → d₃ with linear grids built from
--max-step-size; values are reordered so points closest to the (pre)optimized structure are visited first. Each point is relaxed with the appropriate harmonic restraints (MLIP backend, UMA by default), and recorded energies are evaluated without bias, so grid points are directly comparable.Outputs:
surface.csv, per-point geometries undergrid/, and an HTML isosurface plot (scan3d_density.html).Defaults:
--opt-mode grad(LBFGS),--no-preopt,--max-step-size 0.20 Å,--bias-k 300 eV·Å⁻²,--thresh baker,--baseline min,--out-dir ./result_scan3d/. 3D grids grow very quickly; consider coarser--max-step-sizeor smaller ranges first.Next step: Inspect
scan3d_density.htmlfor low-energy channels, then narrow the search with a 2Dscan2dslice or refine candidate TS structures withtsopt.
scan3d nests loops over d₁ → d₂ → d₃ and relaxes each point with the appropriate restraints active. The default optimizer is LBFGS (--opt-mode grad); switch to --opt-mode hess for RFOptimizer.
For XYZ/GJF inputs, --ref-pdb supplies a reference PDB topology while keeping XYZ coordinates, enabling format-aware PDB/GJF output conversion.
Minimal example¶
pdb2reaction scan3d -i input.pdb -q 0 -s scan3d.yaml -o ./result_scan3d/
Output checklist¶
result_scan3d/surface.csvresult_scan3d/grid/point_i000_j000_k000.xyzresult_scan3d/scan3d_density.html
Common examples¶
Run from a YAML spec file – see Examples below.
Run with an inline literal – see Examples below.
Enable
--dumpto keep inner d3 trajectories per(d1,d2)slice – see Examples below.
Note: Add
--print-parsedwhen you want to verify parsed pair targets from--scan-lists/-s.
Usage¶
pdb2reaction scan3d [-i INPUT.{pdb|xyz|trj|...}] [-q CHARGE] [-l, --ligand-charge <number|'RES:Q,...'>] [-m MULT] \
[-b/--backend uma|orb|mace|aimnet2] [--solvent SOLVENT] [--solvent-model alpb|cpcmx] \
[-s/--scan-lists scan3d.yaml | '[(i,j,lowÅ,highÅ), (i,j,lowÅ,highÅ), (i,j,lowÅ,highÅ)]'] [options] \
[--convert-files/--no-convert-files] [--ref-pdb FILE] [--csv PATH]
Note: -i/--input and --scan-lists/-s are required unless --csv is provided.
Examples¶
# Recommended: YAML/JSON spec file
cat > scan3d.yaml << 'YAML'
one_based: true
pairs:
- ["TYR,285,CA", "SAM,309,C10", 1.30, 3.10]
- ["TYR,285,CB", "SAM,309,C11", 1.20, 3.20]
- ["TYR,285,CG", "SAM,309,C12", 1.10, 3.00]
YAML
pdb2reaction scan3d -i input.pdb -q 0 -s scan3d.yaml
# Alternative: inline Python literal
pdb2reaction scan3d -i input.pdb -q 0 \
-s '[("TYR,285,CA","SAM,309,C10",1.30,3.10),("TYR,285,CB","SAM,309,C11",1.20,3.20),("TYR,285,CG","SAM,309,C12",1.10,3.00)]'
# LBFGS relaxations, dumped inner trajectories, and an HTML isosurface plot
pdb2reaction scan3d -i input.pdb -q 0 \
-s '[("TYR,285,CA","SAM,309,C10",1.30,3.10),("TYR,285,CB","SAM,309,C11",1.20,3.20),("TYR,285,CG","SAM,309,C12",1.10,3.00)]' \
--max-step-size 0.20 --dump -o ./result_scan3d/ --opt-mode grad \
--preopt --baseline min
# Plot only from an existing surface.csv (skip new energy evaluation)
pdb2reaction scan3d --csv ./result_scan3d/surface.csv --zmin -10 --zmax 40 -o ./result_scan3d/
Scan-list spec¶
scan3d accepts exactly three quadruples (i, j, low_Å, high_Å) (under the pairs key for YAML/JSON, or as a single inline literal). Unlike scan, only one literal is accepted (no multi-stage support).
For the YAML/JSON file format, inline Python literal syntax, atom selectors, and quoting rules, see CLI Conventions: Scan-list spec.
Workflow¶
Load the structure through
geom_loader, resolve charge/spin from CLI or embedded Gaussian templates, and optionally run an unbiased preoptimization when--preopt. If-qis omitted but--ligand-charge/-lis provided, the structure is treated as an enzyme–substrate complex andextract.py’s charge summary derives the total charge before scanning (for PDB inputs, or XYZ/GJF when--ref-pdbis supplied).Parse targets from
--scan-lists/-s(YAML/JSON file or inline literal; default 1-based indices unless--zero-basedis passed) into three quadruples. For PDB inputs, each atom entry can be an integer index or a selector string like'TYR,285,CA'; delimiters may be spaces, commas, slashes, backticks, or backslashes, and token order is flexible (fallback assumes resname, resseq, atom). Build each linear grid usingh = --max-step-sizeand reorder the values so the ones closest to the starting distances are visited first.Outer loop over
d1[i]: relax with only the d₁ restraint active, starting from the previously scanned geometry whose d₁ value is closest. Snapshot that structure.Middle loop over
d2[j]: relax with d₁ and d₂ restraints, starting from the closest (d₁, d₂) geometry. Snapshot that result.Inner loop over
d3[k]: relax with all three restraints, measure the unbiased energy (bias removed for evaluation), and write the constrained geometry and convergence flag.After the scan completes, assemble
surface.csv, apply the kcal/mol baseline shift (--baseline {min|first}), and generate a 3D RBF-interpolated isosurface plot (scan3d_density.html) honoring--zmin/--zmax. When--csvis provided, only this plotting step runs.
CLI options¶
Option |
Description |
Default |
|---|---|---|
|
Structure file accepted by |
Required unless |
|
Total charge (CLI > template/ |
Required unless template/derivation applies |
|
Per-residue charge mapping (e.g., |
None |
|
MLIP predictor parallelism (workers > 1 disables analytic Hessians; UMA backend only; |
|
|
Spin multiplicity 2S+1. Inherits the |
|
|
Scan targets: a YAML/JSON spec file path (recommended) or single inline Python literal with three quadruples |
Required unless |
|
Interpret |
|
|
Print parsed pair tuples after |
|
|
Maximum change allowed per distance increment (Å). Controls grid density. |
|
|
Harmonic bias strength |
|
|
Maximum optimizer cycles during each biased relaxation. Used unless YAML sets |
|
|
|
|
|
When the input is PDB, freeze parents of link hydrogens. |
|
|
Comma-separated 1-based atom indices to freeze explicitly (e.g., |
None |
|
Write |
|
|
Toggle XYZ/TRJ → PDB/GJF companions for PDB/Gaussian inputs. |
|
|
Reference PDB topology to use when the input is XYZ/GJF (keeps XYZ coordinates). |
None |
|
Output directory root for grids and plots. |
|
|
Load an existing |
None |
|
Convergence preset override ( |
|
|
Base YAML configuration file (applied first). |
None |
|
MLIP backend. |
|
|
Implicit solvent name for xTB correction (e.g. |
|
|
xTB solvent model. |
|
|
Run an unbiased optimization before scanning. Scope-dependent default: |
|
|
Shift kcal/mol energies so the global min or |
|
|
Manual limits for the isosurface color bands (kcal/mol). |
Autoscaled |
|
Write a machine-readable |
|
Section bias¶
k(300): Harmonic strength in eV·Å⁻².
Outputs¶
out_dir/ (default:./result_scan3d/)
├─ surface.csv # Grid metadata; may include a reference row (i=j=k=-1)
├─ scan3d_density.html # 3D energy isosurface visualization
├─ grid/point_i###_j###_k###.xyz # Relaxed geometry for each grid point (Å×100 tags)
├─ grid/point_i###_j###_k###.pdb # PDB companions when conversion is enabled and templates exist
├─ grid/point_i###_j###_k###.gjf # Gaussian companions when templates exist and conversion is enabled
├─ grid/preopt_i###_j###_k###.xyz # Starting structure saved before scanning (preoptimized when --preopt is True)
└─ grid/inner_path_d1_###_d2_###_trj.xyz # Present only when --dump is True (mirrored to .pdb for PDB inputs with conversion)
Notes¶
For symptom-first diagnosis, start with Common Error Recipes, then use Troubleshooting for detailed fixes.
The MLIP backend (UMA by default) reuses the same
HarmonicBiasCalculatoras the 1D/2D scans.Ångström limits are converted to Bohr internally to cap LBFGS steps and RFO trust radii; optimizer scratch files live under temporary directories.
--baselinedefaults to the global minimum;--baseline firstanchors the(i,j,k)=(0,0,0)grid point when present.3D visualization uses RBF interpolation on a 50×50×50 grid with semi-transparent step-colored isosurfaces (no cross-sectional planes).
--freeze-linksmerges userfreeze_atomswith detected link-H parents for PDB inputs, keeping extracted active site models rigid.
See Also¶
scan – 1D bond-distance scan
scan2d – 2D distance-grid scan
opt – single-structure optimization before/after scans
all – end-to-end workflow wrapper
Common Error Recipes – Symptom-first failure routing
Troubleshooting – Detailed troubleshooting guide