Commit a8565122 authored by Bharath Ramsundar's avatar Bharath Ramsundar
Browse files

Partial python 3 fixes.

parent 384ca30d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
"""
Basic molecular features.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals

__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "BSD 3-clause"
__license__ = "LGPL v2.1+"

from rdkit.Chem import Descriptors

from deepchem.featurizers import Featurizer


+4 −3
Original line number Diff line number Diff line
@@ -3,15 +3,16 @@ Generate coulomb matrices for molecules.

See Montavon et al., _New Journal of Physics_ __15__ (2013) 095003.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals

__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "BSD 3-clause"
__license__ = "LGPL v2.1+"

import numpy as np

from rdkit import Chem

from deepchem.featurizers import Featurizer
from deepchem.utils import pad_array

+4 −2
Original line number Diff line number Diff line
"""
Topological fingerprints.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals

__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "BSD 3-clause"
__license__ = "LGPL v2.1+"

from rdkit import Chem
from rdkit.Chem import rdMolDescriptors

from deepchem.featurizers import Featurizer


+3 −9
Original line number Diff line number Diff line
"""
The following code implements a featurizer based on NNScore 2.0.1

## The following notice is copied from the original NNScore file.
# NNScore 2.01 is released under the GNU General Public License (see
# http://www.gnu.org/licenses/gpl.html).
# If you have any questions, comments, or suggestions, please don't
# hesitate to contact me, Jacob Durrant, at jdurrant [at] ucsd [dot]
# edu. If you use NNScore 2.01 in your work, please cite [REFERENCE
# HERE].
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import math
import re
@@ -368,7 +363,6 @@ def compute_hydrogen_bonds(ligand, receptor):
                  < H_BOND_DIST):
                hydrogens.append(atom)

          #print "nearby hydrogens: " + str(hydrogens)
          # now we need to check the angles
          # TODO(rbharath): Rather than using this heuristic, it seems like
          # it might be better to just report the angle in the feature
+5 −21
Original line number Diff line number Diff line
"""
Custom PDB class implementation.

The code below contains heavily modified parts of Jacob Durrant's
NNScore 2.0.1. The following notice is copied from the original NNScore
file:
# NNScore 2.01 is released under the GNU General Public License (see
# http://www.gnu.org/licenses/gpl.html).
# If you have any questions, comments, or suggestions, please don't
# hesitate to contact me, Jacob Durrant, at jdurrant [at] ucsd [dot]
# edu. If you use NNScore 2.01 in your work, please cite [REFERENCE
# HERE].
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import ast
import math
import textwrap
@@ -89,8 +82,8 @@ def print_warning(atom, residue, need):
          'active site, this warning may not affect the NNScore.')
  lines = textwrap.wrap(text, 80)
  for line in lines:
    print line
  print
    print(line)
  print()


def bond_length(element1, element2):
@@ -187,11 +180,6 @@ class MultiStructure(object):

  def _separate_into_models(self, lines, noisy):
    """Separate lines into a list of models."""
    if noisy:
      print "len(lines)"
      print len(lines)
      for line in lines:
        print line
    models = []
    current = None
    for line in lines:
@@ -203,9 +191,6 @@ class MultiStructure(object):
        current = None
      elif current is not None:
        current.append(line)
    if noisy:
      print "len(models)"
      print len(models)
    return models

  def load_from_files(self, pdb_filename, pdbqt_filename):
@@ -1403,7 +1388,6 @@ class PDB(object):
    """
    # first, we need to know what residues are available
    resids = []
    #print self.get_residues()
    for key in self.get_residues():
      _, resnum, chain = key.split("_")
      resids.append(resnum + "_" + chain)
Loading