本文整理汇总了Python中Sire.System.molecules方法的典型用法代码示例。如果您正苦于以下问题:Python System.molecules方法的具体用法?Python System.molecules怎么用?Python System.molecules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sire.System
的用法示例。
在下文中一共展示了System.molecules方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_central
# 需要导入模块: from Sire import System [as 别名]
# 或者: from Sire.System import molecules [as 别名]
def test_central(verbose=False):
testsys = System(system)
moves = RigidBodyMC(waters)
moves.setReflectionSphere(Vector(0), radius)
if verbose:
print("Performing 5000 moves 10 times...")
PDB().write(testsys.molecules(), "test_central0000.pdb")
for i in range(1,11):
moves.move(testsys, 5000, False)
if verbose:
PDB().write(testsys.molecules(), "test_central%0004d.pdb" % i)
# the reflection sphere should ensure that none of the
# water molecules diffuse outside the sphere
mols = testsys.molecules()
for molnum in mols.molNums():
mol = mols[molnum]
dist = mol.evaluate().center().length()
if verbose:
print("%s : %s A" % (molnum.value(), dist))
assert( dist <= radius.value() )
示例2: test_local
# 需要导入模块: from Sire import System [as 别名]
# 或者: from Sire.System import molecules [as 别名]
def test_local(verbose = False):
testsys = System(system)
moves = RigidBodyMC(waters)
local_radius = 1 * angstrom
if verbose:
print("Setting local reflection spheres...")
for molnum in waters.molNums():
center = waters[molnum].evaluate().center()
moves.setReflectionSphere(molnum, center, local_radius)
if verbose:
print("%s : %s == %s, %s == %s" % (molnum.value(), \
center, moves.reflectionSphereCenter(molnum), \
local_radius.value(), moves.reflectionSphereRadius(molnum).value()))
assert( moves.reflectionSphereCenter(molnum) == center )
assert( moves.reflectionSphereRadius(molnum) == local_radius )
if verbose:
print("Performing 5000 moves 10 times...")
PDB().write(testsys.molecules(), "test_local0000.pdb")
for i in range(1,11):
moves.move(testsys, 5000, False)
if verbose:
PDB().write(testsys.molecules(), "test_local%0004d.pdb" % i)
# the reflection sphere should ensure that none of the
# water molecules diffuse outside the sphere
mols = testsys.molecules()
for molnum in mols.molNums():
mol = mols[molnum]
oldmol = waters[molnum]
dist = Vector.distance( mol.evaluate().center(), oldmol.evaluate().center() )
if verbose:
print("%s : %s A" % (molnum.value(), dist))
assert( dist <= local_radius.value() )
示例3: print
# 需要导入模块: from Sire import System [as 别名]
# 或者: from Sire.System import molecules [as 别名]
ms = t.elapsed()
print("Parameterised all of the water molecules (in %d ms)!" % ms)
system = System()
system.add(cljff)
print("Initial energy = %s" % system.energy())
mc = RigidBodyMC(free_mols)
sync_mc = RigidBodyMC(sync_mols)
sync_mc.setSynchronisedTranslation(True)
sync_mc.setSynchronisedRotation(True)
nodes = Cluster.getNode()
this_thread = nodes.borrowThisThread()
moves = WeightedMoves()
moves.add(mc, 2)
moves.add(sync_mc, 1)
for i in range(0,10):
print(i+1)
node = nodes.getNode()
sim = Simulation.run(node, system, moves, 1000)
system = sim.system()
moves = sim.moves()
PDB().write(system.molecules(), "test%003d.pdb" % (i+1))
示例4: WeightedMoves
# 需要导入模块: from Sire import System [as 别名]
# 或者: from Sire.System import molecules [as 别名]
move.setMaximumRotation(5 * degrees)
# We now group all of the moves to be performed into a single Moves
# object. In this case, a WeightedMoves will draw moves randomly
# according to their weight
moves = WeightedMoves()
moves.add( move, 1 )
# Lets perform 100 moves. The moves are performed on a copy of 'system',
# with the updated version of 'system' after the moves returned by this
# function
print("Running 100 moves...")
new_system = moves.move(system, 100, True)
# Now lets run a simulation, writing out a PDB trajectory
PDB().write(system.molecules(), "output000.pdb")
print(system.energies())
# Here we run 10 blocks of 1000 moves, printing out the
# energies and a PDB of the coordinates after each block
for i in range(1,11):
system = moves.move(system, 1000, True)
print("%d: %s" % (i, system.energies()))
PDB().write(system.molecules(), "output%003d.pdb" % i)
# Finally, we print out information about how many moves
# were accepted and rejected.
print("Move information:")
print(moves)
示例5: print
# 需要导入模块: from Sire import System [as 别名]
# 或者: from Sire.System import molecules [as 别名]
mol = mol.edit().rename("SB2").commit()
mol = protoms.parameterise(mol, ProtoMS.SOLUTE)
perturbations = mol.property("perturbations")
print(perturbations)
print(perturbations.requiredSymbols())
print(perturbations.requiredProperties())
lam = perturbations.symbols().Lambda()
system = System()
solute = MoleculeGroup("solute", mol)
system.add(solute)
system.setConstant(lam, 0.0)
system.add( PerturbationConstraint(solute) )
print(system.constraintsSatisfied())
for i in range(0,101,10):
system.setConstant(lam, 0.01 * i)
PDB().write(system.molecules(), "test_%003d.pdb" % i)
示例6: VolumeMove
# 需要导入模块: from Sire import System [as 别名]
# 或者: from Sire.System import molecules [as 别名]
rb_moves.setTemperature(temperature)
# create volume moves to change the box size
vol_moves = VolumeMove(mols)
vol_moves.setMaximumVolumeChange( mols.nMolecules() * 0.1 * angstrom3 )
vol_moves.setTemperature(temperature)
vol_moves.setPressure(pressure)
# group these two moves together
moves = WeightedMoves()
moves.add( rb_moves, mols.nMolecules() )
moves.add( vol_moves, 1 )
# print the initial energy and coordinates
print("0: %s" % system.energy())
PDB().write(system.molecules(), "output000000.pdb")
# now run the simulation in blocks of 1000 moves
nmoves = 0
while nmoves < num_moves:
system = moves.move(system, 1000, False)
nmoves += 1000
# print out the energy and coordinates every 1000 moves
print("%s %s" % (nmoves, system.energy()))
print(moves)
PDB().write(system.molecules(), "output%000006d.pdb" % nmoves)
print("Complete!")
示例7: HybridMC
# 需要导入模块: from Sire import System [as 别名]
# 或者: from Sire.System import molecules [as 别名]
mcmove.add(intra_mcmove)
mcmove.add(inter_mcmove)
do_mc = False
hmcmove = HybridMC(salt, 4*femtosecond, 20)
do_hmc = True
do_hmc = False
print(system.property("space"))
print("\nMove 0")
print(system.energy())
print(mdmove.kineticEnergy())
print(system.energy() + mdmove.kineticEnergy())
PDB().write(system.molecules(), "test%0004d.pdb" % 0)
if do_mc:
for i in range(1,1000):
system = mcmove.move(system, 20, False)
print(i, system.energy())
PDB().write(system.molecules(), "test%0004d.pdb" % i)
elif do_hmc:
for i in range(1,1000):
hmcmove.move(system, 1)
print(i, system.energy())
PDB().write(system.molecules(), "test%0004d.pdb" % i)
示例8: RigidBodyMC
# 需要导入模块: from Sire import System [as 别名]
# 或者: from Sire.System import molecules [as 别名]
solvent_move.setMaximumRotation( 5 * degrees )
solute_move = RigidBodyMC( solute )
solute_move.setMaximumTranslation( 0.2 * angstrom )
solute_move.setMaximumRotation( 5 * degrees )
moves = WeightedMoves()
moves.add( solvent_move, 100 )
moves.add( solute_move, 1 )
for i in range(1,11):
system = moves.move(system, 5000, False )
#system = moves.move(system, 50, False)
print("Step %d of 10: Energy = %s" % (i, system.energy()))
PDB().write(system.molecules(), "test_equil_%0004d.pdb" % i)
print("Equilibration complete")
print("Adding energy monitors...")
identity_points = []
for atom in identity_atoms:
identity_points.append( AtomPoint( solute.moleculeAt(0).atom(AtomName(atom)) ) )
idassigner = IDAssigner(identity_points, solvent)
nrgmon0 = EnergyMonitor(solute, solvent)
nrgmon1 = EnergyMonitor(solute, idassigner)
示例9: print
# 需要导入模块: from Sire import System [as 别名]
# 或者: from Sire.System import molecules [as 别名]
print((grid_system.energies()))
print((exp_system.energies()))
print(("\nGrid energy equals: %s. Explicit energy equals: %s." % \
(grid_system.energy(), exp_system.energy())))
diff = grid_system.energy() - exp_system.energy()
print(("The difference is %s\n" % diff))
rbmc = RigidBodyMC(swapwaters)
rbmc.setReflectionSphere(center_point, 7.5*angstrom)
moves = SameMoves(rbmc)
PDB().write(grid_system.molecules(), "test0000.pdb")
t = QTime()
for i in range(1,11):
print("Moving the system...")
t.start()
grid_system = moves.move(grid_system, 1000, False)
ms = t.elapsed()
print(("Moves complete! Took %d ms" % ms))
print(("GRID: ",grid_system.energies()))
exp_system.update( grid_system.molecules() )
print(("EXPT: ",exp_system.energies()))
print(("\nGrid energy equals: %s. Explicit energy equals: %s." % \
(grid_system.energy(), exp_system.energy())))