bio-reaction-enumerationlisted
Install: claude install-skill huamu668/clawhub-openclaw-medical
## Version Compatibility
Reference examples tested with: RDKit 2024.03+
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.
# Reaction Enumeration
**"Generate a combinatorial library from my building blocks"** → Enumerate virtual compound libraries by applying reaction SMARTS transformations to sets of building-block molecules, producing and validating all product combinations for a defined synthetic route.
- Python: `AllChem.ReactionFromSmarts()`, `rxn.RunReactants()` (RDKit)
Generate virtual compound libraries using reaction SMARTS.
## Reaction SMARTS Basics
```python
from rdkit import Chem
from rdkit.Chem import AllChem
# Define reaction (reactants >> products with atom mapping)
# Amide coupling: carboxylic acid + amine -> amide
amide_rxn = AllChem.ReactionFromSmarts(
'[C:1](=[O:2])O.[N:3]>>[C:1](=[O:2])[N:3]'
)
# Validate reaction definition
n_errors = amide_rxn.Validate()
if n_errors[0] == 0:
print('Reaction is valid')
# Run reaction
acid = Chem.MolFromSmiles('CC(=O)O')
amine = Chem.MolFromSmiles('CCN')
products = amide_rxn.RunReactants((acid, amine))
# products is a tuple of tuples: ((product1,), (product2,), ...)
for prod_set in products:
for prod in prod_set:
Chem.SanitizeM