示例#1
0
    def __getitem__(self, index):
        pocket_pdbqt_file = protein_file
        if os.path.exists(pocket_pdbqt_file):
            pocket = GridPDB(pocket_pdbqt_file)
        else:
            raise Error("Please preprocess PDB files")
            # pocket = GridPDB(pocketfile)

        ligand_pdbqt_file = ligand_file
        if os.path.exists(ligand_pdbqt_file):
            ligand = GridPDB(ligand_pdbqt_file)
        else:
            raise Error("Please preprocess ligand files")
            # ligand = GridPDB(ligandfile)

        sample = {
            'code': '',
            'pdbfile': '',
            'pocket': GridPDB(pocket_pdbqt_file),
            'ligand': GridPDB(ligand_pdbqt_file),
            'channels': [],
            'pose': 1,
            'affinity': 1
        }
        if self.transform:
            sample = self.transform(sample)
        return sample
示例#2
0
def test_smina_type():
    ligfile = 'test/fixtures/4rdn_ligand.pdbqt'
    lig = GridPDB(ligfile)
    atom_data = AtomData()
    ref_atom_types = [4, 4, 4, 4, 14, 7, 6, 10, 6, 10, 6, 6, 10, 6, 8, 2, 4, 13, 2, 13, 2, 4, 13, 2]
    test_atom_types = []
    for i in range(lig.natom):
        data_i = atom_data[lig.atomdata[i]]
        test_atom_types.append(data_i['smina_type'])
    assert ref_atom_types == test_atom_types
示例#3
0
 def run(self):
     lig = GridPDB(self.input().path)
     lig.to_h5(self.output().path)
示例#4
0
 def run(self):
     pdb = GridPDB(self.input().path)
     pdb.to_h5(self.output().path)