예제 #1
0
rampedParams = []
highTempParams = []

# compare atomic Cartesian rmsd with a reference structure
#  backbone and heavy atom RMSDs will be printed in the output
#  structure files
#
from posDiffPotTools import create_PosDiffPot
refRMSD = create_PosDiffPot("refRMSD", "name CA C N O", selection2="initial")

from noePotTools import create_NOEPot, readNEF
noe = create_NOEPot("noe", nef=nefData)
noe.setAllowOverlap(False)
noe.setShowAllRestraints(True)
potList.append(noe)
rampedParams.append(MultRamp(2, 30, "noe.setScale( VALUE )"))

import nefTools
from potList import PotList
rdcs = PotList('rdcs')
try:
    rdcNames = nefTools.getBlockNames(nefData, 'rdc')
except:
    rdcNames = []
    pass

tensors = []
for name in rdcNames:
    print(f"reading RDC block {name}")
    block = nefTools.getBlock(nefData, 'rdc', name)
    from rdcPotTools import readNEF
예제 #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)
예제 #3
0
파일: wrefine.py 프로젝트: xubiaopeng/PRASD
potList = PotList()
rampedParams=[]


# set up NOE potential
noe=PotList('noe')
potList.append(noe)
from noePotTools import create_NOEPot
for (name,scale,file) in [('all',1,"constraints/yourfolder/yourfoldernoe.tbl"),
                          #add entries for additional tables
                          ]:
    pot = create_NOEPot(name,file)
    # pot.setPotType("soft") - if you think there may be bad NOEs
    pot.setScale(scale)
    noe.append(pot)
rampedParams.append( MultRamp(2,30, "noe.setScale( VALUE )") )

# Set up dihedral angles
from xplorPot import XplorPot
protocol.initDihedrals("constraints/yourfolder/yourfolder_dihed_g_all.tbl",
                       useDefaults=False)
potList.append( XplorPot('CDIH') )
rampedParams.append( StaticRamp("potList['CDIH'].setScale(200)") )

from simulationTools import StructureLoop


def calcOneStructure( structData ):
    from waterRefineTools import refine
    refine(outFilename=structData.filename(),
           potList=potList,
예제 #4
0
파일: anneal.py 프로젝트: VuisterLab/cing
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)