Commit 0e42add6 authored by nd-02110114's avatar nd-02110114
Browse files

📝 fix RDKit Mol -> rdkit.Chem.rdchem.Mol

parent e525f10e
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -66,13 +66,13 @@ class ConformerGenerator(object):

    Parameters
    ----------
    mol: RDKit Mol
    mol: rdkit.Chem.rdchem.Mol
      RDKit Mol object

    Returns
    -------
    mol: RDKit Mol
      A new RDKit Mol containing the chosen conformers, sorted by
    mol: rdkit.Chem.rdchem.Mol
      A new RDKit Mol object containing the chosen conformers, sorted by
      increasing energy.
    """
    return self.generate_conformers(mol)
@@ -86,13 +86,13 @@ class ConformerGenerator(object):

    Parameters
    ----------
    mol: RDKit Mol
    mol: rdkit.Chem.rdchem.Mol
      RDKit Mol object

    Returns
    -------
    mol: RDKit Mol
      A new RDKit Mol containing the chosen conformers, sorted by
    mol: rdkit.Chem.rdchem.Mol
      A new RDKit Mol object containing the chosen conformers, sorted by
      increasing energy.
    """

@@ -119,12 +119,12 @@ class ConformerGenerator(object):

    Parameters
    ----------
    mol: RDKit Mol
    mol: rdkit.Chem.rdchem.Mol
      RDKit Mol object

    Returns
    -------
    mol: RDKit Mol
    mol: rdkit.Chem.rdchem.Mol
      RDKit Mol object with embedded multiple conformers.
    """
    try:
@@ -147,7 +147,7 @@ class ConformerGenerator(object):

    Parameters
    ----------
    mol: RDKit Mol
    mol: rdkit.Chem.rdchem.Mol
      RDKit Mol object with embedded conformers.
    conf_id : int, optional
      ID of the conformer to associate with the force field.
@@ -183,7 +183,7 @@ class ConformerGenerator(object):

    Parameters
    ----------
    mol: RDKit Mol
    mol: rdkit.Chem.rdchem.Mol
      RDKit Mol object with embedded conformers.
    """
    for conf in mol.GetConformers():
@@ -196,7 +196,7 @@ class ConformerGenerator(object):

    Parameters
    ----------
    mol: RDKit Mol
    mol: rdkit.Chem.rdchem.Mol
      RDKit Mol object with embedded conformers.

    Returns
