Update README.md
Browse files
README.md
CHANGED
|
@@ -22,4 +22,29 @@ dataset_info:
|
|
| 22 |
download_size: 110659389
|
| 23 |
dataset_size: 872969895.9256648
|
| 24 |
---
|
| 25 |
-
# From [jglaser/binding_affinity](https://huggingface.co/datasets/jglaser/binding_affinity), converted to SELFIES
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
download_size: 110659389
|
| 23 |
dataset_size: 872969895.9256648
|
| 24 |
---
|
| 25 |
+
# From the [jglaser/binding_affinity](https://huggingface.co/datasets/jglaser/binding_affinity) database, converted to SELFIES
|
| 26 |
+
|
| 27 |
+
Steps to prepare the database:
|
| 28 |
+
|
| 29 |
+
1. Download the jglaser/binding_affinity database
|
| 30 |
+
|
| 31 |
+
```python
|
| 32 |
+
from datasets import load_dataset
|
| 33 |
+
|
| 34 |
+
binding_data = load_dataset('parquet', split='train', data_files="https://huggingface.co/datasets/jglaser/binding_affinity/resolve/main/data/all_512.parquet")
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
2. Convert SMILES to [SELFIES](https://github.com/aspuru-guzik-group/selfies)
|
| 38 |
+
|
| 39 |
+
```python
|
| 40 |
+
import selfies
|
| 41 |
+
|
| 42 |
+
def smiles_to_selfies(dataset):
|
| 43 |
+
try:
|
| 44 |
+
return {"selfies": selfies.encoder(dataset["smiles_can"])}
|
| 45 |
+
except selfies.EncoderError:
|
| 46 |
+
return {"selfies": None}
|
| 47 |
+
|
| 48 |
+
binding_data = binding_data.map(smiles_to_selfies)
|
| 49 |
+
binding_data = binding_data.filter(lambda dataset: dataset["selfies"] != None)
|
| 50 |
+
```
|