Commit ad01a306 authored by leswing's avatar leswing
Browse files

nottest

parent 571336d3
Loading
Loading
Loading
Loading
+32 −3
Original line number Diff line number Diff line
"""
Tests for binding pocket detection. 
"""
from __future__ import print_function
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

__author__ = "Bharath Ramsundar"
@@ -12,11 +12,10 @@ __license__ = "MIT"
import sys
from deepchem.utils.dependencies import mdtraj as md
import unittest
import tempfile
import os
import shutil
import numpy as np
import deepchem as dc
from nose.tools import nottest
from deepchem.utils import rdkit_util


@@ -149,6 +148,36 @@ class TestBindingPocket(unittest.TestCase):

    assert len(pockets) < len(all_pockets)

  @nottest
  def test_rf_convex_find_pockets(self):
    """Test that filter with pre-trained RF models works."""
    if sys.version_info >= (3, 0):
      return

    current_dir = os.path.dirname(os.path.realpath(__file__))
    protein_file = os.path.join(current_dir, "1jld_protein.pdb")
    ligand_file = os.path.join(current_dir, "1jld_ligand.sdf")

    protein = md.load(protein_file)

    finder = dc.dock.RFConvexHullPocketFinder()
    pockets, pocket_atoms_map, pocket_coords = finder.find_pockets(protein_file,
                                                                   ligand_file)
    # Test that every atom in pocket maps exists
    n_protein_atoms = protein.xyz.shape[1]
    print("protein.xyz.shape")
    print(protein.xyz.shape)
    print("n_protein_atoms")
    print(n_protein_atoms)
    print("len(pockets)")
    print(len(pockets))
    for pocket in pockets:
      pocket_atoms = pocket_atoms_map[pocket]
      for atom in pocket_atoms:
        # Check that the atoms is actually in protein
        assert atom >= 0
        assert atom < n_protein_atoms

  def test_extract_active_site(self):
    """Test that computed pockets have strong overlap with true binding pocket."""
    current_dir = os.path.dirname(os.path.realpath(__file__))
+21 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ __license__ = "MIT"
import unittest
import os
from nose.plugins.attrib import attr
from nose.tools import nottest
import sys
import deepchem as dc

@@ -82,6 +83,26 @@ class TestDocking(unittest.TestCase):
    # Check returned files exist
    assert score.shape == (1,)

  @nottest
  def test_pocket_vina_grid_rf_docker_dock(self):
    """Test that VinaGridRFDocker can dock."""
    if sys.version_info >= (3, 0):
      return

    current_dir = os.path.dirname(os.path.realpath(__file__))
    protein_file = os.path.join(current_dir, "1jld_protein.pdb")
    ligand_file = os.path.join(current_dir, "1jld_ligand.sdf")

    docker = dc.dock.VinaGridRFDocker(exhaustiveness=1, detect_pockets=True)
    (score, (protein_docked, ligand_docked)) = docker.dock(
        protein_file, ligand_file, dry_run=True)

    # Check returned files exist
    if sys.version_info >= (3, 0):
      return

    assert score.shape == (1,)

  def test_vina_grid_dnn_docker_dock(self):
    """Test that VinaGridDNNDocker can dock."""
    current_dir = os.path.dirname(os.path.realpath(__file__))