$npx -y skills add GPTomics/bioSkills --skill generative-designDesigns novel molecules using REINVENT 4 (de novo, scaffold decoration, linker design, R-group, molecular optimization), MolMIM, Diffusion-based generators (DiGress, DiffSMol), and JT-VAE with explicit handling of multi-parameter optimization (MPO), goal-directed scoring function
| 1 | ## Version Compatibility |
| 2 | |
| 3 | Reference examples tested with: REINVENT 4.0+, RDKit 2024.09+, PyTorch 2.1+, MolMIM (NVIDIA BioNeMo), chemprop 2.0+. |
| 4 | |
| 5 | Before using code patterns, verify installed versions match. If versions differ: |
| 6 | - Python: `pip show <package>` then `help(module.function)` to check signatures |
| 7 | |
| 8 | If code throws ImportError, AttributeError, or TypeError, introspect the installed |
| 9 | package and adapt the example to match the actual API rather than retrying. |
| 10 | |
| 11 | # Generative Molecular Design |
| 12 | |
| 13 | Generate novel molecules biased toward desired properties using deep generative models. REINVENT 4 (Loeffler et al. 2024, AstraZeneca) provides four generator families: Reinvent (de novo), Libinvent (scaffold decoration and library design), Linkinvent (linker design), and Mol2Mol (similarity-constrained molecular optimization). These support design tasks including R-group replacement and scaffold hopping and can be used with transfer learning, reinforcement learning, and curriculum learning. For specific niches: MolMIM (NVIDIA BioNeMo) for latent-space property optimization, DiffSMol / DiGress for diffusion-based generation, and JT-VAE for latent-space optimization. The art of generative design is in the **scoring function**: poorly-designed scoring rewards uninteresting molecules, while well-designed scoring captures both activity and developability. |
| 14 | |
| 15 | For QSAR/scoring models that feed generative design, see `chemoinformatics/qsar-modeling`. For synthetic feasibility, see `chemoinformatics/retrosynthesis`. For library enumeration as alternative, see `chemoinformatics/reaction-enumeration`. |
| 16 | |
| 17 | ## Generator Mode Taxonomy |
| 18 | |
| 19 | | Mode | Input | Output | Use case | Fails when | |
| 20 | |------|-------|--------|----------|------------| |
| 21 | | De novo | Empty seed or training set | Novel molecules | Wide chemical space exploration | Synthetic feasibility weak | |
| 22 | | Scaffold decoration | Scaffold + attachment points | Decorated molecules | Series expansion | Generation diversity limited by scaffold | |
| 23 | | Linker design | 2 fragments | Linker molecules | PROTAC, ternary complex | Few linker geometric options | |
| 24 | | R-group replacement | Scaffold + existing R-groups | New R-group set | Optimize one position | Single-position only | |
| 25 | | Molecular optimization | Lead molecule | Improved analogs | Lead optimization | Improvement window narrow | |
| 26 | | Constrained generation | Hard constraints (MW, fragments) | Compliant molecules | Patent / IP design | Constraints overly restrictive | |
| 27 | |
| 28 | ## Learning Algorithm Taxonomy |
| 29 | |
| 30 | | Algorithm | Use | Pro | Con | |
| 31 | |-----------|-----|-----|-----| |
| 32 | | Transfer learning (TL) | Adapt prior model to focused training set | Stable, simple | Limited optimization power | |
| 33 | | Reinforcement learning (RL) | Reward-driven generation | Powerful for MPO | Reward hacking risk | |
| 34 | | Curriculum learning (CL) | Gradual constraint introduction | Better convergence | Slower; tuning sensitive | |
| 35 | |
| 36 | ## Decision Tree by Scenario |
| 37 | |
| 38 | | Scenario | Generator | Algorithm | Scoring | |
| 39 | |----------|-----------|-----------|---------| |
| 40 | | New target, no SAR | De novo | Benchmark RL against simpler search | Validated target evidence + developability objectives | |
| 41 | | Series expansion | Scaffold decoration | TL on series + RL | QSAR ensemble + QED | |
| 42 | | PROTAC linker | Linker design | Project-specific constrained workflow | Validated geometry/ternary-complex evidence; no generic DC50 surrogate | |
| 43 | | Lead optimization MPO | Molecular optimization | CL with staged constraints | Multi-task: activity + ADMET | |
| 44 | | Diverse hit set | De novo with diversity bonus | RL + Tanimoto distance to known | Activity + diversity | |
| 45 | | Patent space carve-out | Constrained de novo | RL + structural constraints | Activity + novelty | |
| 46 | | Hit-to-lead | R-group replacement | TL on lead + RL | Activity + Lipinski | |
| 47 | | ADMET-aware design | De novo or optimization | RL | hERG + CYP + AMES + QED | |
| 48 | |
| 49 | ## REINVENT 4 Setup |
| 50 | |
| 51 | REINVENT 4 uses a TOML configuration file specifying generator, algorithm, prior model, and scoring functions. |
| 52 | |
| 53 | **Goal:** Configure a reinforcement-learning REINVENT 4 run with a prior, agent, sampling parameters, and a QED scoring component. |
| 54 | |
| 55 | **Approach:** Build a release-matched REINVENT 4 staged-learning TOML config with `[parameters]` for the prior/agent checkpoints, `[[stage]]` blocks, and one or more `[[stage.scoring.component]]` blocks. |