Esempio n. 1
0
# standard libraries imports
import os

# fullrmc library imports
from fullrmc.Engine import Engine

# dirname
DIR_PATH = os.path.dirname(os.path.realpath(__file__))
engineFilePath = os.path.join(DIR_PATH, "thf_engine.rmc")

# load
ENGINE = Engine(path=None)
result, mes = ENGINE.is_engine(engineFilePath, mes=True)
if result:
    ENGINE = ENGINE.load(engineFilePath)
    ENGINE.visualize(boxToCenter=True)
else:
    print mes
Esempio n. 2
0
    ENGINE.run(numberOfSteps=nsteps,
               saveFrequency=nsteps * 2,
               xyzFrequency=1,
               xyzPath=xyzPath,
               restartPdb=None)


##########################################################################################
#####################################  RUN SIMULATION  ###################################
xyzPath = "trajectory.xyz"
if os.path.isfile(xyzPath): os.remove(xyzPath)
run_normal(2000, xyzPath)
run_distort_1(2000, xyzPath)
run_distort_2(2000, xyzPath)
run_normal(2000, xyzPath)

##########################################################################################
##################################  VISUALIZE SIMULATION  ################################
ENGINE.set_pdb(pdbPath)
ENGINE.visualize(commands=["trajectory.xyz"],
                 boxWidth=0,
                 bgColor="white",
                 representationParams='CPK 1.0 0.2 50 50',
                 otherParams=[
                     "label add Atoms 0/1", "label add Atoms 0/2",
                     "label add Bonds 0/0 0/1", "label add Bonds 0/0 0/2",
                     "label textsize 1.5", "label textthickness 2",
                     "color Labels Atoms black", "color Labels Bonds black",
                     "scale set 0.75"
                 ])
Esempio n. 3
0
    xyzPath = "random.xyz"
    print "Random rotation"
    if os.path.isfile(xyzPath): os.remove(xyzPath)
    [
        g.set_move_generator(RotationGenerator(amplitude=10))
        for g in ENGINE.groups
    ]
    ENGINE.run(numberOfSteps=nsteps,
               saveFrequency=2 * nsteps,
               xyzFrequency=xyzFrequency,
               xyzPath=xyzPath,
               restartPdb=None)


##########################################################################################
#####################################  RUN SIMULATION  ###################################
about_axis_0()
about_axis_1()
about_axis_2()
about_111_axis()
random()

##########################################################################################
##################################  VISUALIZE SIMULATION  ################################
ENGINE.set_pdb(pdbPath)
ENGINE.visualize(commands=[
    "about0.xyz", "about1.xyz", "about2.xyz", "about111.xyz", "random.xyz"
],
                 boxWidth=0,
                 representationParams='CPK 1.0 0.2 50 50')
Esempio n. 4
0
    # run engine
    xyzPath="both.xyz"
    if os.path.isfile(xyzPath): os.remove(xyzPath)
    nsteps = 250*len(ENGINE.groups)
    xyzFrequency = len(ENGINE.groups)
    # run engine
    ENGINE.run(numberOfSteps=nsteps, saveFrequency=2*nsteps, xyzFrequency=xyzFrequency, xyzPath=xyzPath, restartPdb=None)

 
##########################################################################################
#####################################  RUN SIMULATION  ###################################
agitate_bonds()
agitate_angles()
agitate_both()


##########################################################################################
#################################  VISUALIZE SIMULATION  #################################
ENGINE.set_pdb(pdbPath)
ENGINE.visualize( commands = ["bonds.xyz", "angles.xyz", "both.xyz"],
                  boxToCenter=True, boxWidth=1, 
                  representationParams='CPK 1.0 0.2 50 50')    
    
 






