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|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
task_categories:
|
| 4 |
+
- text-generation
|
| 5 |
+
tags:
|
| 6 |
+
- chemistry
|
| 7 |
+
- drug-discovery
|
| 8 |
+
- smiles
|
| 9 |
+
- molecules
|
| 10 |
+
- instruction-tuning
|
| 11 |
+
- retrosynthesis
|
| 12 |
+
- synthesis-planning
|
| 13 |
+
size_categories:
|
| 14 |
+
- 1M<n<10M
|
| 15 |
+
configs:
|
| 16 |
+
- config_name: all
|
| 17 |
+
data_files: all/*.parquet
|
| 18 |
+
default: true
|
| 19 |
+
- config_name: smileyllama
|
| 20 |
+
data_files: smileyllama/*.parquet
|
| 21 |
+
- config_name: linkllama
|
| 22 |
+
data_files: linkllama/*.parquet
|
| 23 |
+
- config_name: synllama
|
| 24 |
+
data_files: synllama/*.parquet
|
| 25 |
+
dataset_info:
|
| 26 |
+
features:
|
| 27 |
+
- name: instruction
|
| 28 |
+
dtype: string
|
| 29 |
+
- name: input
|
| 30 |
+
dtype: string
|
| 31 |
+
- name: output
|
| 32 |
+
dtype: string
|
| 33 |
+
- name: source
|
| 34 |
+
dtype: string
|
| 35 |
+
---
|
| 36 |
+
|
| 37 |
+
# CADD-Instruct
|
| 38 |
+
|
| 39 |
+
An instruction-tuning dataset for computer-aided drug design (CADD). It combines
|
| 40 |
+
three complementary tasks:
|
| 41 |
+
|
| 42 |
+
- **Conditional molecule generation** (`smileyllama`, `linkllama`) — generate a
|
| 43 |
+
SMILES string satisfying a set of physicochemical/structural constraints.
|
| 44 |
+
- **Retrosynthesis / synthesis planning** (`synllama`) — given a target
|
| 45 |
+
molecule, produce a synthetic pathway of reaction templates and building
|
| 46 |
+
blocks.
|
| 47 |
+
|
| 48 |
+
## Format
|
| 49 |
+
|
| 50 |
+
Every row follows the standard instruction / input / output schema:
|
| 51 |
+
|
| 52 |
+
| field | description |
|
| 53 |
+
| --- | --- |
|
| 54 |
+
| `instruction` | The system-level role/task description. |
|
| 55 |
+
| `input` | The user request (target properties, or a target SMILES to synthesize). |
|
| 56 |
+
| `output` | The answer — a SMILES string, or a JSON synthesis pathway (`synllama`). |
|
| 57 |
+
| `source` | Origin of the row (`smileyllama`, `linkllama`, or `synllama`). |
|
| 58 |
+
|
| 59 |
+
### Examples
|
| 60 |
+
|
| 61 |
+
Conditional generation (`smileyllama`):
|
| 62 |
+
|
| 63 |
+
```json
|
| 64 |
+
{
|
| 65 |
+
"instruction": "You love and excel at generating SMILES strings of drug-like molecules",
|
| 66 |
+
"input": "Output a SMILES string for a drug-like molecule with the following properties: <= 90 TPSA, lacks bad SMARTS, has covalent warheads (acrylamides), <= 5 LogP, <= 0.4 Fraction sp3, <= 10 Rotatable bonds:",
|
| 67 |
+
"output": "n1cc(/C=C/C(=O)Nc2ccc(cc2)COC)c(cc1)-c1cnn(C)c1",
|
| 68 |
+
"source": "smileyllama"
|
| 69 |
+
}
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
Linker generation (`linkllama`):
|
| 73 |
+
|
| 74 |
+
```json
|
| 75 |
+
{
|
| 76 |
+
"instruction": "You are an expert medicinal chemist specializing in linker design. Your task is to design a linker to connect given fragments and deduce whether the final molecule is chemically reasonable. The output should be in JSON format.",
|
| 77 |
+
"input": "Fragment 1 (SMILES: c1cc2nncn2nc1[*:1]) and Fragment 2 (SMILES: c1ccc([*:2])cc1). The distance between the attachment points is 6.59 Angstroms, and the angle between them is 114.60 degrees. Given the above information about the fragments and attachment points, design a branched linker with >= 1 rotatable bonds, >= 5 heavy atoms to connect them. The final molecule should be unreasonable. And it should have the following properties: <= 5H-bond donors, <= 7 H-bond acceptors, <= 600 Molecular weight, <= 200 TPSA.",
|
| 78 |
+
"output": "{\"linker\": \"BrC(=C\\\\[*:2])/C=N/N[*:1]\", \"reasoning\": \"Linker bad rings: pass. Linker problematic ring: absent. Undesirable SMARTS: pass. PAINS: pass. REOS failed rule: imine.\"}",
|
| 79 |
+
"source": "linkllama"
|
| 80 |
+
}
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
Synthesis planning (`synllama`):
|
| 84 |
+
|
| 85 |
+
```json
|
| 86 |
+
{
|
| 87 |
+
"instruction": "You are an expert synthetic organic chemist. Your task is to design a synthesis pathway for a given target molecule using common and reliable reaction templates and building blocks. ...",
|
| 88 |
+
"input": "Provide a synthetic pathway for this SMILES string: CNC1(CC(=O)[C@]2(...))CCCCC1",
|
| 89 |
+
"output": "{\"reactions\": [{\"reaction_number\": 1, \"reaction_template\": \"<rxn>...</rxn>\", \"reactants\": [...]}]}",
|
| 90 |
+
"source": "synllama"
|
| 91 |
+
}
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
## Configurations
|
| 95 |
+
|
| 96 |
+
| config | rows | description |
|
| 97 |
+
| --- | --- | --- |
|
| 98 |
+
| `all` (default) | ~5.86M | Combined dataset (all sources). |
|
| 99 |
+
| `smileyllama` | ~2.33M | SmileyLlama SFT data (conditional generation). |
|
| 100 |
+
| `linkllama` | ~1.53M | LinkLlama cap50 training data (conditional generation). |
|
| 101 |
+
| `synllama` | 2.00M | SynLlama synthesis-pathway data (synthesis planning). |
|
| 102 |
+
|
| 103 |
+
## Usage
|
| 104 |
+
|
| 105 |
+
Load the full dataset:
|
| 106 |
+
|
| 107 |
+
```python
|
| 108 |
+
from datasets import load_dataset
|
| 109 |
+
|
| 110 |
+
ds = load_dataset("lukaskim/cadd-instruct") # default "all" config
|
| 111 |
+
print(ds["train"][0])
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
Filter the combined dataset by `source`:
|
| 115 |
+
|
| 116 |
+
```python
|
| 117 |
+
from datasets import load_dataset
|
| 118 |
+
|
| 119 |
+
ds = load_dataset("lukaskim/cadd-instruct", split="train")
|
| 120 |
+
smiley = ds.filter(lambda ex: ex["source"] == "smileyllama")
|
| 121 |
+
```
|
| 122 |
+
|
| 123 |
+
Or load a specific source directly:
|
| 124 |
+
|
| 125 |
+
```python
|
| 126 |
+
from datasets import load_dataset
|
| 127 |
+
|
| 128 |
+
smiley = load_dataset("lukaskim/cadd-instruct", "smileyllama")
|
| 129 |
+
link = load_dataset("lukaskim/cadd-instruct", "linkllama")
|
| 130 |
+
```
|
| 131 |
+
|
| 132 |
+
Stream instead of downloading everything up front:
|
| 133 |
+
|
| 134 |
+
```python
|
| 135 |
+
from datasets import load_dataset
|
| 136 |
+
|
| 137 |
+
ds = load_dataset("lukaskim/cadd-instruct", split="train", streaming=True)
|
| 138 |
+
for example in ds:
|
| 139 |
+
print(example["input"], "->", example["output"])
|
| 140 |
+
break
|
| 141 |
+
```
|
| 142 |
+
|
| 143 |
+
Format a row into a prompt for supervised fine-tuning:
|
| 144 |
+
|
| 145 |
+
```python
|
| 146 |
+
from datasets import load_dataset
|
| 147 |
+
|
| 148 |
+
ds = load_dataset("lukaskim/cadd-instruct", split="train")
|
| 149 |
+
|
| 150 |
+
def to_prompt(ex):
|
| 151 |
+
return {"text": f"{ex['instruction']}\n\n{ex['input']}\n{ex['output']}"}
|
| 152 |
+
|
| 153 |
+
ds = ds.map(to_prompt)
|
| 154 |
+
print(ds[0]["text"])
|
| 155 |
+
```
|
| 156 |
+
|
| 157 |
+
## Sources
|
| 158 |
+
|
| 159 |
+
- **smileyllama**: SFT data for SmileyLlama — https://figshare.com/articles/dataset/SFT_Data_for_SmileyLlama/30854573
|
| 160 |
+
- **linkllama**: https://huggingface.co/datasets/THGLab/LinkLlama-cap50-train
|
| 161 |
+
- **synllama**: https://github.com/THGLab/SynLlama/tree/main
|
all/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2fabf807067dcfd08ff6d7a1cb524fb5e27efeaeae03da20269964a35fdb1d56
|
| 3 |
+
size 1641330391
|
linkllama/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c39a8bb7dc6c164965ec759f73334d6db2c957f3f8aa7c405f9cefc6833210f3
|
| 3 |
+
size 136499404
|
smileyllama/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2722ffe6df1f3a2801231dde1fac11d4ee3516e61c4095a475ccf627a1b0c781
|
| 3 |
+
size 167755805
|
synllama/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:69b0279197abbac7641ba440f270df357f0f4ed6064d4e6ba22a208c4288ce0c
|
| 3 |
+
size 1032659474
|