def _postAddPrep(mols, addCharges=False, gaffType=True, nogui=False, chargeModel=None, method=None, **kw): if addCharges: from AddCharge import initiateAddCharges initiateAddCharges(models=mols, status=replyobj.status, gaffType=gaffType, chargeModel=chargeModel, nogui=nogui, method=method, cb=lambda ur, uc, m=mols, kw=kw: _chargeCB(ur, uc, m, **kw)) else: _postAddCharge(mols, **kw)
def addcharge(molecule): AMBER99SB = "AMBER ff99SB" AMBER99bsc0 = "AMBER ff99bsc0" AMBER02pol_r1 = "AMBER ff02pol.r1" AMBER03ua = "AMBER ff03ua" AMBER03_r1 = "AMBER ff03.r1" AMBER12SB = "AMBER ff12SB" try: initiateAddCharges(models=molecule, method='am1-bcc', nogui=True, chargeModel=AMBER12SB) return molecule except KeyboardInterrupt: print 'Stop by user' sys.exit() except: return None
def _postAddPrep(mols, addCharges=False, gaffType=True, nogui=False, chargeModel=None, method=None, **kw): if addCharges: from AddCharge import initiateAddCharges initiateAddCharges( models=mols, status=replyobj.status, gaffType=gaffType, chargeModel=chargeModel, nogui=nogui, method=method, cb=lambda ur, uc, m=mols, kw=kw: _chargeCB(ur, uc, m, **kw)) else: _postAddCharge(mols, **kw)
def Apply(self): from AddCharge import initiateAddCharges from AddH.gui import checkNoHyds mols = self.molList.getvalue() chargeModel = self.chargeModel.getvalue() chargeMethod = self.chargeMethod.getvalue() checkNoHyds(mols, lambda mols=mols: initiateAddCharges( cb=self.cb, models=mols, chargeModel=chargeModel, method=chargeMethod, status=chimera.replyobj.status, labelStandard=self.labelStandardVar.get(), labelNonstandard=self.labelNonstandardVar.get()), self.process)
#!/usr/bin/env python import sys import os import chimera from chimera import runCommand from AddCharge import initiateAddCharges initiateAddCharges(method='am1-bcc', nogui=True) #use: chimera --nogui --script drreposer_run_vina.py OR open with UCSF Chimera #Have to install Chimera first #prepare ligand molecule for docking - ligand derived from complexes #e.g. 1sn0 - protein-drug complex #e.g. 602.B - drug molecule runCommand( 'open 1sn0; sel :602.B; sel invert; del sel; del solvent; del ions; wait') runCommand( 'swapaa same sel preserve true ignoreOtherModels true; addh; addcharge s; wait' ) #save files to current directory runCommand('write format mol2 0 predictedbs.ligand.mol2; wait') #prepare receptor structure for docking - give a pdb id and only select the first model in the case of nmr structure #e.g 2k0z - protein to be search for its potential of binding to ligand runCommand( 'open 2k0z; del #1.2-100; sel protein; sel invert sel; del sel; del solvent; del ions; wait' ) runCommand( 'swapaa same sel preserve true ignoreOtherModels true; addh; addcharge s; wait' ) #save files to current directory runCommand('write format mol2 1 predictedbs.receptor.mol2; wait')
for fn in file_names: #Open the file and extract the first line which contains the name of the molecule with open(fn) as myfile: head = [next(myfile) for x in xrange(1)] #------------------------------------------------------------------ # Processing the molecule using Chimera #------------------------------------------------------------------ #Open the file in Chimera rc("open " + fn) #Add Gasteiger charges initiateAddCharges(method='gasteiger', nogui=True) rc('surface vertexDensity 2') # Add surface to molecule rc('coulombic -10 red 0 white 10 blue' ) # Colr surface by coulombic charge rc( 'select' ) # Select the molecule from the model panel, also selects the surface for processing #------------------------------------------------------------------ # Surface processing #------------------------------------------------------------------ #Surface processing section slist = [m for m in selection.currentGraphs() if isinstance(m, MSMSModel) ] # initiates selected surface to object vertices = [] # empty list to populate with vertices s = slist[0] # takes the surface from the surface object