def __init__(self): super(self.__class__, self).__init__(description=__doc__) # handle command line arguments self.add_argument( 'path', help='path to working directory' ) self.add_argument( 'pdb', help='PDB code for target' ) self.add_argument( 'chemical_id', help='PDB code for target' ) self.add_argument( '-hs', '--hotspot_guided', default=True, help='Use Hotspot insights to guide docking' ) self.args = self.parse_args() # create temp for output files self.temp = tempfile.mkdtemp() # calculate hotspot using Hotspots API if self.args.hotspot_guided is True: try: self.hr = hs_io.HotspotReader(path=os.path.join(self.args.path, "out.zip")).read() except IOError: h = calculation.Runner() settings = h.Settings() settings.nrotations = 3000 settings.sphere_maps = True self.hr = h.from_pdb(pdb_code=self.args.pdb, charged_probes=True, buriedness_method='ghecom', nprocesses=5, settings=settings) with hs_io.HotspotWriter(path=os.path.join(self.args.path), zip_results=True) as hw: hw.write(self.hr) # generate molecule for docking self.search_ligands = os.path.join(self.temp, self.args.chemical_id + ".mol2") self.ligand = self.from_smiles(smiles=_Ligand.from_chemicalid(chemicalid=self.args.chemical_id).smiles, path=self.search_ligands, identifier=self.args.chemical_id) # dock search ligands into hotspot protein self.docked_ligands = self.dock() if self.args.hotspot_guided is True: self.rescored_ligands = self.rescore()
def calc_hr(self): """ runs the hotspot calculation and returns a `hotspots.calculation.Result` :return: `hotspots.calculation.Result` """ h = calculation.Runner() settings = calculation.Runner.Settings(sphere_maps=True) cavs = Cavity.from_pdb_file(self._hs_fname) return h.from_protein(protein=self.protein, charged_probes=True, buriedness_method='ghecom', cavities=cavs, nprocesses=5, settings=settings)
from hotspots import calculation from hotspots.hs_io import HotspotWriter r = calculation.Runner() result = r.from_pdb("3cqw", charged_probes=False, nprocesses=3) with HotspotWriter("/home/pcurran/New folder/akt1/protoss") as w: w.write(result) print set([len(a.neighbours) for a in result.protein.atoms])