Логотип Bio Generative Design

Bio Generative Design

Організація
PKU-YuanGroup
bio-generative-design

Проєктує нові молекули за допомогою REINVENT 4 (de novo, декорування каркаса, проєктування лінкерів, R-групи, оптимізація молекул), MolMIM, генераторів на основі дифузії (DiGress, DiffSMol) і JT-VAE, з явним урахуванням багатопараметричної оптимізації (MPO), цільових функцій оцінювання, перенесення навчання, навчання з підкріпленням і навчання за навчальним планом, оцінювання синтетичної доступності, а також дослідження й освоєння хімічного простору. Використовуйте для проєктування нових хімічних сполук проти мішені, декорування каркаса, з’єднання фрагментів або одночасної оптимізації хіту за кількома властивостями ADMET / активності.

Add to TypingMind

Огляд

ВидавецьPKU-YuanGroup
РепозиторійOpenAI4S
Назва навичкиbio-generative-design
Зірки
622
Форки
72
Файли в пакеті
2
ЛіцензіяMIT
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 2

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Видавець на GitHub: PKU-YuanGroup. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Bio Generative Design у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/PKU-YuanGroup/OpenAI4S/tree/main/skills/bioskills/bio-chemoinformatics-generative-design
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/PKU-YuanGroup/OpenAI4S.git /tmp/OpenAI4S
mkdir -p .claude/skills
cp -r /tmp/OpenAI4S/skills/bioskills/bio-chemoinformatics-generative-design .claude/skills/bio-generative-design
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Bio Generative Design в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Bio Generative Design, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Bio Generative Design не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

Version Compatibility

Reference examples tested with: REINVENT 4.0+, RDKit 2024.09+, PyTorch 2.1+, MolMIM (NVIDIA BioNeMo), chemprop 2.0+.

Before using code patterns, verify installed versions match. If versions differ:

  • Python: pip show <package> then help(module.function) to check signatures

If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.

Generative Molecular Design

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.

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.

Generator Mode Taxonomy

ModeInputOutputUse caseFails when
De novoEmpty seed or training setNovel moleculesWide chemical space explorationSynthetic feasibility weak
Scaffold decorationScaffold + attachment pointsDecorated moleculesSeries expansionGeneration diversity limited by scaffold
Linker design2 fragmentsLinker moleculesPROTAC, ternary complexFew linker geometric options
R-group replacementScaffold + existing R-groupsNew R-group setOptimize one positionSingle-position only
Molecular optimizationLead moleculeImproved analogsLead optimizationImprovement window narrow
Constrained generationHard constraints (MW, fragments)Compliant moleculesPatent / IP designConstraints overly restrictive

Learning Algorithm Taxonomy

AlgorithmUseProCon
Transfer learning (TL)Adapt prior model to focused training setStable, simpleLimited optimization power
Reinforcement learning (RL)Reward-driven generationPowerful for MPOReward hacking risk
Curriculum learning (CL)Gradual constraint introductionBetter convergenceSlower; tuning sensitive

Decision Tree by Scenario

ScenarioGeneratorAlgorithmScoring
New target, no SARDe novoBenchmark RL against simpler searchValidated target evidence + developability objectives
Series expansionScaffold decorationTL on series + RLQSAR ensemble + QED
PROTAC linkerLinker designProject-specific constrained workflowValidated geometry/ternary-complex evidence; no generic DC50 surrogate
Lead optimization MPOMolecular optimizationCL with staged constraintsMulti-task: activity + ADMET
Diverse hit setDe novo with diversity bonusRL + Tanimoto distance to knownActivity + diversity
Patent space carve-outConstrained de novoRL + structural constraintsActivity + novelty
Hit-to-leadR-group replacementTL on lead + RLActivity + Lipinski
ADMET-aware designDe novo or optimizationRLhERG + CYP + AMES + QED

REINVENT 4 Setup

REINVENT 4 uses a TOML configuration file specifying generator, algorithm, prior model, and scoring functions.

Goal: Configure a reinforcement-learning REINVENT 4 run with a prior, agent, sampling parameters, and a QED scoring component.

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. Validate the config with the installed release because component parameters evolve between versions.

toml
run_type = "staged_learning"
device = "cuda:0"

[parameters]
prior_file = "priors/reinvent.prior"
agent_file = "priors/reinvent.prior"
batch_size = 64
unique_sequences = true

[[stage]]
termination = "simple"
min_steps = 25
max_steps = 500

