def __init__(self,atomset1,atomset2): """ """ EnergyScorer.__init__(self,atomset1,atomset2) self.weight = None self.weightLabel = None self.scorer = AutoDock4Scorer() self.prop = self.scorer.prop self.r = self.ms.add_entities(atomset1) self.l = self.ms.add_entities(atomset2) self.scorer.set_molecular_system(self.ms)
def get_energy_breakdown(receptor_atoms, ligand_atoms, coords_to_use): ms = MolecularSystem() ms.add_entities(receptor_atoms) ms.add_entities(ligand_atoms) ms.set_coords(1, coords_to_use) #ms.set_coords(1, c.getCoords()[:]) ad_scorer = AutoDock4Scorer() ad_scorer.set_molecular_system(ms) score_list = ad_scorer.get_score_per_term() ostr = "" for score in score_list: ostr = ostr + "% 8.4f," % score return ostr
cl.make_clustering(rms_tolerance) ref_coords = cl.clustering_dict[rms_tolerance][0][0].getCoords()[:] # for building hydrogen bonds or reporting energy breakdown # setup receptor: if build_hydrogen_bonds or report_energy_breakdown: ligMol.buildBondsByDistance() receptor = Read(receptor_filename)[0] receptor.buildBondsByDistance() if build_hydrogen_bonds: hbondBuilder = HydrogenBondBuilder() if report_energy_breakdown: ms = MolecularSystem() ms.add_entities(receptor.allAtoms) ms.add_entities(ligMol.allAtoms) adscorer = AutoDock4Scorer() adscorer.set_molecular_system(ms) mode = 'w' if append_to_outputfile: mode = 'a' fptr = open(outputfilename, mode) if mode=='w': if build_hydrogen_bonds and report_energy_breakdown: titles = "#clust binding_nrg rmsd_v_0 Ki int_nrg hbnds sum_py_nrg estat_nrg hbnd_nrg vdw_nrg dsolv_nrg#ats #t\n" elif build_hydrogen_bonds: titles = "#clust binding_nrg rmsd_v_0 Ki int_nrg hbnds #ats #t\n" elif report_energy_breakdown: titles = "#clust binding_nrg rmsd_v_0 Ki int_nrg sum_py_nrg estat_nrg hbnd_nrg vdw_nrg dsolv_nrg#ats #t\n" else: titles = "#clust binding_nrg rmsd_v_0 Ki int_nrg #ats #t\n"
mode = 'w' first = True if append_to_outputfile: mode = 'a' first = not os.path.exists(outputfilename) if verbose: print 'first is ', first optr = open(outputfilename, mode) if first: tstr = "RECEPTOR_LIGAND #ESTAT #HB #VDW #DSOLV #TORSDOF #ATS #TORS\n" optr.write(tstr) #get the scores ms = MolecularSystem() ms.add_entities(receptor.allAtoms) ms.add_entities(ligand.allAtoms) if use_autodock40_weights: ad_scorer = AutoDock4Scorer() else: ad_scorer = AutoDock41Scorer() ad_scorer.set_molecular_system(ms) score_list = ad_scorer.get_score_per_term() ostr = "%8s_%6s," % (receptor.name, ligand.name) for score in score_list: ostr = ostr + " % 8.4f," % score ostr = ostr + " % 8d," % ligand.TORSDOF ostr = ostr + " % 8d," % len(ligand.allAtoms) ostr = ostr + " % 8d," % len(ligand.torTree.torsionMap) ostr = ostr + "\n" optr.write(ostr) optr.close() if verbose: print 'wrote %s' % outputfilename