Giter VIP home page Giter VIP logo

moldqn-pytorch's Introduction

MolDQN-pytorch

MIT license made-with-python

PyTorch implementation of MolDQN as described in Optimization of Molecules via Deep Reinforcement Learning by Zhenpeng Zhou, Steven Kearnes, Li Li, Richard N. Zare and Patrick Riley.

Installation

From source:

  1. Install rdkit.
    conda create -c rdkit -n my-rdkit-env rdkit
    conda activate my-rdkit-env
    conda install -c conda-forge rdkit

  2. Clone this repository.
    git clone https://github.com/aksub99/MolDQN-pytorch.git
    cd MolDQN-pytorch

  3. Install the requirements given in requirements.txt.
    pip install -r requirements.txt

  4. Install baselines.
    pip install "git+https://github.com/openai/baselines.git"

From Docker:

Using a docker image requires an NVIDIA GPU. If you do not have a GPU please follow the directions for installing from source In order to get GPU support you will have to use the nvidia-docker plugin.

# Build the Dockerfile in Dockerfiles/Dockerfile to create a Docker image.
cd Dockerfiles
docker build -t moldqn_pytorch:latest .

# This will create a container from the image we just created.
nvidia-docker run -[Options] moldqn_pytorch:latest python path/to/main.py

Please remember to modify the TB_LOG_PATH variable in main.py depending on where you wish to store your tensorboard runs file.

Training the MolDQN:

python main.py

A simple example to train the model on a single property optimization task can be seen in examples/MolDQN-pytorch.ipynb.

Results:

The following was the reward curve obtained when the model was trained for 5000 episodes on a single property optimization task (QED in this case).

References:

The original tensorflow implementation can be found at https://github.com/google-research/google-research/tree/master/mol_dqn This repository re-uses some code from the original implementation.

moldqn-pytorch's People

Contributors

aksub99 avatar modiprabal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

moldqn-pytorch's Issues

Unable to build the Dockerfile

Sending build context to Docker daemon 1.78MB
Step 1/11 : FROM nvidia/cuda:9.0-cudnn7-runtime
9.0-cudnn7-runtime: Pulling from nvidia/cuda
976a760c94fc: Already exists
c58992f3c37b: Already exists
0ca0e5e7f12e: Already exists
f2a274cc00ca: Already exists
708a53113e13: Already exists
371ddc2ca87b: Already exists
f81888eb6932: Already exists
19dbd9dd59d6: Pull complete
908dbb070c62: Pull complete
Digest: sha256:091bd889817ef0fed925dbe43ee7c6d6665d52264b661699fe5ee1d40c98da92
Status: Downloaded newer image for nvidia/cuda:9.0-cudnn7-runtime
---> 890b7032cec3
Step 2/11 : RUN apt-get update && apt-get install -y -q wget git libxrender1 libsm6 bzip2 && apt-get clean
---> Running in 59ead540ed0f
Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:2 http://security.ubuntu.com/ubuntu xenial-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:3 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 InRelease
Could not resolve host: developer.download.nvidia.com
Err:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:5 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 InRelease
Could not resolve host: developer.download.nvidia.com
Err:6 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Temporary failure resolving 'archive.ubuntu.com'
Reading package lists...
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease Temporary failure resolving 'security.ubuntu.com'
W: Failed to fetch https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/InRelease Could not resolve host: developer.download.nvidia.com
W: Failed to fetch https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/InRelease Could not resolve host: developer.download.nvidia.com
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
Package bzip2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Unable to locate package wget
E: Unable to locate package git
E: Unable to locate package libxrender1
E: Unable to locate package libsm6
E: Package 'bzip2' has no installation candidate
The command '/bin/sh -c apt-get update && apt-get install -y -q wget git libxrender1 libsm6 bzip2 && apt-get clean' returned a non-zero code: 100

small molecules optimization

Hello,

I have some small molecules which interact with a rather high binding affinity toward my protein. I was wondering if I could use MolDQN to optimize these compounds and dock them against the protein target and see if the binding affinity has increased.
I can not figure out how I can feed the "smi" of these compounds to the main.py and get the outputs.
could you please provide an example on how I can achieve this?

Thanks in advance.
Best,
Amir

Unable to Install baselines from using the command

Hi,

I follow the instruction from the readme file and I get this error. Is there any workaround to solve it. Thanks in Advance!

pip install "git+https://github.com/openai/baselines.git@master#egg=baselines-0.1.6"
Collecting baselines-0.1.6
  Cloning https://github.com/openai/baselines.git (to revision master) to /tmp/pip-install-70qwyy4h/baselines-0-1-6_6283ec66ddc54949ac7d0692a6886577
  Running command git clone -q https://github.com/openai/baselines.git /tmp/pip-install-70qwyy4h/baselines-0-1-6_6283ec66ddc54949ac7d0692a6886577
  WARNING: Generating metadata for package baselines-0.1.6 produced metadata for project name baselines. Fix your #egg=baselines-0.1.6 fragments.
WARNING: Discarding git+https://github.com/openai/baselines.git@master#egg=baselines-0.1.6. Requested baselines from git+https://github.com/openai/baselines.git@master#egg=baselines-0.1.6 has inconsistent name: filename has 'baselines-0-1-6', but metadata has 'baselines'
ERROR: Could not find a version that satisfies the requirement baselines-0-1-6 (unavailable)
ERROR: No matching distribution found for baselines-0-1-6 (unavailable)


Docker : repository name must be lowercase

Hello,

Thanks for sharing your source code, and for the amazing work.

When running the docker build command in the README, I get the following error :
invalid argument "MolDQN_pytorch:latest" for "-t, --tag" flag: invalid reference format: repository name must be lowercase

I guess the image name may be required to be lowercase.

Thanks again,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.