[stage.scoring]
type = "geometric_mean"

[[stage.scoring.component]]
[stage.scoring.component.QED]

[[stage.scoring.component.QED.endpoint]]
name = "QED"
weight = 1
bash
# The REINVENT 4 CLI binary is `reinvent` (not `reinvent4`).
reinvent -l logfile.log config.toml

Output: a live stage CSV using summary_csv_prefix, plus the configured chkpt_file at stage termination or graceful interruption. Post-process the CSV to select molecules; REINVENT does not emit a checkpoint and SMILES file at every iteration by default.

Scoring Function Design (Most Important Part)

A good scoring function:

  • Returns 0-1 (normalized)
  • Combines multiple endpoints
  • Penalizes pathological generations (PAINS, unstable, unsynthesizable)

Goal: Build a multi-component generative reward that balances predicted activity, drug-likeness, synthesizability, and novelty.

Approach: Combine a QSAR sigmoid on pIC50, QED, SA-score reverse-sigmoid, and Tanimoto-similarity reverse-sigmoid via geometric mean so any zero component zeroes the total.

In REINVENT 4, define these under the active stage's [stage.scoring] section, with each component using the exact component and endpoint tables from the installed release's configuration examples. Do not reuse REINVENT 3 [scoring_function] or [[scoring_function.components]] syntax in a REINVENT 4 config. The accompanying example is deliberately limited to built-in, documented component structure; add predictive-property endpoints only after validating their release-specific model-container parameters.

geometric_mean ensures all components must be reasonably high (one zero -> zero total). arithmetic_mean allows compensation.

Multi-Parameter Optimization (MPO)

Lead optimization commonly involves multiple objectives. The following component types illustrate a project-specific scoring design; weights and transforms must be fit to the actual assays and decision context.

ComponentWeightTransformation
Target activity (predicted pIC50)0.3sigmoid 5-8
Selectivity (off-target ratio)0.2sigmoid 1-100
QED0.1identity
Synthetic accessibility (SA score)0.1reverse sigmoid 1-4
hERG predicted prob0.1reverse sigmoid 0.3-0.7
AMES predicted prob0.1reverse sigmoid 0.3-0.7
Tanimoto novelty vs known0.1reverse sigmoid 0.4-0.6

The weights and transformation bounds above are repository starting examples only. Normalize weights as required by the selected aggregation and tune every bound against project assay distributions and prospective behavior.

Reward Hacking (Production Pitfall)

RL agents will find ways to maximize reward without learning the intended behavior:

  • Trivial scaffolds that score high on QED
  • Repeat structural motifs that game similarity scoring
  • Out-of-distribution molecules that exploit QSAR overconfidence
  • Trivial SMILES (e.g., "CCC...C") that match generic scoring

Mitigations:

  • Include one or more synthesis-aware signals when they have been validated for the project; SA score alone does not establish route feasibility
  • Use ensemble QSAR with uncertainty (penalize high-uncertainty predictions)
  • Include diversity bonus (Tanimoto to reference)
  • Add fingerprint similarity penalty within batch (prevent mode collapse)
  • Validate generated samples on held-out QSAR test set

Synthetic Accessibility Scoring

sa_score (Ertl 2009) measures synthetic accessibility: 1 (easy) to 10 (very hard).

python
from rdkit.Contrib.SA_Score import sascorer
from rdkit import Chem

def sa_score(smi):
    mol = Chem.MolFromSmiles(smi)
    if mol is None:
        return None
    return sascorer.calculateScore(mol)

sascorer is shipped in RDKit Contrib in current RDKit distributions. Use the namespaced import above; do not install an unrelated top-level package.

The score is a 1-to-10 heuristic derived from fragment contributions and molecular complexity, with lower values intended to indicate easier synthesis. It is not a route planner, cost estimate, or calibrated feasibility probability. Use it as one audited reward component or annotation, never as an absolute filter.

Diffusion-Based Generation (Modern Alternatives)

ToolApproachStrengthStatus
DiGress (Vignac 2023)Discrete diffusion on graphsConditional generationPublic
DiffSMol (Chen 2025)Equivariant diffusion3D molecule generationPublic
MolDiff (Peng 2023)Full-atom diffusionJoint atom/bond generationPublic
TargetDiff (Guan 2023)Pocket-conditioned equivariant diffusionStructure-based designPublic

Diffusion models iteratively denoise molecular representations, whereas REINVENT generators autoregressively construct SMILES. Diversity, validity, and drug-likeness depend on the model, training data, conditioning, and evaluation protocol; compare them on a matched benchmark for the intended task.

Constrained / Goal-Directed Generation

Goal: Enforce hard structural requirements (e.g., must contain hydroxyl) and exclude PAINS without letting constraint satisfaction game the reward.

Approach: Stage transfer learning then RL. In REINVENT 4, CustomAlerts is a global structural-alert filter: a match produces zero and it is applied before score aggregation. MatchingSubstructure is a scoring component (1 for a match and 0.5 otherwise), so it is a soft penalty rather than a hard inclusion constraint. Apply a separate post-generation SMARTS validation step when presence of a feature is mandatory.

toml
[[stage.scoring.component]]
[stage.scoring.component.CustomAlerts]

[[stage.scoring.component.CustomAlerts.endpoint]]
name = "Unwanted SMARTS"
params.smarts = ["PAINS_SMARTS_1", "BRENK_SMARTS_1"]

[[stage.scoring.component]]
[stage.scoring.component.MatchingSubstructure]

[[stage.scoring.component.MatchingSubstructure.endpoint]]
name = "Hydroxyl preference"
weight = 0.1
params.smarts = ["[OX2H]"]

There is no REINVENT 4 filter_only option for these components. Treat structural alerts as triage flags where appropriate, and separately verify any true hard inclusion or exclusion rule on the generated structures.

MolMIM (NVIDIA BioNeMo)

MolMIM encodes SMILES into a learned latent space, uses gradient-free CMA-ES to optimize a user-defined property objective, and decodes candidate molecules.

python
# Pseudo-code; requires NVIDIA NIM access
# from bionemo.molmim import MolMIMOptimizer
# optimizer = MolMIMOptimizer(model="molmim-property-optimizer")
# optimized = optimizer.optimize(seed_smiles, target_property="logp", target_value=2.0)

Tradeoffs against REINVENT depend on the oracle budget, objective, and implementation; benchmark both under matched constraints when selecting a generator.

Per-Tool Failure Modes

REINVENT RL -- mode collapse

Trigger: The reward, learning strategy, or diversity control favors a narrow chemotype.

Mechanism: Agent finds a high-scoring local maximum and stops exploring.

Symptom: Diversity and scaffold coverage collapse relative to a project-defined baseline while reward continues to rise.

Fix: Add diversity bonus to scoring; reduce sigma; reset agent if collapsed.

REINVENT TL -- overfitting

Trigger: Transfer learning data are too small or homogeneous for the intended generalization task.

Mechanism: Generator memorizes training set; no generalization.

Symptom: Generated molecules near-identical to training set actives.

Fix: Use larger training set; mix with diverse external sample; apply RL after TL.

Generated molecule unsynthesizable

Trigger: SA score missing from reward.

Mechanism: The reward omits synthesis evidence, allowing candidates with no plausible validated route to score well.

Symptom: AiZynthFinder cannot solve route; medchem rejects.

Fix: Combine audited synthesis-aware annotations with reaction- or route-based validation for selected candidates.

PAINS in generation

Trigger: No structural alerts in scoring.

Mechanism: Curcumin / rhodanine / quinone scaffolds optimize for activity (false positives in training data).

Symptom: Generated molecules match PAINS_A.

Fix: Flag relevant structural alerts for orthogonal assay review or apply a project-justified penalty; never reward a PAINS match.

Diffusion model OOD

Trigger: Pocket-conditioned diffusion on novel target family.

Mechanism: Training distribution covered specific protein families; novel targets extrapolate.

Symptom: Generated molecules look like training distribution, not optimized for target.

Fix: Validate on target-family-held-out evaluation; supplement with classical methods.

Validation set leakage

Trigger: Same molecules in training generators and downstream QSAR.

Mechanism: Scoring model has seen the molecule; predictions optimistic.

Symptom: Held-out QSAR validation fails on top generated.

Fix: Use scaffold-split QSAR; ensure scoring model trained on a held-out set vs generation samples.

Reconciliation: REINVENT vs Diffusion

AspectREINVENT 4Diffusion
SpeedImplementation-, hardware-, and oracle-dependentImplementation-, hardware-, and sampling-step-dependent
Output diversityModel/training/reward-dependentModel/training/conditioning-dependent
Drug-likeness of outputTraining- and reward-dependentTraining- and conditioning-dependent
Scoring flexibilityExcellent (TOML config)Method-specific
Production maturityHighEmerging
When to useWhen its priors and scoring system validate well for the taskWhen a matched benchmark supports the selected diffusion model

