Example #1
0
    def __init__(self,atomset1,atomset2):
        """ """        
        EnergyScorer.__init__(self,atomset1,atomset2)
        self.weight = None
        self.weightLabel = None

        self.scorer = AutoDock305Scorer()
        self.prop = self.scorer.prop
        
        bothAts = atomset1 + atomset2
        for a in bothAts:
            if a.parent.type + '_' + a.name in pep_aromList:
                a.autodock_element=='A'
                a.AtSolPar = .1027
            elif a.autodock_element=='A':
                a.AtSolPar = .1027
            elif a.autodock_element=='C':
                a.AtSolPar = .6844
            else:
                a.AtSolPar = 0.0        


        self.r = self.ms.add_entities(atomset1) 
        self.l = self.ms.add_entities(atomset2) 
        self.scorer.set_molecular_system(self.ms)    
Example #2
0
    def setUp(self):
        # setup MolecularSystem
        self.setup_hsg1_ind()  # defines self.ms, self.hsg1, self.ind

        # setup Scorer and get the (atom-atom) score_array
        self.ads = AutoDock305Scorer()
        self.ads.set_molecular_system(self.ms)
Example #3
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
Example #4
0
    if build_hydrogen_bonds or report_energy_breakdown:
        d.ligMol.buildBondsByDistance()
        receptor_filename = directory + '/' + receptor_filename
        receptor = Read(receptor_filename)[0]
        receptor.buildBondsByDistance()
    if build_hydrogen_bonds:
        hbondBuilder = HydrogenBondBuilder()
        #do next two lines for each conf
        #d.ligMol.set_conformation(conf)
        #atDict = hbondBuilder.build(receptor.allAtoms, d.ligMol.allAtoms)
        #num_hbonds= len(atDict)
    if report_energy_breakdown:
        ms = MolecularSystem()
        ms.add_entities(receptor.allAtoms)
        ms.add_entities(d.ligMol.allAtoms)
        ad305scorer = AutoDock305Scorer()
        ad305scorer.set_molecular_system(ms)
        #whenever the ligMol changes conf,
        #need to call ms.set_coords(1, new_coords)

    mode = 'w'
    first = True
    if append_to_outputfile:
        mode = 'a'
        first = not os.path.exists(outputfilename)
    fptr = open(outputfilename, mode)
    num_clusters = len(d.clusterer.clustering_dict[rms_tolerance])
    #output a header if file opened with mode 'w' or if this is first use of outputfile...
    if verbose: print("first is ", first)
    if first:
        tstr = ""