def get_energy_breakdown(receptor_atoms, ligand_atoms, c):
    ms = MolecularSystem()
    ms.add_entities(receptor_atoms)
    ms.add_entities(ligand_atoms)
    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
Beispiel #2
0
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 = AutoDock305Scorer()
    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
Beispiel #3
0
 if print_best_only:
     clust0 = d.clusterer.clustering_dict[rms_tolerance][0]
     c = clust0[0]
     #find the filename of the best result
     #for k in d.dlo_list:
     #    if c in k.conformations:
     #        dlo_filename = os.path.splitext(k.parser.filename)[0]
     #        print "set dlo_filename to ", dlo_filename
     #        ostr = dlo_filename + ", "
     #        fptr.write(ostr)
     score_list = []
     #update the coords if you need to
     if build_hydrogen_bonds or report_energy_breakdown:
         d.ch.set_conformation(c)
     if report_energy_breakdown:
         ms.set_coords(1, c.getCoords()[:])
         score_list = adscorer.get_score_per_term()
         total_score = Numeric.add.reduce(score_list) + c.internal_energy + tors_penalty
         #total_score = Numeric.add.reduce(score_list)
     ostr = "% 4d, % 4d, % 12.4f, % 6.4f, % 8.6e,% 9.6f" %(len(d.clusterer.data), len(clust0),  c.binding_energy, c.getRMSD(ref_coords), c.Ki, c.internal_energy)
     if build_hydrogen_bonds:
         atDict = hbondBuilder.build(receptor.allAtoms, ligMol.allAtoms)
         num_hbonds = len(atDict)
         ostr = ostr + ", % 2d" %(num_hbonds)
     if report_energy_breakdown:
         ostr = ostr + ", % 12.4f" %total_score
         #for score in score_list:
         #    ostr = ostr + ", % 12.4f" %score
         ostr = ostr + ", % 6.4f, % 12.4f, % 12.4f,% 6.4f," %(score_list[0],
                     score_list[1], score_list[2], score_list[3])
     #add the number of atoms and the number of active torsions in the ligand