Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does the repo include the DRD3 benchmark? #1

Open
xuechao19 opened this issue May 31, 2024 · 1 comment
Open

Does the repo include the DRD3 benchmark? #1

xuechao19 opened this issue May 31, 2024 · 1 comment

Comments

@xuechao19
Copy link

how to run the DRD3 benchmark within this repo? Thank you.

@geekyeung
Copy link

how to run the DRD3 benchmark within this repo? Thank you.

Hello?

The DRD3 Receptor Docking Affinity task was first introduced in LOLBO (2201.11872 (arxiv.org)). While the authors provided a repository nataliemaus/lolbo (github.com), there are no configuration instructions for DRD3 in the repository, although they wrote:

Please contact the authors if you need any help with applying the LOLBO to run the other two tasks from the paper (Arithmetic Expressions, DRD3 Receptor Docking Affinity), or any other latent space optimization task.

I tried contacting these authors but received no response. So I decided to solve the environment setup myself.

The PyTDC import can be found in invbo/utils/mol_utils/mol_utils.py lines 8-11:

try:
    from tdc import Oracle
except:
    print("Warning: Failed to import tdc docking oracle, only needed for molecule docking tasks")

Clearly, none of the yml files provided in all repositories based on the LOLBO project include TDC-related dependencies. After repeated trials and errors, I found a working dependency installation method:

First, create a conda environment with python=3.10. Then use conda to install the following dependencies, with versions mostly from the dependencies used in LOLBO's environment.yml:

$ conda create -n lolbo python=3.10
$ conda install -c conda-forge pdbfixer=1.8.1 botorch=0.8.5 gpytorch=1.11 pytorch-gpu=1.11.0 pandas=1.4.2 scipy=1.8.0 rdkit=2022.03.1 selfies=2.0.0 numpy=1.22.3 fcd_torch=1.0.7 fire=0.4.0 pytdc=0.3.7 pyscreener=1.2.2 grpcio=1.46.1 pytorch-lightning=1.6.1

Then install the following with pip:

$ pip install guacamol==0.5.4
$ pip install molsets==0.3.1 --no-deps
$ pip install rdkit-pypi==2022.3.1

Additionally, the pyscreener dependency installation is quite complex. You must follow the installation guide at https://github.com/coleygroup/pyscreener to install ADFR Suite and vina 1.1.2, and add them to your PATH environment variable:

# ADFR Suite Installation
$ curl -O https://ccsb.scripps.edu/adfr/download/1038/ADFRsuite_x86_64Linux_1.0.tar.gz
tar zxvf ADFRsuite_x86_64Linux_1.0.tar.gz
$ cd ADFRsuite_x86_64Linux_1.0
$ ./install.sh

# Vina Installation 
$ curl -O https://vina.scripps.edu/wp-content/uploads/sites/55/2020/12/autodock_vina_1_1_2_linux_x86.tgz
$ tar zxvf autodock_vina_1_1_2_linux_x86.tgz

# Create symbolic links, replace `/path/to/` with acutal path
$ sudo ln -s /path/to/ADFRsuite_x86_64Linux_1.0/bin/prepare_receptor /usr/local/bin
$ sudo ln -s /path/to/autodock_vina_1_1_2_linux_x86/bin/vina /usr/local/bin

# Verify installation
$ which prepare_receptor
/path/to/prepare_receptor

$ which vina
/path/to/vina

Create a script like this to check if everything works:

from lolbo.utils.mol_utils import setup_tdc_oracle, smile_to_tdc_docking_score

# Step 1: Set up the Oracle for the target protein
protein_name = "drd3_docking"  # Name of the target protein
tdc_oracle = setup_tdc_oracle(protein_name)

# Step 2: Define a molecule (SMILES)
smiles_str = "CCOCC1=CC=CC=C1"  # Example molecule

# Step 3: Calculate the docking score
score = smile_to_tdc_docking_score(smiles_str, tdc_oracle, timeout=600)
print(f"Docking score for {smiles_str} against {protein_name}: {score}")

After successfully resolving all dependency issues, you should get output similar to this :):

Found local copy...
2024-01-01 00:00:00,000 INFO worker.py:1777 -- Started a local Ray instance. View the dashboard at 127.0.0.1:8265 
Docking: 100%|████████████████████████████████████| 1/1 [00:06<00:00, 6.56s/ligand]
getting docking score: -5.4 from protein took 6.573126316070557 seconds
Docking score for CCOCC1=CC=CC=C1 against drd3_docking: -5.4

This only solves the basic environment issue :(. You still need to customize the Objective Class and Top Level Optimization Class for the drd3-docking task.

I hope this can help you :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants