2026.08.19
Automated Scaffold Analysis and Tree Visualization
A scaffold tree is a top-down hierarchy that strips a molecule ring by ring, from its full framework down to a single core ring. Across a screening library, those hierarchies make structural diversity and the core chemical frameworks driving a series visible — a critical step in hit-to-lead optimization. Traditional Bemis–Murcko scaffold extraction provides a flat overview of molecular frameworks, but it often fails to capture parent-child relationships between complex ring systems and simpler sub-scaffolds.

Scaffold trees resolve this limitation by implementing the Schuffenhauer hierarchy. However, manually writing RDKit scripts to compute, organize, and lay out these trees across thousands of compounds remains a time-consuming bottleneck.

This blog assumes the data is already clean and deduplicated (see Automated Data Prep for QSAR for more details), and we use Pregnane X Receptor (PXR) activity dataset gathered by our data team. The resulting PXR_data_deduplicated.csv contains 922 curated compounds. We run Insilico Medicine's Cheminformatics engine MolTools MCP in combination with the GLM-5.2 model in WorkBuddy. In two prompts, it extracts the complete scaffold forest and renders publication-ready tree diagrams — with no RDKit scripting at all.
Extracting the Scaffold Forest
Scaffold forest composition can be done with a single prompt:

“Run scaffold tree analysis on PXR_data_deduplicated.csv with mol_tag as MOLPREPROC_result and id_tag as Structure_ID.” 
The engine processes all 922 compounds cleanly, building a complete Schuffenhauer scaffold hierarchy. The set resolves into 103 distinct scaffold trees sharing common root cores, spanning 1,108 total scaffold nodes across the library. Four single-ring molecules with no further hierarchy are cataloged as singletons.
MolTools MCP automatically categorizes the forest into size bands and highlights key structural patterns. The PXR dataset is heavily dominated by N-heterocyclic chemotypes, aligning with PXR's binding preference for basic hydrogen-bonding aromatics.
Visualizing Scaffold Trees
To inspect specific structural series, we instruct the agent to generate high-resolution PNG visualizations for selected trees:

“Visualize and save scaffold trees 9, 4, 35, and 40.”
The tool generates individual image files alongside a consolidated archive. Every rendered tree uses the same color convention, so a diagram can be read top-down without a key: 
  • Green: the simplest single-ring scaffold, representing the shared core framework of the series.
  • Gray: intermediate scaffolds — each downward step represents an added ring or structural modification.
  • Blue: terminal source compounds, labeled directly with their Structure_ID for immediate CSV cross-referencing.
What the Trees Reveal
Four trees illustrate the range of hierarchies the engine recovers. Tree 9 shows what scale looks like. Rooted in pyridine, it gathers 50 molecules across 61 nodes — the largest chemotype family in the set, and far too wide to reproduce legibly at page width. The panel below is a crop of the diagram; the complete tree is exported at full resolution as a PNG inside a ZIP archive. One may see in the figure that a single-ring core fans out into dozens of parallel substitution branches staying shallow, so the series broadens far more than it deepens.
Tree 9
Tree 4, rooted in cyclopentanone, resolves into a direct four-node breakdown — one scaffold per level, each step adding a single ring or substituent. Series like this are the easiest to track: the path from shared core to terminal analog reads straight down the diagram, with no branching to interpret.
Tree 4
Tree 35 shows the opposite case. Its four molecules — the same series size as tree 4 — are rooted in isothiazole but expand into 13 nodes: the hierarchy branches through several intermediate ring systems before reaching the terminal compounds. A small series is therefore no guarantee of a simple SAR landscape — the tree exposes structural variation that a flat Bemis–Murcko list would collapse into a single scaffold entry.
Tree 35
Tree 40 sits between the two extremes. Its 1,2,4-oxadiazole root elaborates first into a phenyl-oxadiazole intermediate, which then splits along two independent substitution routes — an azetidinyl-pyridazine branch and an isoxazolyl-alkoxy branch — terminating in compounds 274 and 102. Six nodes for just two molecules: the branch point tells a medicinal chemist that these two analogs diverge early from their shared core, not at a final decorating step.
Tree 40
The Takeaway: Automating scaffold tree generation replaces hundreds of lines of RDKit code with two conversational prompts. By connecting GLM-5.2 to Insilico Medicine's Cheminformatics Engine MolTools through the MCP connector, researchers can convert raw compound lists into structured scaffold forest hierarchies. From there, the automated distribution tables identify the dominant chemotypes driving a series — here, N-heterocycles among PXR binders — and the rendered trees trace top-down SAR paths from root cores to individual analogs, all without a single line of layout or decomposition code. In this case study, that meant resolving 922 compounds into 103 scaffold trees and 1,108 nodes, with publication-ready diagrams exported on request. 

Ready to try it yourself? Reach out via petrina@insilicomedicine.com
Stay tuned, follow us on social media!