@@ -219,13 +219,13 @@ class ConformerGenerator(object):

    Parameters
    ----------
    mol: RDKit Mol
    mol: rdkit.Chem.rdchem.Mol
      RDKit Mol object

    Returns
    -------
    new_mol: RDKit Mol
      A new RDKit Mol containing the chosen conformers, sorted by
    new_mol: rdkit.Chem.rdchem.Mol
      A new rdkit.Chem.rdchem.Mol containing the chosen conformers, sorted by
      increasing energy.
    """
    try:
@@ -278,7 +278,7 @@ class ConformerGenerator(object):

    Parameters
    ----------
    mol: RDKit Mol
    mol: rdkit.Chem.rdchem.Mol
      RDKit Mol object

    Returns
+5 −5
Original line number Diff line number Diff line
@@ -366,10 +366,10 @@ def get_face_boxes(coords: np.ndarray, pad: float = 5.0) -> List[CoordinateBox]:
    x_min, x_max = int(np.floor(x_min)) - pad, int(np.ceil(x_max)) + pad
    x_bounds = (x_min, x_max)

    y_min, y_max = np.amin(points[:, 1]), np.amax(points[:, 1])
    y_min, y_max = np.amin(y_coords), np.amax(y_coords)
    y_min, y_max = int(np.floor(y_min)) - pad, int(np.ceil(y_max)) + pad
    y_bounds = (y_min, y_max)
    z_min, z_max = np.amin(points[:, 2]), np.amax(points[:, 2])
    z_min, z_max = np.amin(z_coords), np.amax(z_coords)
    z_min, z_max = int(np.floor(z_min)) - pad, int(np.ceil(z_max)) + pad
    z_bounds = (z_min, z_max)
    box = CoordinateBox(x_bounds, y_bounds, z_bounds)
+8 −8
Original line number Diff line number Diff line
"""A collection of utilities for dealing with Molecular Fragments"""
import itertools
import numpy as np
from typing import Any, List, Iterable, Optional, Sequence, Set, Tuple, Union
from typing import List, Optional, Sequence, Set, Tuple, Union

from deepchem.utils.typing import RDKitAtom, RDKitMol
from deepchem.utils.geometry_utils import compute_pairwise_distances
@@ -209,7 +209,7 @@ def get_mol_subset(
  ----------
  coords: np.ndarray
    Must be of shape (N, 3) and correspond to coordinates of mol.
  mol: RDKit Mol or MolecularFragment
  mol: rdkit.Chem.rdchem.Mol or MolecularFragment
    The molecule to strip
  atom_indices_to_keep: list
    List of the indices of the atoms to keep. Each index is a unique
@@ -252,7 +252,7 @@ def strip_hydrogens(coords: np.ndarray, mol: Union[RDKitMol, MolecularFragment]
  ----------
  coords: np.ndarray
    The coords must be of shape (N, 3) and correspond to coordinates of mol.
  mol: RDKit Mol or MolecularFragment
  mol: rdkit.Chem.rdchem.Mol or MolecularFragment
    The molecule to strip

  Returns
@@ -288,7 +288,7 @@ def get_contact_atom_indices(fragments: List[Tuple[np.ndarray, RDKitMol]],

  Parameters
  ----------
  fragments: List[Tuple[np.ndarray, RDKit Mol]]
  fragments: List[Tuple[np.ndarray, rdkit.Chem.rdchem.Mol]]
    As returned by `rdkit_utils.load_complex`, a list of tuples of
    `(coords, mol)` where `coords` is a `(N_atoms, 3)` array and `mol`
    is the rdkit molecule object.
@@ -335,7 +335,7 @@ def reduce_molecular_complex_to_contacts(

  Parameters
  ----------
  fragments: List[Tuple[np.ndarray, RDKit Mol]]
  fragments: List[Tuple[np.ndarray, rdkit.Chem.rdchem.Mol]]
    As returned by `rdkit_utils.load_complex`, a list of tuples of
    `(coords, mol)` where `coords` is a `(N_atoms, 3)` array and `mol`
    is the rdkit molecule object.
+10 −10
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ def convert_protein_to_pdbqt(mol: RDKitMol, outfile: str) -> None:

  Parameters
  ----------
  mol: RDKit Mol
  mol: rdkit.Chem.rdchem.Mol
    Protein molecule
  outfile: str
    filename which already has a valid pdb representation of mol
@@ -68,14 +68,14 @@ def convert_protein_to_pdbqt(mol: RDKitMol, outfile: str) -> None:


def mol_to_graph(mol: RDKitMol):
  """Convert RDKit Mol to NetworkX graph
  """Convert rdkit.Chem.rdchem.Mol to NetworkX graph

  Convert mol into a graph representation atoms are nodes, and bonds
  are vertices stored as graph

  Parameters
  ----------
  mol: RDKit Mol
  mol: rdkit.Chem.rdchem.Mol
    The molecule to convert into a graph.

  Returns
@@ -111,7 +111,7 @@ def get_rotatable_bonds(mol: RDKitMol) -> List[Tuple[int, int]]:

  Parameters
  ----------
  mol: RDKit Mol
  mol: rdkit.Chem.rdchem.Mol
    Ligand molecule

  Returns
@@ -148,7 +148,7 @@ def convert_mol_to_pdbqt(mol: RDKitMol, outfile: str) -> None:

  Parameters
  ----------
  mol: RDKit Mol
  mol: rdkit.Chem.rdchem.Mol
    The molecule whose value is stored in pdb format in outfile
  outfile: str
    Filename for a valid pdb file with the extention .pdbqt
@@ -245,8 +245,8 @@ def _create_component_map(mol: RDKitMol,

  Parameters
  ----------
  mol: RDKit Mol
    molecule to find disconnected compontents in 
  mol: rdkit.Chem.rdchem.Mol
    The molecule to find disconnected components in
  components: List[List[int]]
    List of connected components

@@ -348,4 +348,4 @@ def _valid_bond(used_partitions: Set[int], bond: Tuple[int, int],
    next_partition = part2
  else:
    next_partition = part1
  return not next_partition in used_partitions, next_partition
  return next_partition not in used_partitions, next_partition
+2 −2
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ def load_docked_ligands(

  Returns
  -------
  Tuple[List[RDKit Mol], List[float]]
  Tuple[List[rdkit.Chem.rdchem.Mol], List[float]]
    Tuple of `molecules, scores`. `molecules` is a list of rdkit
    molecules with 3D information. `scores` is the associated vina
    score.
Loading