示例#1
0
def force_partial_charge_computation(mol):
    """Force computation of partial charges for molecule.

  Parameters
  ----------
  mol: Rdkit Mol
    Molecule on which we compute partial charges.
  """
    rdkit_util.compute_charges(mol)
示例#2
0
def force_partial_charge_computation(mol):
  """Force computation of partial charges for molecule.

  Parameters
  ----------
  mol: Rdkit Mol
    Molecule on which we compute partial charges.
  """
  rdkit_util.compute_charges(mol)
示例#3
0
  def test_compute_charges(self):
    current_dir = os.path.dirname(os.path.realpath(__file__))
    ligand_file = os.path.join(current_dir, "../../dock/tests/1jld_ligand.sdf")
    xyz, mol = rdkit_util.load_molecule(
        ligand_file, calc_charges=False, add_hydrogens=True)
    rdkit_util.compute_charges(mol)

    has_a_charge = False
    for atom_idx in range(mol.GetNumAtoms()):
      atom = mol.GetAtoms()[atom_idx]
      value = atom.GetProp(str("_GasteigerCharge"))
      if value != 0:
        has_a_charge = True
    assert_true(has_a_charge)
示例#4
0
    def test_compute_charges(self):
        current_dir = os.path.dirname(os.path.realpath(__file__))
        ligand_file = os.path.join(current_dir,
                                   "../../dock/tests/1jld_ligand.sdf")
        xyz, mol = rdkit_util.load_molecule(ligand_file,
                                            calc_charges=False,
                                            add_hydrogens=True)
        rdkit_util.compute_charges(mol)

        has_a_charge = False
        for atom_idx in range(mol.GetNumAtoms()):
            atom = mol.GetAtoms()[atom_idx]
            value = atom.GetProp(str("_GasteigerCharge"))
            if value != 0:
                has_a_charge = True
        assert has_a_charge