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

Scores not output to output file when running containerized Gnina #235

Open
JohnKirwan opened this issue Nov 16, 2023 · 5 comments
Open

Comments

@JohnKirwan
Copy link

Issue summary

I previously ran Gnina outside of a docker container and scores and minimzed affinity and CNN scores as comments were appended directly below the SDF block for each pose. I have since moved Gnina into a docker container and now I find only a single comment for minimzed affinity at 0 and no CNN scores, i.e.:

0.00000

However, scores are output to the terminal, e.g.:

mode | affinity | CNN | CNN
| (kcal/mol) | pose score | affinity
-----+------------+------------+----------
1 -7.11 0.7744 6.065

Gnina otherwise seems to run normally, generating plausible poses. Is there a setting in Gnina which might result in this behavior?

Steps to reproduce

I have run Gnina within a docker container as follows:

docker run --gpus all --name name1 -v /home/roc/dir_name/:/home/src/dir_name/ --shm-size 8gb pardela gnina -r /home/src/dir_name/temp/temp_gnina_receptor.pdb --ligand /home/src/dir_name/temp/temp_gnina_ligand.sdf --autobox_ligand /home/src/dir_name/temp/temp_gnina_receptor.pdb -o /home/src/dir_name/temp/temp_gnina_poses.sdf --exhaustiveness 64 --num_modes 10 --device 0 --cnn_scoring "rescore" --pose_sort_order CNNscore --min_rmsd_filter 1.0

Your system configuration

Operating system: Windows 11
Compiler: 11.4.0
CUDA version (if applicable): 12.3
CUDNN version (if applicable): 8.8.0.121
Python version: 3.11

@dkoes
Copy link
Contributor

dkoes commented Nov 16, 2023

I have not seen that before. If you can share your docker container I can look into it.

@JohnKirwan
Copy link
Author

Ok, thanks. The dockerfile is as follows:
`FROM nvidia/cuda:11.7.1-devel-ubuntu22.04

ARG OSVERSION "ubuntu2204"
ARG ARCH "x86_64"
ARG NVIDIA_PUBKEY="3bf863cc.pub"
ARG ENVNAME="gnina"

ENV PROJECT_DIR=${ENVNAME}
ENV IMAGE_NAME=${IMAGE_NAME_ARG}
ENV TZ=Europe/Lisbon

WORKDIR /home/nas
WORKDIR /home/src/${PROJECT_DIR}

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/${OSVERSION}/${ARCH}/${NVIDIA_PUBKEY}

RUN apt -y update &&
apt -y upgrade &&
apt-get -y install
wget
sudo
nano
build-essential
git
cmake
wget
libboost-all-dev
libeigen3-dev
libgoogle-glog-dev
libprotobuf-dev
protobuf-compiler
libhdf5-dev
libatlas-base-dev
python3-dev
librdkit-dev
python3-numpy
python3-pip
python3-pytest
openbabel
libopenbabel-dev
python3-openbabel

RUN git clone https://github.com/gnina/gnina.git &&
cd gnina &&
mkdir build &&
cd build &&
cmake -DCUDA_ARCH_NAME=All .. &&
make &&
make install

COPY environment_gnina.yml ../environment.yml

RUN wget https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-Linux-x86_64.sh &&
chmod +x Miniconda3-py39_4.12.0-Linux-x86_64.sh && ./Miniconda3-py39_4.12.0-Linux-x86_64.sh -b -p /opt/conda &&
export PATH=/opt/conda/bin:/opt/conda/condabin:$PATH &&
conda init &&
conda env create -f ../environment.yml &&
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc &&
echo 'export PYTHONPATH="/home/src/${PROJECT_DIR}/:$PYTHONPATH"' >> ~/.bashrc &&
echo "conda activate ${CONDA_ENV}" >> ~/.bashrc &&
rm Miniconda3-py39_4.12.0-Linux-x86_64.sh

CMD bash`

and the environment.yml files is:
`name: env
channels:

  • conda-forge
  • anaconda
    dependencies:
  • python=3.10
  • numpy
  • pandas
  • conda-forge::rdkit=2023.3.1
  • conda-forge::nglview
  • pip`

@dkoes
Copy link
Contributor

dkoes commented Nov 17, 2023

Before I go to the trouble of trying to reproduce this - can you try adding git checkout v1.0.3 so you are using a release version instead of a development version and see if that fixes the problem?

@JohnKirwan
Copy link
Author

Unfortunately, no. Reverting to this release version gives the same result.

@dkoes
Copy link
Contributor

dkoes commented Dec 11, 2023

I've built a container using your docker file and run it:

dkoes@jedi:~/git/gnina/docker/bug$ sudo docker run --gpus all --name bug -v /home/dkoes/tmp:/home/src/dir_name/ --shm-size 8gb c78ea0ceabf9 gnina -r /home/src/dir_name/rec.pdb --ligand /home/src/dir_name/lig.sdf --autobox_ligand /home/src/dir_name/rec.pdb -o /home/src/dir_name/temp_gnina_poses.sdf --exhaustiveness 64 --num_modes 10 --device 0 --cnn_scoring "rescore" --pose_sort_order CNNscore --min_rmsd_filter 1.0

==========
== CUDA ==
==========

CUDA Version 11.7.1

Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license

A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.

==============================
*** Open Babel Warning  in PerceiveBondOrders
  Failed to kekulize aromatic bonds in OBMol::PerceiveBondOrders

==============================
*** Open Babel Warning  in PerceiveBondOrders
  Failed to kekulize aromatic bonds in OBMol::PerceiveBondOrders

              _             
             (_)            
   __ _ _ __  _ _ __   __ _ 
  / _` | '_ \| | '_ \ / _` |
 | (_| | | | | | | | | (_| |
  \__, |_| |_|_|_| |_|\__,_|
   __/ |                    
  |___/                     

gnina  master:617ee3b   Built Dec 11 2023.
gnina is based on smina and AutoDock Vina.
Please cite appropriately.

Commandline: gnina -r /home/src/dir_name/rec.pdb --ligand /home/src/dir_name/lig.sdf --autobox_ligand /home/src/dir_name/rec.pdb -o /home/src/dir_name/temp_gnina_poses.sdf --exhaustiveness 64 --num_modes 10 --device 0 --cnn_scoring rescore --pose_sort_order CNNscore --min_rmsd_filter 1.0
Using random seed: 1702327841

0%   10   20   30   40   50   60   70   80   90   100%
|----|----|----|----|----|----|----|----|----|----|
***************************************************

mode |  affinity  |  intramol  |    CNN     |   CNN
     | (kcal/mol) | (kcal/mol) | pose score | affinity
-----+------------+------------+------------+----------
    1       -8.52       -0.77       0.9558      6.849
    2       -8.49       -0.87       0.9003      6.787
    3       -8.30       -0.72       0.4690      6.483
    4       -6.75       -0.57       0.3723      5.034
    5       -6.72       -0.23       0.3103      5.009
    6       -7.00       -0.08       0.3008      4.996
    7       -6.53       -0.59       0.2917      4.971
    8       -6.69       -0.92       0.2642      5.246
    9       -6.90       -0.91       0.2573      4.993
   10       -6.49       -0.84       0.2535      5.226

The scores are present in the output file:

> <minimizedAffinity>
-8.52006

> <CNNscore>
0.9558389783

> <CNNaffinity>
6.8487119675

> <CNN_VS>
6.5462660789

> <CNNaffinity_variance>
0.1397060603

Can you provide your input files so I can see if that's the problem?

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