Example #1
0
import unittest
from subsets import SubsetTest
from MMTK import *
from MMTK.MoleculeFactory import MoleculeFactory
from MMTK.ForceFields import Amber99ForceField, LennardJonesForceField
from MMTK_forcefield import NonbondedList
from MMTK.Random import randomPointInBox
from MMTK.Geometry import SCLattice
from MMTK.Utility import pairs
from Scientific.Geometry import ex, ey, ez
from Scientific import N
from cStringIO import StringIO
import itertools

factory = MoleculeFactory()
factory.createGroup('dihedral_test')

factory.addAtom('dihedral_test', 'C1', 'C')
factory.addAtom('dihedral_test', 'C2', 'C')
factory.addAtom('dihedral_test', 'C3', 'C')
factory.addAtom('dihedral_test', 'C4', 'C')

factory.addBond('dihedral_test', 'C1', 'C2')
factory.addBond('dihedral_test', 'C2', 'C3')
factory.addBond('dihedral_test', 'C3', 'C4')

factory.setAttribute('dihedral_test', 'C1.amber_atom_type', 'D1')
factory.setAttribute('dihedral_test', 'C2.amber_atom_type', 'D2')
factory.setAttribute('dihedral_test', 'C3.amber_atom_type', 'D3')
factory.setAttribute('dihedral_test', 'C4.amber_atom_type', 'D4')
factory.setAttribute('dihedral_test', 'C1.amber_charge', 0.)
import unittest
from subsets import SubsetTest
from MMTK import *
from MMTK.MoleculeFactory import MoleculeFactory
from MMTK.ForceFields import Amber99ForceField, LennardJonesForceField
from MMTK_forcefield import NonbondedList
from MMTK.Random import randomPointInBox
from MMTK.Geometry import SCLattice
from MMTK.Utility import pairs
from Scientific.Geometry import ex, ey, ez
from Scientific import N
from cStringIO import StringIO
import itertools

factory = MoleculeFactory()
factory.createGroup('dihedral_test')

factory.addAtom('dihedral_test', 'C1', 'C')
factory.addAtom('dihedral_test', 'C2', 'C')
factory.addAtom('dihedral_test', 'C3', 'C')
factory.addAtom('dihedral_test', 'C4', 'C')

factory.addBond('dihedral_test', 'C1', 'C2')
factory.addBond('dihedral_test', 'C2', 'C3')
factory.addBond('dihedral_test', 'C3', 'C4')

factory.setAttribute('dihedral_test', 'C1.amber_atom_type', 'D1')
factory.setAttribute('dihedral_test', 'C2.amber_atom_type', 'D2')
factory.setAttribute('dihedral_test', 'C3.amber_atom_type', 'D3')
factory.setAttribute('dihedral_test', 'C4.amber_atom_type', 'D4')
factory.setAttribute('dihedral_test', 'C1.amber_charge', 0.)
Example #3
0
# Create molecules from scratch
#
# This example shows how a molecular system (SPCE water) can be set up using
# molecule factories instead of the molecular database.
#

from MMTK import *
from MMTK.MoleculeFactory import MoleculeFactory
from MMTK.ForceFields import SPCEForceField

# Create a new molecule factory.
factory = MoleculeFactory()

# Create the empty molecule. There is no distinction between groups
# and molecules at this level. Everything is a building block.
factory.createGroup('water')

# Add the atoms.
factory.addAtom('water', 'O', 'O')
factory.addAtom('water', 'H1', 'H')
factory.addAtom('water', 'H2', 'H')

# Add the bonds.
factory.addBond('water', 'O', 'H1')
factory.addBond('water', 'O', 'H2')

# Define the atom positions
factory.setPosition('water', 'O', Vector(0., 0., 0.00655616814675))
factory.setPosition('water', 'H1',
                    Vector(-0.0756950327264, 0., -0.0520320595151))
factory.setPosition('water', 'H2',
Example #4
0
# Create molecules from scratch
#
# This example shows how a molecular system (SPCE water) can be set up using
# molecule factories instead of the molecular database.
#

from MMTK import *
from MMTK.MoleculeFactory import MoleculeFactory
from MMTK.ForceFields import SPCEForceField

# Create a new molecule factory.
factory = MoleculeFactory()

# Create the empty molecule. There is no distinction between groups
# and molecules at this level. Everything is a building block.
factory.createGroup('water')

# Add the atoms.
factory.addAtom('water', 'O', 'O')
factory.addAtom('water', 'H1', 'H')
factory.addAtom('water', 'H2', 'H')

# Add the bonds.
factory.addBond('water', 'O', 'H1')
factory.addBond('water', 'O', 'H2')

# Define the atom positions
factory.setPosition('water', 'O', Vector(0., 0., 0.00655616814675))
factory.setPosition('water', 'H1',
                    Vector(-0.0756950327264, 0., -0.0520320595151))
factory.setPosition('water', 'H2',