Commit 6c0f41d5 authored by Bharath Ramsundar's avatar Bharath Ramsundar
Browse files

Fix rebase issue

parent 41654ab3
Loading
Loading
Loading
Loading
+1 −27
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ class TestRdkitUtil(unittest.TestCase):
      atom = mol.GetAtoms()[atom_idx]
      if atom.GetAtomicNum() == 1:
        after_hydrogen_count += 1
    assert_true(after_hydrogen_count >= original_hydrogen_count)
    assert after_hydrogen_count >= original_hydrogen_count

  def test_compute_charges(self):
    current_dir = os.path.dirname(os.path.realpath(__file__))
@@ -132,32 +132,6 @@ class TestRdkitUtil(unittest.TestCase):
      atom2 = mol.GetAtoms()[atom_idx]
      assert atom1.GetAtomicNum() == atom2.GetAtomicNum()

  def test_pdbqt_to_pdb(self):
    current_dir = os.path.dirname(os.path.realpath(__file__))
    protein_file = os.path.join(current_dir,
                                "../../dock/tests/1jld_protein.pdb")
    xyz, mol = rdkit_util.load_molecule(
        protein_file, calc_charges=False, add_hydrogens=False)
    with tempfile.TemporaryDirectory() as tmp:
      out_pdb = os.path.join(tmp, "mol.pdb")
      out_pdbqt = os.path.join(tmp, "mol.pdbqt")

      rdkit_util.write_molecule(mol, out_pdb)
      rdkit_util.write_molecule(mol, out_pdbqt, is_protein=True)

      pdb_block = rdkit_util.pdbqt_to_pdb(out_pdbqt)
      from rdkit import Chem
      pdb_mol = Chem.MolFromPDBBlock(pdb_block, sanitize=False, removeHs=False)

      xyz, pdbqt_mol = rdkit_util.load_molecule(
          out_pdbqt, add_hydrogens=False, calc_charges=False)

    assert pdb_mol.GetNumAtoms() == pdbqt_mol.GetNumAtoms()
    for atom_idx in range(pdb_mol.GetNumAtoms()):
      atom1 = pdb_mol.GetAtoms()[atom_idx]
      atom2 = pdbqt_mol.GetAtoms()[atom_idx]
      assert atom1.GetAtomicNum() == atom2.GetAtomicNum()

  def test_merge_molecules_xyz(self):
    current_dir = os.path.dirname(os.path.realpath(__file__))
    ligand_file = os.path.join(current_dir, "../../dock/tests/1jld_ligand.sdf")