JSON Output Reference¶
pdb2reaction provides machine-readable JSON output for programmatic consumption by AI agents, scripts, and downstream tools.
--out-json flag¶
Every MLIP-based subcommand supports --out-json / --no-out-json (default: off).
When enabled, a result.json file is written to the output directory alongside 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 always write summary.json (no --out-json flag needed).
Common envelope¶
Every result.json automatically includes:
Field |
Type |
Description |
|---|---|---|
|
string |
Subcommand name (e.g. |
|
string |
Package version |
|
float |
Wall-clock time (seconds) |
|
object |
Hardware info (see below) |
environment:
Field |
Type |
Example |
|---|---|---|
|
string |
|
|
string |
|
|
float |
|
|
string |
|
|
string |
|
|
int |
|
|
float |
|
Error handling¶
If a job fails (e.g., crash, OOM, convergence failure leading to sys.exit), result.json is still written with "status": "error" plus an "error_type" field describing the failure class. Check the .out log file for a full traceback. The authoritative signal is status == "error", not the absence of result.json.
For jobs that complete but did not converge, result.json is written with "status": "not_converged" and the final force/step values, allowing an AI agent to decide whether to retry with more cycles.
Subcommand schemas¶
opt¶
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
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 |
tsopt¶
All fields from opt, plus:
Field |
Type |
Description |
|---|---|---|
|
int |
Number of imaginary frequencies |
|
float[] |
Imaginary frequencies (cm⁻¹, negative) |
|
string |
|
The files object may include imaginary_mode_files (list of vib file paths).
Convergence details are available for rsirfo mode; dimer mode provides n_opt_cycles only.
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 |
|
float |
Temperature (K) |
|
float |
Pressure (atm) |
|
object |
|
thermochemistry (null if thermoanalysis unavailable):
Field |
Type |
Unit |
|---|---|---|
|
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 |
Reactant energy |
|
float |
TS energy |
|
float |
Product energy |
|
bool |
Forward IRC converged? |
|
bool |
Backward IRC converged? |
|
string |
MLIP backend |
|
int |
System charge |
|
int |
Spin multiplicity |
|
object |
|
|
float |
IRC step length (Bohr) |
|
int |
Maximum IRC steps |
|
object |
Trajectory files (xyz + pdb) |
scan¶
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
int |
Number of scan stages |
|
object[] |
Per-stage data (see below) |
|
string |
MLIP backend |
|
int |
System charge |
|
int |
Spin multiplicity |
|
object |
Output files |
stages[]:
Field |
Type |
Description |
|---|---|---|
|
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 |
Detected bond changes |
scan2d / scan3d¶
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
int |
Total grid points |
|
int[] |
Grid dimensions |
|
object |
|
|
float |
Surface minimum energy |
|
string |
MLIP backend |
|
int |
System charge |
|
int |
Spin multiplicity |
|
object |
CSV + plot files |
path-opt¶
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
bool |
Convergence flag |
|
string |
|
|
string |
MLIP backend |
|
float[] |
All image energies |
|
int |
Image count |
|
int |
Highest-energy image index |
|
float |
Forward barrier (kcal/mol) |
|
float |
Reaction energy (kcal/mol) |
|
object |
Trajectory + HEI files |
path-search¶
path-search does not emit result.json under --out-json; instead it always writes a summary.json to the output directory with the shared envelope (command, pdb2reaction_version, elapsed_seconds, environment) plus:
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
int |
Recursive MEP segment count |
|
object[] |
Per-segment |
|
object[] |
Per-segment labelled energy profiles (kcal/mol) |
|
string |
Backend/model identifier |
|
int |
System charge |
|
int |
Spin multiplicity |
See also the extended summary.json section for the additional fields that all layers on top.
dft¶
Field |
Type |
Description |
|---|---|---|
|
bool |
SCF converged? |
|
float |
DFT energy |
|
string |
XC functional |
|
string |
Basis set |
|
bool |
GPU acceleration used? |
|
object |
|
|
object |
|
|
int |
Atom count |
|
int |
DFT grid level |
|
float |
SCF convergence tolerance |
|
object |
|
extract¶
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
int |
Atoms in input PDB |
|
int |
Atoms after extraction |
|
float |
Computed total charge |
|
float |
Protein charge |
|
float |
Ligand charge sum |
|
float |
Ion charge sum |
|
list |
|
|
object |
|
|
string |
Center residue |
|
float |
Extraction radius (angstrom) |
|
string[] |
Input PDB paths |
trj2fig¶
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
int |
Number of trajectory frames |
|
float |
Minimum energy across frames |
|
float |
Maximum energy across frames |
|
string |
MLIP backend |
|
object |
Output plot files |
energy-diagram¶
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
int |
Number of energy data points |
|
object |
Output diagram files |
bond-summary¶
When --out-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 |
|
|
int |
Segment count |
|
object[] |
Per-segment barrier, delta, bond changes |
|
object[] |
Energy profiles with labels and kcal/mol values |
|
string |
Model identifier |
|
int |
System charge |
|
int |
Spin multiplicity |
|
object |
Hardware info |
The all command additionally includes:
Field |
Type |
Description |
|---|---|---|
|
object |
RLS segment index and barrier |
|
float |
Overall reaction energy |
|
list |
Per-segment TS/IRC/freq/DFT results |
|
object |
Curated output file listing |
Usage examples¶
Python¶
import json
with open("result_opt/result.json") as f:
result = json.load(f)
if result["status"] == "converged":
print(f"Energy: {result['energy_hartree']:.6f} Hartree")
else:
print(f"Not converged after {result['n_opt_cycles']} cycles")
print(f"Max force: {result['final_max_force']:.6f}")
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