agentsclimarketplace

Scaffold extraction from molecular structures

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/scaffold-extraction-from-molecular-structures

Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill scaffold-extraction-from-molecular-structures

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use when when pre-training or fine-tuning a molecular representation model on natural products and you need to encode scaffold-derived evolutionary patterns as a distinct learning signal. Trigger: input is SMILES strings or molecular graphs from natural product databases (e.

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

7.9 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

scaffold-extraction-from-molecular-structures

License: restricted — no clear open-source license detected for the underlying tool; verify licensing before commercial use or redistribution. <!-- asb-license-banner -->

Summary

Extract chemical scaffolds from natural product molecular structures to isolate conserved core frameworks that encode evolutionary lineage and biosynthetic ancestry. This isolates scaffold-derived patterns for contrastive learning in pre-training natural product foundation models.

When to use

When pre-training or fine-tuning a molecular representation model on natural products and you need to encode scaffold-derived evolutionary patterns as a distinct learning signal. Trigger: input is SMILES strings or molecular graphs from natural product databases (e.g., LOTUS, custom biosynthetic collections) and your downstream task includes taxonomy classification, gene-level or microbial-level evolutionary inference, or virtual screening where scaffold conservation reflects biosynthetic ancestry.

When NOT to use

  • Input molecules are purely synthetic (non-natural products); conventional scaffolding lacks discriminative power for evolutionary lineage.
  • Downstream task is chemical property prediction (logP, solubility) rather than evolutionary or biosynthetic inference; scaffold features are not optimized for these targets.
  • Molecular graph already includes explicit side-chain encoding and you are bypassing explicit scaffold extraction; dual objectives may over-regularize the model.

Inputs

  • SMILES strings (CSV or pickle format, as in pretrain_smiles.pkl)
  • Molecular graphs (PyG Data objects or rdkit mol objects)
  • Natural product molecular structure database (e.g., LOTUS, ONTOLOGY, custom BGC-derived collections)

Outputs

  • Scaffold representations (Murcko scaffolds as SMILES or graph embeddings)
  • Side-chain information (atomic/bond features isolated from scaffold)
  • Scaffold-annotated molecular graph dataset (input to contrastive learning objective)
  • Scaffold similarity matrix or contrastive pairs for pre-training

How to apply

Parse input SMILES strings into molecular graphs, compute Murcko scaffolds (core ring systems and linkers with all side chains removed) to isolate evolutionary-conserved backbones. Extract side-chain information separately to preserve biosynthetic diversity. Integrate scaffold representations into the contrastive learning objective alongside full-molecule representations, such that molecules sharing scaffolds are pulled into proximity in embedding space. The rationale is that natural products exhibit strong scaffold clustering by organism and biosynthetic pathway; explicitly encoding scaffold similarity improves the model's capacity to learn evolutionary information at both gene and microbial levels (as validated in NaFM's taxonomy classification benchmarks). Scaffold and side-chain information are complementary: contrastive learning on scaffolds captures evolutionary commonality while masked graph modeling on full structures preserves biosynthetic diversity.

Related tools

  • RDKit (Compute Murcko scaffolds from SMILES and convert molecules to graph representations)
  • PyTorch Geometric (PyG) (Represent scaffold and side-chain information as graph nodes/edges; construct batches for contrastive learning)
  • NaFM pre-training framework (Integrate scaffold extraction and side-chain encoding into dual contrastive + masked modeling pipeline) — https://github.com/TomAIDD/NaFM-Official

Examples

python scripts/setup_data.py; python train.py --conf examples/Pretrain.yml

Evaluation signals

  • Scaffold extraction preserves ring systems and linkers while removing all side chains; verify by comparing Murcko scaffold SMILES to original SMILES (scaffold should be a substructure).
  • Contrastive pairs: molecules with identical scaffolds but different side chains should have high cosine similarity in scaffold embedding space; validate via k-nearest neighbor analysis on scaffold embeddings.
  • Downstream taxonomy classification accuracy on held-out natural products improves when NaFM-pretrained scaffold representations are used vs. models pre-trained on synthetic molecules (as reported in paper benchmarks).
  • Scaffold clustering in learned embedding space correlates with known biosynthetic pathways or organism taxonomy (gene/microbial-level analysis signal).
  • Ablation: remove scaffold extraction and re-train; contrastive loss should be higher and downstream taxonomy accuracy should drop, confirming scaffold information is a material learning signal.

Limitations

  • Murcko scaffold extraction assumes ring systems encode evolutionary lineage; linear natural products (no rings) yield trivial or empty scaffolds and may not benefit from this approach.
  • Scaffold conservation is organism/pathway-dependent; scaffolds extracted from unrelated natural product families may not cluster meaningfully.
  • Scaffold extraction is computationally expensive for large pre-training datasets; preprocessing (SMILES standardization, scaffold generation) must be run once and cached (as in NaFM's filter.py step).
  • Side-chain diversity is lost in scaffold representation; models must use both scaffold and full-molecule objectives to retain biosynthetic details.

Evidence

  • [intro] Our method integrates contrastive learning with masked graph modeling, effectively encoding scaffold-derived evolutionary patterns alongside diverse side-chain information: "Our method integrates contrastive learning with masked graph modeling, effectively encoding scaffold-derived evolutionary patterns alongside diverse side-chain information"
  • [other] Identify and document the scaffold extraction and side-chain encoding mechanisms used to represent evolutionary and structural diversity.: "Identify and document the scaffold extraction and side-chain encoding mechanisms used to represent evolutionary and structural diversity."
  • [intro] Through detailed analysis at both gene and microbial levels, NaFM reveals a strong capacity for learning evolutionary information: "Through detailed analysis at both gene and microbial levels, NaFM reveals a strong capacity for learning evolutionary information"
  • [intro] conventional molecular representation techniques are not well-suited to the unique structural and evolutionary features of natural products: "conventional molecular representation techniques are not well-suited to the unique structural and evolutionary features of natural products"

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.