Common Errors

SymptomCauseFix
REINVENT generates invalid SMILESPrior/tokenization/model mismatch or sampling issueInspect invalid-token logs, prior compatibility, and release-matched sampling settings; sigma is not a token sampling rate
QSAR score all 0.0Out-of-domain moleculesEnsemble + uncertainty; reject high-uncertainty
All generations duplicatesunique_sequences=FalseSet unique_sequences=true
Generated SMILES too longPrior/model sequence behaviorUse a release-documented sampling constraint or post-generation project rule; do not invent a staged-learning max_length field
Reward stuck at 0.5Constraints conflictInspect scoring components; reduce constraint count
Diffusion model crashesInput violates model-specific pocket/size contractFollow that model release's documented preprocessing and limits
MolMIM cold-start slowLatent search exhaustivenessReduce search budget
Optimization converges triviallyReward gradient dominated by one termUse geometric_mean; rebalance weights

References

  • Loeffler et al., J. Cheminformatics 16:20 (2024) -- REINVENT 4 framework and four generator families (DOI 10.1186/s13321-024-00812-5).
  • Olivecrona M et al., J. Cheminformatics 9:48 (2017) -- REINVENT original (DOI 10.1186/s13321-017-0235-x).
  • Vignac et al., ICLR (2023) -- DiGress discrete diffusion.
  • Chen H et al., Nat. Mach. Intell. 7:758-770 (2025) -- DiffSMol structure-based 3D molecular generation (DOI 10.1038/s42256-025-01030-w).
  • Peng X, Guan J, Liu Q, Ma J. Proc. ICML, PMLR 202:27611-27629 (2023) -- MolDiff full-atom molecular diffusion.
  • Guan J et al., ICLR (2023) -- TargetDiff pocket-conditioned 3D equivariant diffusion (OpenReview: kJqXEPXMsE0).
  • Reidenbach D, Livne M, Ilango RK, Gill M, Israeli J. MLDD Workshop at ICLR (2023) -- MolMIM and CMA-ES latent-space optimization (OpenReview: iOJlwUTUyrN).
  • Jin W, Barzilay R, Jaakkola T. Proc. ICML, PMLR 80:2323-2332 (2018) -- JT-VAE junction-tree.
  • Ertl P, Schuffenhauer A. J. Cheminformatics 1:8 (2009) -- SA score (DOI 10.1186/1758-2946-1-8).
  • REINVENT 4 official repository and release-matched configs: https://github.com/MolecularAI/REINVENT4
  • RDKit SA-score implementation: https://github.com/rdkit/rdkit/tree/master/Contrib/SA_Score

Related Skills

  • chemoinformatics/qsar-modeling - Build scoring models for generative
  • chemoinformatics/retrosynthesis - Validate synthetic feasibility post-generation
  • chemoinformatics/molecular-standardization - Standardize generated SMILES
  • chemoinformatics/admet-prediction - ADMET in scoring components
  • chemoinformatics/substructure-search - PAINS / BRENK filter for generation
  • chemoinformatics/scaffold-analysis - Scaffold-aware generation control
  • chemoinformatics/reaction-enumeration - Alternative to generative for combinatorial
  • chemoinformatics/virtual-screening - Validate generated against target

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ Bio Generative Design?

Проєктує нові молекули за допомогою REINVENT 4 (de novo, декорування каркаса, проєктування лінкерів, R-групи, оптимізація молекул), MolMIM, генераторів на основі дифузії (DiGress, DiffSMol) і JT-VAE, з явним урахуванням багатопараметричної оптимізації (MPO), цільових функцій оцінювання, перенесення навчання, навчання з підкріпленням і навчання за навчальним планом, оцінювання синтетичної доступності, а також дослідження й освоєння хімічного простору. Використовуйте для проєктування нових хімічних сполук проти мішені, декорування каркаса, з’єднання фрагментів або одночасної оптимізації хіту...

Навіщо використовувати Bio Generative Design у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Bio Generative Design — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Bio Generative Design у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/PKU-YuanGroup/OpenAI4S/tree/main/skills/bioskills/bio-chemoinformatics-generative-design. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Bio Generative Design?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Bio Generative Design?

Зі скількома забажаєте. У TypingMind ви можете використовувати Bio Generative Design із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Bio Generative Design?

Так. На GitHub цю навичку публікує PKU-YuanGroup за ліцензією MIT. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