def test_add_hydrogens_to_mol(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=False) original_hydrogen_count = 0 for atom_idx in range(mol.GetNumAtoms()): atom = mol.GetAtoms()[atom_idx] if atom.GetAtomicNum() == 1: original_hydrogen_count += 1 mol = rdkit_util.add_hydrogens_to_mol(mol) after_hydrogen_count = 0 for atom_idx in range(mol.GetNumAtoms()): atom = mol.GetAtoms()[atom_idx] if atom.GetAtomicNum() == 1: after_hydrogen_count += 1 assert_true(after_hydrogen_count >= original_hydrogen_count)
def test_add_hydrogens_to_mol(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=False) original_hydrogen_count = 0 for atom_idx in range(mol.GetNumAtoms()): atom = mol.GetAtoms()[atom_idx] if atom.GetAtomicNum() == 1: original_hydrogen_count += 1 mol = rdkit_util.add_hydrogens_to_mol(mol) after_hydrogen_count = 0 for atom_idx in range(mol.GetNumAtoms()): atom = mol.GetAtoms()[atom_idx] if atom.GetAtomicNum() == 1: after_hydrogen_count += 1 assert_true(after_hydrogen_count >= original_hydrogen_count)