Common options and selectors¶
This page collects the conventions shared by every pdb2reaction command: flags, 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
Common toggles:
--tsopt/--thermo/--dft: post-processing stages--freeze-links: freeze the parent atoms of the cap hydrogens (on by default)--dump: write trajectory files--preopt/--endopt: pre- / post-optimization--climb: climbing image in the minimum energy path search--convert-files: also write PDB / CIF / GJF copies of the outputs in the input format
Progressive help¶
pdb2reaction <subcmd> --help # core options
pdb2reaction <subcmd> --help-advanced # full option set
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. pdb2reaction 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.
Residue selectors¶
-c/--center (on extract and all) names the residues at the center of the model. The forms below run from the most specific to the broadest:
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').
pdb2reaction extract -i complex.cif -c 'LONG_CHAIN:SAM' -o model.pdb # every SAM in chain LONG_CHAIN
pdb2reaction extract -i complex.cif -c 'LONG_CHAIN:SAM:10001' -o model.pdb # one SAM
pdb2reaction extract -i complex.cif -c 'LONG_CHAIN:10001' -o model.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¶
For PDB/mmCIF inputs, --ligand-charge/-l lets you specify charges only for non-standard residues (substrates, cofactors). The total system charge is then automatically derived by summing standard amino-acid charges, ions, and your ligand charges.
-l 'SAM:1,GPP:-3' # per-residue mapping (recommended)
-l 'LIG:-2' # single mapping
-l -3 # single integer = total ligand charge
-q 0 # explicit total system 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 PDB/mmCIF input (withall -c, in the extracted model).calc.chargefrom--config.Without
-l: withall -c, the total of the standard residues and ions in the extracted model, other residues counted as 0; for a.gjfinput, the charge in its template.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 to ensure correct charge propagation.
Spin multiplicity¶
-m 1 # singlet (default)
-m 2 # doublet
-m 3 # triplet
Use -m/--multiplicity consistently in all and per-stage subcommands.
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¶
On scan and all, --scan-lists/-s accepts one or more inline Python literals; scan2d and scan3d accept exactly one. 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]
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.
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.
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) and element symbols in cols 77–78 (pdb2reaction add-elem-infoif missing). Multiple PDBs must share identical atoms in the same order.mmCIF — see mmCIF and large structures below.
XYZ / GJF — accepted when active-site extraction is skipped (omit
-c/--center)..gjffiles can provide charge / spin defaults from embedded metadata.
mmCIF and large structures¶
Every calculation command that accepts PDB also accepts .cif and .mmcif. 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.
pdb2reaction 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 are handled the same way, for example files with 10,000 or more residues, 99,999 or more atoms, hybrid-36 numbering, or numbers that overflow their columns.
Residue and atom selectors use the original chain IDs and residue numbers. 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, 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 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, and all also prints Scientific status: on the console. 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.
--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 |
|
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.
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 two 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 (converted to Pa internally).--step-size(CLI) vsstep_length(YAML) — onircthe flag is--step-size FLOAT(bohr); inallit is--irc-step-size. YAML key:irc.step_length.
pdb2reaction irc -i ts.pdb -q 0 --step-size 0.05
pdb2reaction all -i r.pdb p.pdb -c SAM -l 'SAM:1' --tsopt --irc-step-size 0.05
YAML configuration¶
pdb2reaction all -i r.pdb p.pdb -q -1 --config my_settings.yaml --out-dir result/
built-in defaults < --config (YAML) < CLI options
pdb2reaction <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. extract instead takes one or more file paths with -o/--output and writes to the current directory by default.
Notes¶
Flags with a value: a flag followed by a value (
true/false) is also accepted; write paired flags in commands and scripts.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.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 it stops with an error.--flattenand YAML:--flatten(opt,tsopt, andall; off by default) displaces the structure along extra imaginary modes and optimizes again. When neither--flattennor--no-flattenis given,tsoptkeeps ahessian_dimer.flatten_max_itervalue set in YAML, andoptalways uses up to 50 rounds with--flatten;--no-flattenforces 0 (see When --flatten is on).
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