Esempio n. 5
0
                                              angle=90)
        r = RotationGenerator(amplitude=10)
        mg = MoveGeneratorCollector(collection=[t, r],
                                    randomize=True,
                                    weights=[(0, 1), (1, 5)])
        g.set_move_generator(mg)
    # set runtime parameters
    nsteps = 1000
    xyzFrequency = 1
    # run engine
    xyzPath = "trajectory.xyz"
    if os.path.isfile(xyzPath): os.remove(xyzPath)
    ENGINE.run(numberOfSteps=nsteps,
               saveFrequency=2 * nsteps,
               xyzFrequency=xyzFrequency,
               xyzPath=xyzPath,
               restartPdb=None)


##########################################################################################
#####################################  RUN SIMULATION  ###################################
move_towards()

##########################################################################################
##################################  VISUALIZE SIMULATION  ################################
ENGINE.set_pdb(pdbPath)
ENGINE.visualize(commands=["trajectory.xyz"],
                 boxWidth=0,
                 bgColor='white',
                 representationParams='CPK 1.0 0.2 50 50')
Esempio n. 6
0
File: run.py Progetto: zizai/fullrmc
    DA_CONSTRAINT.create_angles_by_definition( anglesDefinition={"BUT": [ ('C1','C2','C3','C4', 10,30, 10,30, 10,30) ] })
    ENGINE.run(numberOfSteps=nsteps, saveFrequency=nsteps*2, xyzFrequency=xyzFreq, xyzPath=xyzPath, restartPdb=None)

def run_third_shell(nsteps, xyzPath, xyzFreq=100):
    DA_CONSTRAINT.create_angles_by_definition( anglesDefinition={"BUT": [ ('C1','C2','C3','C4', 90,100, 90,100, 90,100) ] })
    ENGINE.run(numberOfSteps=nsteps, saveFrequency=nsteps*2, xyzFrequency=xyzFreq, xyzPath=xyzPath, restartPdb=None)

##########################################################################################
#####################################  RUN SIMULATION  ###################################
xyzPath ="trajectory.xyz"
if os.path.isfile(xyzPath): os.remove(xyzPath)
run_first_shell(100000,   xyzPath)
run_second_shell(100000,  xyzPath)
run_third_shell(100000,   xyzPath)


##########################################################################################
##################################  VISUALIZE SIMULATION  ################################
ENGINE.set_pdb(pdbPath)
# VMD dihedral angle calculation is between -180 and 180 and direction is arbitrary.
# Therefore dihedral angle label can be anything as angle, -angle, 360+angle and
# 360-angle
ENGINE.visualize(commands = ["trajectory.xyz"],
                 boxWidth=0, bgColor="white",
                 representationParams='CPK 1.0 0.2 50 50',
                 otherParams = ["axes location off",
                                "label add Dihedrals 0/0 0/1 0/2 0/3",
                                "label textsize 1.5",
                                "label textthickness 2",
                                "color Labels Dihedrals black"] )
Esempio n. 7
0
File: run.py Progetto: zizai/fullrmc
)
otherParams.append("draw color green")
otherParams.append(
    "graphics top cylinder {10 10 9.95} {10 10 10.05} radius 3.0 resolution 100 filled no"
)
otherParams.append("label add Bonds 0/0 0/1")
otherParams.append("label add Bonds 0/0 0/2")
otherParams.append("label add Bonds 0/0 0/3")
otherParams.append("label add Bonds 0/0 0/4")
otherParams.append("label textsize 1.25")
otherParams.append("label textthickness 2")
otherParams.append("color Labels Bonds black")
otherParams.append("axes location off")
otherParams.append("light 0 on")
otherParams.append("light 0 pos {20 20 0}")
otherParams.append("light 1 on")
otherParams.append("light 0 pos {-20 -20 0}")
otherParams.append("light 2 on")
otherParams.append("light 0 pos {-20 20 0}")
otherParams.append("light 3 on")
otherParams.append("light 0 pos {20 -20 0}")
otherParams.append("scale set 0.3")
otherParams.append("display resize 800 800")

ENGINE.set_pdb(pdbPath)
ENGINE.visualize(commands=["trajectory.xyz"],
                 boxWidth=0,
                 bgColor="white",
                 representationParams='VDW 0.1 100',
                 otherParams=otherParams)