JSON Output Reference¶
pdb2reaction emits machine-readable JSON for programmatic use by scripts and agents.
--out-json flag¶
Most MLIP-based and reporting subcommands (opt, sp, tsopt, freq,
irc, scan, scan2d, scan3d, path-opt, dft, extract,
trj2fig, and energy-diagram) support --out-json / --no-out-json
(default: off). When enabled, authoritative result.json and its identical
summary.json compatibility mirror are written beside the normal outputs.
pdb2reaction opt -i r.pdb -q -1 --out-json --out-dir result_opt
cat result_opt/result.json | python -m json.tool
The all and path-search commands write summary.json without an
--out-json flag once execution reaches their summary writer. Early
CLI/input validation can fail before the file exists.
summary.json mirror¶
write_result_json serializes each per-stage payload once, atomically publishes
the summary.json mirror first, and publishes authoritative result.json
last. A successful return means both files contain identical bytes. If an I/O
failure interrupts publication, the writer raises instead of hiding mirror
divergence; MCP consumers additionally require the current run identity.
Common envelope¶
The shared writer supplies the fields below; rows explicitly marked optional are present only when the producer supplies the corresponding data:
Field |
Type |
Description |
|---|---|---|
|
string |
Envelope schema version; current value lives at |
|
string |
Leaf envelopes use the subcommand name (e.g. |
|
string |
Package version |
|
string |
Value depends on the subcommand (see each section below): e.g. |
|
string |
Optional current MCP invocation UUID. It is injected only when the product-specific run environment is active; a conflicting producer value is rejected. |
|
float |
Optional wall-clock time; omitted by producers that do not pass timing to the shared writer |
|
object |
Hardware info (see below) |
|
string | null |
Optional backend identifier; null when a plot-only command did not evaluate a calculator |
|
string | null |
Optional exact model/checkpoint identifier, kept separate from the backend |
|
string | null |
Optional publication-facing model label derived from the exact identifier |
|
string | null |
Optional backend task used by a multi-domain model; |
|
string | null |
Effective public precision token ( |
Leaf schemas also retain their local backend / model fields; consumers
should prefer mlip_backend / mlip_model / mlip_precision for a uniform
cross-command provenance contract.
Execution and scientific truth¶
Multi-stage and scan producers add the fields below when they can evaluate constituent work. These fields are additive and producer-dependent; the command-specific status remains for compatibility. Consumers should use scientific_status and the leaf outcomes when deciding whether a result is usable. Missing or ambiguous convergence is fail-closed and cannot promote a leaf to usable.
Field |
Type |
Description |
|---|---|---|
|
string |
Normally |
|
string |
|
|
string[] |
Reasons for unusable or missing leaves; omitted on clean success. This is distinct from an aggregate workflow’s legacy |
|
string[] |
Expected and observed leaf identifiers used to detect missing aggregate work. |
|
object[] |
Stage leaves with |
|
object[] |
Scan points with |
When present, run_id identifies the current invocation. The all aggregate
summary also uses current_output_paths and key_output_files to report only
artifacts claimed by that invocation; files left in a reused output directory
are not current results.
Rigid projection provenance¶
freq, irc, and tsopt results include a rigid_projection object; opt includes it when --flatten runs. freq --dump also writes the same object to thermoanalysis.yaml.
Field |
Type |
Description |
|---|---|---|
|
string |
Fixed rigid-mode treatment: |
|
string |
Projection-kernel identifier |
|
int |
Number of rigid directions removed from the active Hessian |
|
int |
Rank of the full-system rigid basis before frozen-anchor constraints |
|
int |
Rank removed by the frozen-anchor constraints |
|
float |
Relative SVD tolerance used for the rank decision |
|
int |
Active and frozen atom counts |
|
int[] |
0-based atom indices used by the projection kernel |
|
string |
|
|
string |
Hessian provenance. |
|
int[2] |
Input Hessian shape. |
constrained removes only full-system rigid motions that leave frozen anchors fixed. The treatment is fixed; stale non-constrained values fail explicitly. See Frozen Atoms.
Error envelope (when status == "error")¶
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
Exception class name |
|
list[string] |
Full MRO class names so agents can match the hierarchy without parsing text |
|
string |
Module the exception class was defined in |
|
string |
High-level CLI stage label |
environment:
Field |
Type |
Example |
|---|---|---|
|
string |
|
|
string |
|
|
float |
|
|
string |
|
|
string |
|
|
int |
|
|
float |
|
Error handling¶
Caught runtime exceptions write a best-effort result.json with
"status": "error" and an "error_type". Usage/validation exits and failures
before the output directory is resolved may not create JSON, so a nonzero exit
code or missing expected JSON is also a failure signal. Check stderr/job logs
for the authoritative diagnostic.
For jobs that reach a controlled non-convergence writer, result.json uses
"status": "not_converged". Optimizer-family payloads expose the applicable
final force/step or cycle fields; DFT and Dimer omit fields they do not own.
Consult the command-specific schema before deciding whether to retry.
An optimizer may also report "status": "stalled": the energy stopped decreasing over the configured window (an energy plateau) while the configured force/step convergence criteria remained unmet. A stall is a distinct, non-converged outcome — it is never reported as converged. In tsopt it also stops the flatten/retry loop rather than repeating a non-progressing search; opt --flatten still runs its flatten loop, which exists to displace along the remaining imaginary modes and leave the plateau. When present, a stop_reason string records the energy range, window, and the failed criteria. A stall may be retried (e.g. from a perturbed geometry or with tighter step control); it is not an alias for max_cycles exhaustion or a generic failure.
Subcommand schemas¶
sp¶
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
string |
Prepared public input path |
|
string / string | null |
Local MLIP provenance, mirrored to the common |
|
string | null |
|
|
int / int |
Total charge and multiplicity |
|
int |
Atom count |
|
float |
Single-point energy (Hartree) |
|
string |
Path to |
|
string | null |
Path to |
|
string |
Human-readable elapsed-time text |
opt¶
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
Present only for a non-converged stop (stalled/stopped); records the energy plateau range/window and failed criteria |
|
float |
Final energy (Hartree) |
|
int |
Optimization cycles completed |
|
string |
|
|
string |
MLIP backend ( |
|
int |
System charge |
|
int |
Spin multiplicity |
|
string |
MLIP model identifier |
|
int |
Total atoms |
|
int |
Frozen atoms |
|
string |
Implicit solvent or |
|
string |
Convergence threshold preset |
|
int |
Maximum allowed cycles |
|
string |
Input filename |
|
float |
Last max gradient (Hartree/Bohr) |
|
float |
Last RMS gradient |
|
float |
Last max displacement (Bohr) |
|
float |
Last RMS displacement |
|
object |
|
|
object |
Output file map |
|
object |
Optional; present when |
tsopt¶
All fields from opt, plus:
Field |
Type |
Description |
|---|---|---|
|
string |
Numerical optimizer outcome: |
|
string |
|
|
string |
|
|
int|null |
Selected negative exact-PHVA root for downstream IRC; fallback root 0 is explicitly labelled and does not verify reaction identity |
|
int|null |
Number of imaginary frequencies; |
|
float[]|null |
Imaginary frequencies (cm⁻¹, negative); |
|
string |
|
|
string|null |
Advanced path-mode file supplied through |
|
object |
Hessian-TS diagnostics, including exact saddle checks, final target-mode identity/overlap, stop reason, and any explicitly enabled mode-loss/recovery activity. These recovery paths are inactive by default. |
|
object |
Rigid-mode and exact-Hessian provenance; see projection provenance |
The files object may include imaginary_mode_files (list of vib file paths).
Terminal PHVA runs only after numerical convergence. A non-converged or stalled
run retains the terminal geometry and records PHVA as skipped; a PHVA calculation failure is recorded as
hessian_status: "failed" without discarding the structure or fabricating
frequencies. status/optimization_status describe numerical optimization,
while saddle_validation describes exact-PHVA order. A numerically converged
higher-order stationary point remains optimization_status: "converged" with
saddle_validation: "higher_order"; it is not a certified first-order TS.
all may use a validated negative root for warning-labelled diagnostic IRC.
Numerical non-convergence, zero imaginary modes, missing/failed PHVA, or no
valid negative root stops all after TS artifact registration and before IRC.
Dimer uses the same additive terminal fields but still omits Hessian-family
per-cycle force/step convergence details and the safeguards object.
freq¶
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
int |
Total normal modes |
|
int |
Imaginary frequency count |
|
float[] |
All frequencies (cm⁻¹) |
|
float[] |
Negative frequencies only |
|
object|null |
Thermodynamic data (see below) |
|
string |
MLIP backend |
|
int |
System charge |
|
int |
Spin multiplicity |
|
string |
Model identifier |
|
int |
Total atoms |
|
int |
Frozen atoms |
|
string |
Implicit solvent or |
|
float |
Temperature (K) |
|
float |
Pressure (atm) |
|
string |
Input filename |
|
object |
|
|
object |
Rigid-mode and Hessian provenance; also written to |
thermochemistry (null if thermoanalysis unavailable):
Field |
Type |
Unit |
|---|---|---|
|
string |
Automatically detected molecular point group |
|
string |
|
|
int |
External rotational symmetry number |
|
string |
|
|
float |
Hartree |
|
float |
Hartree |
|
float |
Hartree |
|
float |
Hartree |
|
float |
Hartree |
|
float |
Hartree |
|
float |
Hartree |
|
float |
Hartree |
|
float |
Hartree |
|
float |
cal/mol |
|
float |
cal/(mol K) |
|
float |
cal/(mol K) |
irc¶
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
int |
Forward IRC frames |
|
int |
Backward IRC frames |
|
int |
Total frames |
|
float |
Energy of the first stitched-path endpoint; standalone IRC does not assign chemical identity |
|
float |
TS energy |
|
float |
Energy of the last stitched-path endpoint; standalone IRC does not assign chemical identity |
|
string |
|
|
float |
Legacy aliases for first / last, respectively; do not infer chemical R/P identity from these names |
|
bool | null |
Forward IRC converged? |
|
bool | null |
Backward IRC converged? |
|
bool | null |
Final forward step exceeded |
|
bool | null |
Final backward step exceeded |
|
string |
MLIP backend |
|
int |
System charge |
|
int |
Spin multiplicity |
|
string |
Model identifier |
|
bool |
Whether opt-in physical endpoint-stop bypass mode was enabled |
|
int |
Number of energy-rise or one-step energy-change stop events actually bypassed |
|
int |
Frozen atoms |
|
string |
Implicit solvent or |
|
object |
Directed first→last |
|
string |
|
|
float |
IRC step length (Bohr) |
|
int |
Maximum IRC steps |
|
string |
Input filename |
|
object |
Trajectory files (XYZ plus available PDB/CIF companions) |
|
object |
Rigid-mode and initial-Hessian provenance; see projection provenance |
scan¶
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
int |
System charge |
|
int |
Spin multiplicity |
|
string |
MLIP backend |
|
string |
Model identifier |
|
string |
Implicit solvent or |
|
bool |
Pre-optimization performed? |
|
float |
Max bond-length step per increment (Å) |
|
int |
Number of scan stages |
|
object[] |
Per-stage data (see below) |
|
object |
Output files |
stages[]:
Field |
Type |
Description |
|---|---|---|
|
int |
1-based stage index |
|
int |
Steps in this stage |
|
bool |
Constrained optimization converged? |
|
list |
Atom pairs (1-based) |
|
list |
Starting distances |
|
list |
Target distances |
|
float |
Energy at last step |
|
float[] |
Per-step energies |
|
object |
|
scan2d / scan3d¶
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
int | null |
System charge; null for plot-only |
|
int | null |
Spin multiplicity; null for plot-only |
|
string | null |
MLIP backend; null for plot-only |
|
string | null |
Model identifier; null for plot-only |
|
string | null |
Implicit solvent or |
|
float |
Max bond-length step per increment (Å, |
|
int |
Grid rows excluding |
|
string |
Execution-level completion state |
|
int |
Fresh-run grid points attempted, excluding preoptimization |
|
int |
Fresh-run points eligible for scientific reuse |
|
object[] |
Per-point convergence, energy, artifact, and eligibility data |
|
object[] |
Explicit grid-index, distances, energy, convergence, and |
|
string[] |
Current-run CSV/HTML/PNG and grid geometries; consumers can exclude stale files without filename inference |
|
int[] |
Grid dimensions (only when running fresh; absent under |
|
object |
|
|
float |
Surface minimum energy |
|
object |
CSV + plot files |
The outcome-count fields are emitted by fresh scans. Plot-only scan3d --csv
does not report an attempted count and may omit usable count when the imported
CSV lacks complete provenance.
path-opt¶
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
bool |
Convergence flag |
|
string |
|
|
string |
MLIP backend |
|
int |
System charge |
|
int |
Spin multiplicity |
|
string |
Model identifier |
|
string |
Implicit solvent or |
|
bool |
Whether endpoint pre-optimization was enabled |
|
float |
First-image energy (Hartree) |
|
float |
Last-image energy (Hartree) |
|
float[] |
All image energies |
|
int |
Image count |
|
int |
Highest-energy image index |
|
float |
HEI energy (Hartree) |
|
float |
Forward barrier (kcal/mol) |
|
float |
Reaction energy (kcal/mol) |
|
object |
Trajectory + HEI files |
path-search¶
path-search has no --out-json flag. Once execution reaches its summary
writer it writes summary.json with the shared envelope (command,
pdb2reaction_version, environment) plus the fields below; early CLI/input
validation can fail before the file exists.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
int |
Recursive MEP segment count |
|
object[] |
Per-segment |
|
object[] |
Per-segment labeled energy profiles (kcal/mol) |
|
string |
Backend identifier |
|
string | null |
Model identifier, recorded separately from the backend |
|
string | null |
Publication-facing model label |
|
string | null |
Backend task for a multi-domain model |
|
string | null |
Effective |
|
int |
System charge |
|
int |
Spin multiplicity |
See also the extended summary.json section for the additional fields that all layers on top.
dft¶
Note:
dftwritesresult.jsonandsummary.jsonfor both converged and non-converged SCF attempts. Non-convergence recordsstatus: "not_converged"andconverged: false, then exits with code 3. An unhandled exception writes the standarderrorenvelope.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
bool |
SCF converged? |
|
int |
System charge |
|
int |
Spin multiplicity |
|
int |
Atom count |
|
int |
DFT grid level |
|
float |
SCF convergence tolerance |
|
int |
Maximum SCF cycles |
|
string |
Input filename |
|
float |
DFT energy |
|
float |
DFT energy (kcal/mol) |
|
string |
XC functional |
|
string |
Basis set |
|
string |
Effective engine label ( |
|
bool |
GPU acceleration used? |
|
bool |
|
|
object |
|
|
object |
|
|
object |
|
extract¶
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
int |
Atoms in selected residues before backbone/truncation filtering (not the whole input structure) |
|
int |
Selected atoms kept after truncation, before cap-H addition |
|
float |
Computed total charge |
|
float |
Protein charge |
|
float |
Ligand charge sum |
|
float |
Ion charge sum |
|
list |
|
|
object |
|
|
int |
Cap hydrogens added at carbon-parent truncation bonds |
|
bool |
Whether backbone atoms were excluded |
|
bool |
Whether crystallographic waters were included |
|
string | null |
User-supplied mapping, or null when omitted |
|
string |
Center residue |
|
float |
Extraction radius (angstrom) |
|
string[] |
Original input PDB/mmCIF paths |
|
object |
Output PDB / cluster filenames |
trj2fig¶
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
int |
Number of trajectory frames |
|
float |
Minimum energy across frames |
|
float |
Maximum energy across frames |
|
string |
|
|
string[] |
Per-frame energy source provenance |
|
string |
Stored energy unit ( |
|
string or null |
MLIP backend only when frame energies were recomputed; null in comment-energy mode |
|
int or null |
Resolved recomputation state, otherwise null |
|
string or null |
Recomputed-calculator solvent settings, otherwise null |
|
string[] |
Canonical ordered paths for every output; preserves files with the same basename in different directories |
|
object |
Legacy basename-to-path map; retained for compatibility and therefore lossy when basenames collide |
energy-diagram¶
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
int |
Number of energy data points |
|
object |
Output diagram files |
bond-summary¶
When --json is enabled, bond-summary prints JSON to stdout (no result.json file is written; redirect stdout if you need to persist it). This is unlike the MLIP-based subcommands above, which all write a result.json file into out_dir:
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
object[] |
Per-pair comparison with |
summary.json (path-search / all)¶
The all and path-search commands write summary.json with a richer structure:
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string / string |
Execution completeness and scientific usability; evaluate these separately from legacy |
|
string[] |
Reasons for incomplete or unusable science; omitted on clean success. |
|
string[] |
Expected and observed aggregate leaves. |
|
int |
Segment count |
|
object[] |
Per-segment |
|
object[] |
Energy profiles with labels and kcal/mol values |
|
string |
Backend identifier |
|
string | null |
Model identifier, recorded separately from the backend |
|
string | null |
Publication-facing model label |
|
string | null |
Backend task for a multi-domain model |
|
string | null |
Effective |
|
int |
System charge |
|
int |
Spin multiplicity |
|
object |
Hardware info |
|
object[] |
Methods actually used by the resolved workflow, as |
The all command additionally includes:
Field |
Type |
Description |
|---|---|---|
|
object |
Legacy key for the highest independently referenced local barrier at the highest method complete across every reactive segment ( |
|
float |
Overall reaction energy |
|
string |
Method of the overall reaction energy ( |
|
list |
Per-segment TS/IRC/freq/DFT results |
|
object |
Child-reported point-group and rotational-symmetry provenance by state. Only R/TS/P states with valid symmetry-number provenance are included; missing states are omitted, and the field is absent only when no state has valid provenance. |
|
string[] |
Sorted paths relative to |
|
object |
Current-run output index: root filename → description; each |
Usage examples¶
Python¶
import json
with open("result_opt/result.json") as f:
result = json.load(f)
status = result["status"]
if status == "error":
raise RuntimeError(f"{result['error_type']}: {result['error']}")
elif status == "converged":
print(f"Energy: {result['energy_hartree']:.6f} Hartree")
elif status in {"not_converged", "stalled"}:
print(f"Not converged after {result['n_opt_cycles']} cycles")
print(f"Max force: {result['final_max_force']:.6f}")
else:
print(f"Status: {status}")
jq¶
# Check convergence
jq '.status' result.json
# Get barrier from path-opt
jq '.barrier_kcal' result.json
# List imaginary frequencies from tsopt
jq '.imaginary_frequencies_cm' result.json
# Get thermochemistry from freq
jq '.thermochemistry.sum_EE_and_thermal_free_energy_ha' result.json
See Also¶
CLI Conventions —
--out-json/--no-out-jsonflag conventions and exit codesYAML Reference — configuration inputs whose values surface in these schemas
all, path-search — subcommands that always emit
summary.jsonopt, tsopt, freq, irc, scan, path-opt, dft, extract — subcommands that emit
result.jsononly under--out-json