Commit 8bfa5990 authored by Bharath Ramsundar's avatar Bharath Ramsundar
Browse files

Remove verbose and adjust featurizing classes

parent 39d93bb9
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
"""
Generate coulomb matrices for molecules.

See Montavon et al., _New Journal of Physics_ __15__ (2013) 095003.
"""
import numpy as np
import deepchem as dc
+8 −1
Original line number Diff line number Diff line
"""
Implements featurizations for GraphConv and Weave Models.
"""
import numpy as np
import deepchem as dc
from deepchem.feat.base_classes import MolecularFeaturizer
@@ -6,6 +9,8 @@ from deepchem.feat.mol_graphs import ConvMol, WeaveMol
from deepchem.data import DiskDataset
import logging

logger = logging.getLogger(__name__)


def one_of_k_encoding(x, allowable_set):
  """Encodes elements of a provided set as integers.
@@ -273,7 +278,9 @@ def atom_features(atom,
                  use_chirality=False):
  """Helper method used to compute per-atom feature vectors.

  Many different featurization methods compute per-atom features such as ConvMolFeaturizer, WeaveFeaturizer. This method computes such features.
  Many different featurization methods compute per-atom features
  such as ConvMolFeaturizer, WeaveFeaturizer. This method
  computes such features.

  Parameters
  ----------
+3 −0
Original line number Diff line number Diff line
@@ -6,9 +6,12 @@ __copyright__ = "Copyright 2016, Stanford University"
__license__ = "MIT"

import csv
import logging
import random
import numpy as np

logger = logging.getLogger(__name__)


def cumulative_sum_minus_last(l, offset=0):
  """Returns cumulative sums for set of counts, removing last entry.
+5 −0
Original line number Diff line number Diff line
"""
Implements a simple one hot encoder for text models.
"""
import numpy as np
from deepchem.feat.base_classes import MolecularFeaturizer

logger = logging.getLogger(__name__)

zinc_charset = [
    ' ', '#', ')', '(', '+', '-', '/', '1', '3', '2', '5', '4', '7', '6', '8',
    '=', '@', 'C', 'B', 'F', 'I', 'H', 'O', 'N', 'S', '[', ']', '\\', 'c', 'l',
+12 −2
Original line number Diff line number Diff line
"""
Encodes smiles/smarts as RDKIT objects directly.
"""
from deepchem.feat.base_classes import MolecularFeaturizer

import logging
from deepchem.feat import MolecularFeaturizer
from deepchem.feat import ReactionFeaturizer


class RawFeaturizer(MolecularFeaturizer):
  """Encodes a molecule as a SMILES string or RDKit mol.
@@ -45,10 +52,13 @@ class RawFeaturizer(MolecularFeaturizer):
    else:
      return mol

class RawReactionFeaturizer(Featurizer):

class RawReactionFeaturizer(ReactionFeaturizer):
  """Featurize SMARTS as RDKit Reaction objects.

  This featurizer uses RDKit's `rdkit.Chem.rdChemReactions.ReactionFromSmarts` to parse in input SMARTS strings.
  This featurizer uses RDKit's
  `rdkit.Chem.rdChemReactions.ReactionFromSmarts` to parse in
  input SMARTS strings which encode reactions.
  """

  def __init__(self, smarts=True):
Loading