Skip to content

Latest commit

 

History

History
141 lines (104 loc) · 3.85 KB

03_planner_procedures.md

File metadata and controls

141 lines (104 loc) · 3.85 KB

Planner Procedures

This file describes how each planner output should be prepared for the visualizer.

SynPlanner

Input:

  • direct synplan.mcts.tree.Tree pickle

Do not use TreeWrapper.

Expected raw artifact:

tree.pkl

Ingest:

retro-tree-visual ingest synplanner \
  --tree tree.pkl \
  --out-dir out/synplanner \
  --html out/synplanner/index.html

SynPlanner-specific behavior:

  • Direct tree node IDs are preserved.
  • Winning nodes and route provenance are taken from the tree when available.
  • Multi-product precursor nodes are stored in node metadata.
  • The renderer creates render-only visual product bubbles for multi-product nodes.
  • CGR enrichment can use SynPlanner's direct tree-based RouteCGR path.

AiZynthFinder

Inputs:

  • full_search_tree.json or full_search_tree.json.gz
  • route export JSON

Expected raw artifacts:

full_search_tree.json.gz
routes.json

Ingest:

retro-tree-visual ingest aizynthfinder \
  --tree full_search_tree.json.gz \
  --routes routes.json \
  --algorithm MCTS \
  --target-id apatinib \
  --target-smiles 'N#CC1(c2ccc(NC(=O)c3cccnc3NCc3ccncc3)cc2)CCCC1' \
  --out-dir out/aizynthfinder \
  --html out/aizynthfinder/index.html

AiZynthFinder-specific behavior:

  • MCTS nodes are planner states, not single molecules.
  • Each state can contain multiple molecule IDs.
  • The raw search trace keeps one node per MCTS state.
  • The renderer creates molecule-level visual bubbles from each state.
  • Route provenance matches normalized route states back to raw MCTS state nodes.
  • CGR enrichment uses successful route reactions, not state-mixture trace SMILES.

The canonical Apatinib config uses iteration_limit: 500 under runs/apatinib_mcts_500/aizynthfinder/config.yml. Regenerate the raw tree and routes in a fresh AiZynthFinder-only environment; do not reuse or relabel the historical 400-iteration artifacts under runs/apatinib_mcts_200/.

Syntheseus

Inputs:

  • graph pickle
  • optional route export JSON

Expected raw artifacts:

graph.pkl
routes.json  # optional

Ingest:

retro-tree-visual ingest syntheseus \
  --graph graph.pkl \
  --algorithm LocalRetro \
  --target-id apatinib \
  --target-smiles 'N#CC1(c2ccc(NC(=O)c3cccnc3NCc3ccncc3)cc2)CCCC1' \
  --out-dir out/syntheseus \
  --html out/syntheseus/index.html

Syntheseus-specific behavior:

  • The timeline uses deterministic node creation order. Original creation seconds are kept as syntheseus_created_at_seconds metadata, but created_at is a discrete playback step.
  • Multi-parent graph edges are preserved in SearchTrace.edges.
  • parent_id stores one display parent only; it is not the full graph contract.
  • If --routes is omitted, successful routes are extracted from graph.pkl with Syntheseus iter_routes_time_order, capped at 50 routes by default, converted to nested route dicts, and then processed through the existing RouteCGR/SB-CGR enrichment path.
  • If --routes is provided, the external route file overrides graph-derived route extraction.
  • Route provenance is inferred from Syntheseus route terminal state IDs when graph-derived routes are used, then falls back to molecule/reaction matching.

The current canonical Apatinib Syntheseus config is:

runs/apatinib_mcts_500/syntheseus/config.yml

Regenerate runs/apatinib_mcts_500/syntheseus/graph.pkl from that config in a source model environment before treating the comparison suite as complete.

Shared Planning Run Expectations

For comparable reports, keep the same:

  • target SMILES and target ID
  • stock source
  • max depth
  • iteration or wall-clock budget where possible
  • route limit or top-k where possible
  • random seed where supported

The reports are expected to be similar, not identical. Search strategies, policy implementations, stocks, and route extraction rules can produce different branches and route counts.