Exemplo n.º 1
0
 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")
   xyz, mol = rdkit_util.load_molecule(
       ligand_file, calc_charges=False, add_hydrogens=False)
   merged = rdkit_util.merge_molecules_xyz(xyz, xyz)
   for i in range(len(xyz)):
     first_atom_equal = np.all(xyz[i] == merged[i])
     second_atom_equal = np.all(xyz[i] == merged[i + len(xyz)])
     assert_true(first_atom_equal)
     assert_true(second_atom_equal)
Exemplo n.º 2
0
 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")
     xyz, mol = rdkit_util.load_molecule(ligand_file,
                                         calc_charges=False,
                                         add_hydrogens=False)
     merged = rdkit_util.merge_molecules_xyz([xyz, xyz])
     for i in range(len(xyz)):
         first_atom_equal = np.all(xyz[i] == merged[i])
         second_atom_equal = np.all(xyz[i] == merged[i + len(xyz)])
         assert first_atom_equal
         assert second_atom_equal
Exemplo n.º 3
0
  def _featurize_complex(self, mol_pdb_file, protein_pdb_file):
    """
    Compute neighbor list for complex.

    Parameters
    ----------
    mol_pdb: list
      Should be a list of lines of the PDB file.
    complex_pdb: list
      Should be a list of lines of the PDB file.
    """
    mol_coords, ob_mol = rdkit_util.load_molecule(mol_pdb_file)
    protein_coords, protein_mol = rdkit_util.load_molecule(protein_pdb_file)
    system_coords = rdkit_util.merge_molecules_xyz(mol_coords, protein_coords)

    system_neighbor_list = compute_neighbor_list(
        system_coords, self.neighbor_cutoff, self.max_num_neighbors, None)

    return (system_coords, system_neighbor_list)
Exemplo n.º 4
0
  def _featurize_complex(self, mol_pdb_file, protein_pdb_file):
    """
    Compute neighbor list for complex.

    Parameters
    ----------
    mol_pdb_file: Str 
      Filename for ligand pdb file. 
    protein_pdb_file: Str 
      Filename for protein pdb file. 
    """
    mol_coords, ob_mol = rdkit_util.load_molecule(mol_pdb_file)
    protein_coords, protein_mol = rdkit_util.load_molecule(protein_pdb_file)
    system_coords = rdkit_util.merge_molecules_xyz([mol_coords, protein_coords])

    system_neighbor_list = compute_neighbor_list(
        system_coords, self.neighbor_cutoff, self.max_num_neighbors, None)

    return (system_coords, system_neighbor_list)
Exemplo n.º 5
0
  def _featurize_complex(self, mol_pdb_file, protein_pdb_file):
    """
    Compute neighbor list for complex.

    Parameters
    ----------
    mol_pdb: list
      Should be a list of lines of the PDB file.
    complex_pdb: list
      Should be a list of lines of the PDB file.
    """
    mol_coords, ob_mol = rdkit_util.load_molecule(mol_pdb_file)
    protein_coords, protein_mol = rdkit_util.load_molecule(protein_pdb_file)
    system_coords = rdkit_util.merge_molecules_xyz(mol_coords, protein_coords)

    system_neighbor_list = compute_neighbor_list(
        system_coords, self.neighbor_cutoff, self.max_num_neighbors, None)

    return (system_coords, system_neighbor_list)