Skip to content

Commit fdd0900

Browse files
committed
Adds SA, renames drd3
1 parent ca3ed96 commit fdd0900

File tree

5 files changed

+80
-12
lines changed

5 files changed

+80
-12
lines changed

docs/protein-optimization/_toc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ parts:
2626
- file: using_poli/objective_repository/rdkit_logp.md
2727
- file: using_poli/objective_repository/ddr3_docking.md
2828
- file: using_poli/objective_repository/penalized_logp_lambo.md
29+
- file: using_poli/objective_repository/sa_tdc.md
2930
- file: using_poli/objective_repository/foldx_stability.md
3031
- file: using_poli/objective_repository/foldx_sasa.md
3132
- file: using_poli/objective_repository/super_mario_bros.md

docs/protein-optimization/index.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,18 @@ Computing the log-quotient of solubilities using `RDKit`.
5454
Computing the penalized log-quotient of solubilities using `lambo`'s implementation.
5555
:::
5656

57-
:::{grid-item-card} DDR3 (or 3pbl) docking (using `tdc`)
58-
:link: ./using_poli/objective_repository/ddr3_docking.html
57+
:::{grid-item-card} DRD3 (or 3pbl) docking (using `tdc`)
58+
:link: ./using_poli/objective_repository/drd3_docking.html
5959
:columns: 6
6060
A wrapper around the Therapeutics Data Commons implmenetation of `3pbl` docking.
6161
:::
6262

63+
:::{grid-item-card} Synthetic Accessibility (SA, using `tdc`)
64+
:link: ./using_poli/objective_repository/sa_tdc.html
65+
:columns: 6
66+
A wrapper around the Therapeutics Data Commons implmenetation of the synthetic accessibility oracle.
67+
:::
68+
6369
::::
6470

6571
### Proteins
@@ -160,10 +166,3 @@ How to contribute a new black-box optimization algorithm.
160166

161167
::::
162168

163-
164-
<!-- ## References
165-
166-
:::{bibliography}
167-
:style: alpha
168-
169-
::: -->

docs/protein-optimization/using_poli/objective_repository/all_objectives.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ Computing the penalized log-quotient of solubilities using `lambo`'s implementat
5353
A wrapper around the Therapeutics Data Commons implmenetation of 3pbl docking.
5454
:::
5555

56+
:::{grid-item-card} Synthetic Accessibility (SA, using `tdc`)
57+
:link: ./using_poli/objective_repository/sa_tdc.html
58+
:columns: 6
59+
A wrapper around the Therapeutics Data Commons implmenetation of the synthetic accessibility oracle.
60+
:::
61+
5662
:::{grid-item-card} TDC oracles [WIP]
5763
:link: ./using_poli/objective_repository/tdc_oracles.html
5864
:columns: 6

docs/protein-optimization/using_poli/objective_repository/ddr3_docking.md renamed to docs/protein-optimization/using_poli/objective_repository/drd3_docking.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# DDR3 docking (using TDC)
1+
# DRD3 docking (using TDC)
22

33
![Type of objective function: discrete](https://img.shields.io/badge/Type-discrete_inputs-blue)
44
![Environment to run this objective function: poli lambo](https://img.shields.io/badge/Environment-poli____lambo-teal
@@ -54,7 +54,7 @@ This can easily be done by running
5454

5555
```bash
5656
# From the base of the poli repo
57-
conda env create --file src/poli/objective_repository/ddr3_docking/environment.yml
57+
conda env create --file src/poli/objective_repository/drd3_docking/environment.yml
5858
```
5959

6060
This particular example _doesn't_ need to have the `lambo` package installed.
@@ -98,7 +98,7 @@ from poli import objective_factory
9898

9999
# How to create
100100
problem_info, f, x0, y0, run_info = objective_factory.create(
101-
name="ddr3_docking",
101+
name="drd3_docking",
102102
force_register=True
103103
)
104104

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Synthetic Accessibility (using TDC)
2+
3+
![Type of objective function: discrete](https://img.shields.io/badge/Type-discrete_inputs-blue)
4+
![Environment to run this objective function: poli lambo](https://img.shields.io/badge/Environment-poli____lambo-teal
5+
)
6+
7+
## About
8+
9+
This objective function computes the synthetic accesibility of a small molecule using [the Therapeutics Data Common's oracle](https://tdcommons.ai/functions/oracles/#synthetic-accessibility-sa) {cite:p}`huang:TDC:2021` (which uses RDKit internally).
10+
11+
## Prerequisites
12+
13+
### Create the `poli__lambo` environment
14+
15+
#### Create the environment from the yml file
16+
17+
This can easily be done by running
18+
19+
```bash
20+
# From the base of the poli repo
21+
conda env create --file src/poli/objective_repository/sa_tdc/environment.yml
22+
```
23+
24+
This particular example _doesn't_ need to have the `lambo` package installed.
25+
26+
## How to run
27+
28+
You can only run this objective function either in the `poli__lambo` environment, or as an isolated process (which runs this environment underneath).
29+
30+
:::{warning}
31+
Running this objective function will create an `./oracle` folder on your working directory, where it will download the relevant files for the oracle to work.
32+
:::
33+
34+
::::{tab-set}
35+
36+
:::{tab-item} (Isolated) in the `poli__lambo` environment
37+
38+
After the setup described above, you can simply run the following code from
39+
40+
```python
41+
from pathlib import Path
42+
43+
import numpy as np
44+
45+
from poli import objective_factory
46+
47+
# How to create
48+
problem_info, f, x0, y0, run_info = objective_factory.create(
49+
name="sa_tdc",
50+
force_register=True
51+
)
52+
53+
# Example input:
54+
print(x0) # [['C' 'C' 'N' 'C' ...]]
55+
56+
# Querying:
57+
print(y0) # [[2.8548]]
58+
```
59+
60+
:::
61+
62+
::::

0 commit comments

Comments
 (0)