def calcOneStructure(loopInfo): """ this function calculates a single structure, performs analysis on the structure, and then writes out a pdb file, with remarks. """ # initialize parameters for high temp dynamics. InitialParams(rampedParams) # high-temp dynamics setup - only need to specify parameters which # differfrom initial values in rampedParams InitialParams(highTempParams) # high temp dynamics # protocol.initDynamics( dyn, potList=potList, # potential terms to use bathTemp=init_t, initVelocities=1, finalTime=10, # stops at 10ps or 5000 steps numSteps=5000, # whichever comes first printInterval=100) dyn.setETolerance(init_t / 100) #used to det. stepsize. default: t/1000 dyn.run() # initialize parameters for cooling loop InitialParams(rampedParams) # initialize integrator for simulated annealing # protocol.initDynamics( dyn, potList=potList, numSteps=100, #at each temp: 100 steps or finalTime=.2, # .2ps, whichever is less printInterval=100) # perform simulated annealing # cool.run() # final torsion angle minimization # protocol.initMinimize(dyn, printInterval=50) dyn.run() # final all- atom minimization # protocol.initMinimize(minc, potList=potList, dEPred=10) minc.run() #do analysis and write structure when this function returns toIUPAC() from simulationTools import analyze protocol.writeCIF(loopInfo.filename() + ".cif", remarks=analyze(potList)) fromIUPAC() pass
def setUp(self): ensembleSize=3 esim = EnsembleSimulation("ensemble",ensembleSize) print "ensemble size", esim.size(),"running on",esim.numThreads(),"processors." dyn = ivm.IVM(esim) protocol.torsionTopology(dyn) potList = PotList("test pot list") pot = PyEnsemblePot('test ensemble pot') potList.append(pot) protocol.initDynamics(dyn, bathTemp=400, initVelocities=1, potList=potList, finalTime=1, numSteps=1, printInterval=0) dyn.run()
def calcOneStructure(loopInfo): """ this function calculates a single structure, performs analysis on the structure, and then writes out a pdb file, with remarks. """ # generate a new structure with randomized torsion angles # from monteCarlo import randomizeTorsions randomizeTorsions(dyn) # set torsion angles from restraints # from torsionTools import setTorsionsFromTable setTorsionsFromTable( dihedralRestraintFilename) ## does this work if incomplete? ## protocol.fixupCovalentGeom(maxIters=100, useVDW=1) protocol.writePDB(loopInfo.filename() + ".init") # initialize parameters for high temp dynamics. InitialParams(rampedParams) # high-temp dynamics setup - only need to specify parameters which # differfrom initial values in rampedParams InitialParams(highTempParams) # high temp dynamics # protocol.initDynamics( dyn, potList=potList, # potential terms to use bathTemp=init_t, initVelocities=1, finalTime=100, # stops at 100ps or 1000 steps numSteps=1000, # whichever comes first printInterval=100) dyn.setETolerance(init_t / 100) #used to det. stepsize. default: t/1000 dyn.run() # initialize integrator for simulated annealing # protocol.initDynamics( dyn, potList=potList, numSteps=100, #at each temp: 100 steps or finalTime=.2, # .2ps, whichever is less printInterval=100) # perform simulated annealing # cool.run() # final torsion angle minimization # protocol.initMinimize(dyn, printInterval=50) dyn.run() # final all- atomic degrees of freedom minimization # protocol.initMinimize(minc, potList=potList, dEPred=10) minc.run() #do analysis and write structure when function returns pass
def calcOneStructure(loopInfo): """ this function calculates a single structure, performs analysis on the structure, and then writes out a pdb file, with remarks. """ # generate a new structure with randomized torsion angles # randomizeTorsions(dyn) protocol.fixupCovalentGeom(maxIters=100, useVDW=1) # set torsion angles from restraints # setTorsionsFromTable("dihed_g_all.tbl") # calc. initial tensor orientation # # for medium in media.values(): # calcTensorOrientation(medium) # pass # initialize parameters for high temp dynamics. InitialParams(rampedParams) # high-temp dynamics setup - only need to specify parameters which # differfrom initial values in rampedParams InitialParams(highTempParams) # high temp dynamics # protocol.initDynamics( dyn, potList=potList, # potential terms to use bathTemp=init_t, initVelocities=1, finalTime=100, # stops at 800ps or 8000 steps numSteps=1000, # whichever comes first printInterval=100) # pylint: disable=E1101 dyn.setETolerance(init_t / 100) #used to det. stepsize. default: t/1000 dyn.run() # initialize parameters for cooling loop InitialParams(rampedParams) # initialize integrator for simulated annealing # protocol.initDynamics( dyn, potList=potList, numSteps=100, #at each temp: 100 steps or finalTime=.2, # .2ps, whichever is less printInterval=100) # perform simulated annealing # cool.run() # final torsion angle minimization # protocol.initMinimize(dyn, printInterval=50) dyn.run() # optional cooling in Cartesian coordinates # protocol.initDynamics( minc, potList=potList, numSteps=100, #at each temp: 100 steps or finalTime=.4, # .2ps, whichever is less printInterval=100) #cart_cool.run() # final all- atom minimization # protocol.initMinimize(minc, potList=potList, dEPred=10) minc.run() #do analysis and write structure loopInfo.writeStructure(potList)
def calcOneStructure(loopInfo): """ this function calculates a single structure, performs analysis on the structure, and then writes out a pdb file, with remarks. """ # generate a new structure with randomized torsion angles # randomizeTorsions(dyn) protocol.fixupCovalentGeom(maxIters=100,useVDW=1) # set torsion angles from restraints # setTorsionsFromTable("dihed_g_all.tbl") # calc. initial tensor orientation # # for medium in media.values(): # calcTensorOrientation(medium) # pass # initialize parameters for high temp dynamics. InitialParams( rampedParams ) # high-temp dynamics setup - only need to specify parameters which # differfrom initial values in rampedParams InitialParams( highTempParams ) # high temp dynamics # protocol.initDynamics(dyn, potList=potList, # potential terms to use bathTemp=init_t, initVelocities=1, finalTime=100, # stops at 800ps or 8000 steps numSteps=1000, # whichever comes first printInterval=100) # pylint: disable=E1101 dyn.setETolerance( init_t/100 ) #used to det. stepsize. default: t/1000 dyn.run() # initialize parameters for cooling loop InitialParams( rampedParams ) # initialize integrator for simulated annealing # protocol.initDynamics(dyn, potList=potList, numSteps=100, #at each temp: 100 steps or finalTime=.2 , # .2ps, whichever is less printInterval=100) # perform simulated annealing # cool.run() # final torsion angle minimization # protocol.initMinimize(dyn, printInterval=50) dyn.run() # optional cooling in Cartesian coordinates # protocol.initDynamics(minc, potList=potList, numSteps=100, #at each temp: 100 steps or finalTime=.4 , # .2ps, whichever is less printInterval=100) #cart_cool.run() # final all- atom minimization # protocol.initMinimize(minc, potList=potList, dEPred=10) minc.run() #do analysis and write structure loopInfo.writeStructure(potList)
def structLoopAction(loopInfo): # # this function calculates a single structure. # # # set some high-temp force constants # noe.setScale(20) #use large scale factor initially command("parameters nbonds repel %f end end" % ini_rad) command("parameters nbonds rcon %f end end" % ini_con) setConstraints(ini_ang, ini_imp) # Initial weight--modified later command("restraints dihedral scale=5. end") # # high temp dynamics # note no Van der Waals term # init_t = 3500 ini_timestep = 0.010 bath = init_t timestep = ini_timestep protocol.initDynamics( dyn, potList=hitemp_potList, # potential terms to use bathTemp=bath, initVelocities=1, finalTime=20, printInterval=100) dyn.setETolerance(bath / 100) #used to det. stepsize. default: bath/1000 dyn.run() # increase dihedral term command("restraints dihedral scale=200. end") # # cooling and ramping parameters # global k_ang, k_imp # MultRamp ramps the scale factors over the specified range for the # simulated annealing. from simulationTools import MultRamp k_noe = MultRamp(ini_noe, 30., "noe.setScale( VALUE )") radius = MultRamp(ini_rad, 0.8, "command('param nbonds repel VALUE end end')") k_vdw = MultRamp(ini_con, 4, "command('param nbonds rcon VALUE end end')") k_ang = MultRamp(ini_ang, 1.0) k_imp = MultRamp(ini_imp, 1.0) protocol.initDynamics(dyn, potList=potList, bathTemp=bath, initVelocities=1, finalTime=2, printInterval=100, stepsize=timestep) from simulationTools import AnnealIVM AnnealIVM(initTemp =init_t, finalTemp=100, tempStep =25, ivm=dyn, rampedParams = [k_noe,radius,k_vdw,k_ang,k_imp], extraCommands= lambda notUsed: \ setConstraints(k_ang.value(), k_imp.value())).run() # # final torsion angle minimization # protocol.initMinimize(dyn, printInterval=50) dyn.run() # # final all atom minimization # protocol.initMinimize(minc, potList=potList, printInterval=100) minc.run() # # analyze and write out structure # print "Starting writeStructure" loopInfo.writeStructure(potList)
def structLoopAction(loopInfo): # # this function calculates a single structure. # # # set some high-temp force constants # noe.setScale( 20 ) #use large scale factor initially command("parameters nbonds repel %f end end" % ini_rad) command("parameters nbonds rcon %f end end" % ini_con) setConstraints(ini_ang, ini_imp) # Initial weight--modified later command("restraints dihedral scale=5. end") # # high temp dynamics # note no Van der Waals term # init_t = 3500 ini_timestep = 0.010 bath = init_t timestep = ini_timestep protocol.initDynamics(dyn, potList=hitemp_potList, # potential terms to use bathTemp=bath, initVelocities=1, finalTime=20, printInterval=100) dyn.setETolerance( bath/100 ) #used to det. stepsize. default: bath/1000 dyn.run() # increase dihedral term command("restraints dihedral scale=200. end") # # cooling and ramping parameters # global k_ang, k_imp # MultRamp ramps the scale factors over the specified range for the # simulated annealing. from simulationTools import MultRamp k_noe = MultRamp(ini_noe,30.,"noe.setScale( VALUE )") radius = MultRamp(ini_rad,0.8, "command('param nbonds repel VALUE end end')") k_vdw = MultRamp(ini_con,4, "command('param nbonds rcon VALUE end end')") k_ang = MultRamp(ini_ang,1.0) k_imp = MultRamp(ini_imp,1.0) protocol.initDynamics(dyn, potList=potList, bathTemp=bath, initVelocities=1, finalTime=2, printInterval=100, stepsize=timestep) from simulationTools import AnnealIVM AnnealIVM(initTemp =init_t, finalTemp=100, tempStep =25, ivm=dyn, rampedParams = [k_noe,radius,k_vdw,k_ang,k_imp], extraCommands= lambda notUsed: \ setConstraints(k_ang.value(), k_imp.value())).run() # # final torsion angle minimization # protocol.initMinimize(dyn, printInterval=50) dyn.run() # # final all atom minimization # protocol.initMinimize(minc, potList=potList, printInterval=100) minc.run() # # analyze and write out structure # print "Starting writeStructure" loopInfo.writeStructure(potList)