Ejemplo n.º 1
0
def get_rotatable_bonds(mol):
    """
  https://github.com/rdkit/rdkit/blob/f4529c910e546af590c56eba01f96e9015c269a6/Code/GraphMol/Descriptors/Lipinski.cpp#L107

  Taken from rdkit source to find which bonds are rotatable store
  rotatable bonds in (from_atom, to_atom)

  Parameters
  ----------
  mol: rdkit Mol
    Ligand molecule

  Returns
  -------
  rotatable_bonds: list
    List of rotatable bonds in molecule
  """
    from rdkit import Chem
    from rdkit.Chem import rdmolops
    pattern = Chem.MolFromSmarts(
        "[!$(*#*)&!D1&!$(C(F)(F)F)&!$(C(Cl)(Cl)Cl)&!$(C(Br)(Br)Br)&!$(C([CH3])("
        "[CH3])[CH3])&!$([CD3](=[N,O,S])-!@[#7,O,S!D1])&!$([#7,O,S!D1]-!@[CD3]="
        "[N,O,S])&!$([CD3](=[N+])-!@[#7!D1])&!$([#7!D1]-!@[CD3]=[N+])]-!@[!$(*#"
        "*)&!D1&!$(C(F)(F)F)&!$(C(Cl)(Cl)Cl)&!$(C(Br)(Br)Br)&!$(C([CH3])([CH3])"
        "[CH3])]")
    rdmolops.FastFindRings(mol)
    rotatable_bonds = mol.GetSubstructMatches(pattern)
    return rotatable_bonds
Ejemplo n.º 2
0
 def _get_rotatable_bonds(self):
     """
 https://github.com/rdkit/rdkit/blob/f4529c910e546af590c56eba01f96e9015c269a6/Code/GraphMol/Descriptors/Lipinski.cpp#L107
 Taken from rdkit source to find which bonds are rotatable
 store rotatable bonds in (from_atom, to_atom)
 """
     pattern = Chem.MolFromSmarts(
         "[!$(*#*)&!D1&!$(C(F)(F)F)&!$(C(Cl)(Cl)Cl)&!$(C(Br)(Br)Br)&!$(C([CH3])("
         "[CH3])[CH3])&!$([CD3](=[N,O,S])-!@[#7,O,S!D1])&!$([#7,O,S!D1]-!@[CD3]="
         "[N,O,S])&!$([CD3](=[N+])-!@[#7!D1])&!$([#7!D1]-!@[CD3]=[N+])]-!@[!$(*#"
         "*)&!D1&!$(C(F)(F)F)&!$(C(Cl)(Cl)Cl)&!$(C(Br)(Br)Br)&!$(C([CH3])([CH3])"
         "[CH3])]")
     rdmolops.FastFindRings(self.mol)
Ejemplo n.º 3
0
def get_rotatable_bonds(mol: RDKitMol) -> List[Tuple[int, int]]:
    """
  https://github.com/rdkit/rdkit/blob/f4529c910e546af590c56eba01f96e9015c269a6/Code/GraphMol/Descriptors/Lipinski.cpp#L107

  Taken from rdkit source to find which bonds are rotatable store
  rotatable bonds in (from_atom, to_atom)

  Parameters
  ----------
  mol: RDKit Mol
    Ligand molecule

  Returns
  -------
  rotatable_bonds: List[List[int, int]]
    List of rotatable bonds in molecule

  Note
  ----
  This function requires RDKit to be installed.
  """
    try:
        from rdkit import Chem
        from rdkit.Chem import rdmolops
    except ModuleNotFoundError:
        raise ValueError("This function requires RDKit to be installed.")

    pattern = Chem.MolFromSmarts(
        "[!$(*#*)&!D1&!$(C(F)(F)F)&!$(C(Cl)(Cl)Cl)&!$(C(Br)(Br)Br)&!$(C([CH3])("
        "[CH3])[CH3])&!$([CD3](=[N,O,S])-!@[#7,O,S!D1])&!$([#7,O,S!D1]-!@[CD3]="
        "[N,O,S])&!$([CD3](=[N+])-!@[#7!D1])&!$([#7!D1]-!@[CD3]=[N+])]-!@[!$(*#"
        "*)&!D1&!$(C(F)(F)F)&!$(C(Cl)(Cl)Cl)&!$(C(Br)(Br)Br)&!$(C([CH3])([CH3])"
        "[CH3])]")
    rdmolops.FastFindRings(mol)
    rotatable_bonds = mol.GetSubstructMatches(pattern)
    return rotatable_bonds