Example #1
0
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)
Example #2
0
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)
Example #3
0
#   the IVM is used for performing dynamics and minimization in torsion-angle
#   space, and in Cartesian space.
#
dyn = IVM()

# initialize ivm topology for torsion-angle dynamics

#for m in media.values():
#    m.setFreedom("fixDa, fixRh")        #fix tensor Rh, Da, vary orientation
##    m.setFreedom("varyDa, varyRh")      #vary tensor Rh, Da, vary orientation
protocol.torsionTopology(dyn)

# minc used for final cartesian minimization
#
minc = IVM()
protocol.initMinimize(minc)

#for m in media.values():
#    m.setFreedom("varyDa, varyRh")    #allow all tensor parameters float here
#    pass
protocol.cartesianTopology(minc)



# object which performs simulated annealing
#
init_t  = 3500.     # Need high temp and slow annealing to converge
cool = AnnealIVM(initTemp =init_t,
                 finalTemp=25,
                 tempStep =12.5,
                 ivm=dyn,
Example #4
0
#

dyn = IVM()

# Minimize in Cartesian space with only the covalent constraints.
# Note that bonds, angles and many impropers can't change with the
# internal torsion-angle dynamics
#  breaks bonds topologically - doesn't change force field

dyn.potList().add( XplorPot("BOND") )
dyn.potList().add( XplorPot("ANGL") )
dyn.potList().add( XplorPot("IMPR") )

dyn.breakAllBondsIn("all")

protocol.initMinimize(dyn,numSteps=1000)
dyn.run()

#
# reset ivm topology for torsion-angle dynamics
#
dyn.reset()
dyn.potList().removeAll()

protocol.torsionTopology(dyn)

#
# minc used for final cartesian minimization
#
minc = IVM()
protocol.initMinimize(minc)