def setup_module():
    global topology, template, system, nan_causing_template
    if not (u and mm and app and md):
        raise SkipTest
    template = peng.snapshot_from_pdb(data_filename("ala_small_traj.pdb"))
    topology = peng.to_openmm_topology(template)

    # Generated using OpenMM Script Builder
    # http://builder.openmm.org

    forcefield = app.ForceField(
        'amber96.xml',  # solute FF
        'tip3p.xml'     # solvent FF
    )

    # OpenMM System
    system = forcefield.createSystem(
        topology,
        nonbondedMethod=app.PME,
        nonbondedCutoff=1.0*u.nanometers,
        constraints=app.HBonds,
        ewaldErrorTolerance=0.0005
    )

    # this is crude but does the trick
    nan_causing_template = template.copy()
    kinetics = template.kinetics.copy()
    # this is crude but does the trick
    kinetics.velocities = kinetics.velocities.copy()
    kinetics.velocities[0] = \
        (np.zeros(template.velocities.shape[1]) + 1000000.) * \
        u.nanometers / u.picoseconds
    nan_causing_template.kinetics = kinetics
示例#2
0
def setUp():
    global topology, template, system, nan_causing_template
    template = peng.snapshot_from_pdb(data_filename("ala_small_traj.pdb"))
    topology = peng.to_openmm_topology(template)

    # Generated using OpenMM Script Builder
    # http://builder.openmm.org

    forcefield = app.ForceField(
        'amber96.xml',  # solute FF
        'tip3p.xml'     # solvent FF
    )

    # OpenMM System
    system = forcefield.createSystem(
        topology,
        nonbondedMethod=app.PME,
        nonbondedCutoff=1.0*u.nanometers,
        constraints=app.HBonds,
        ewaldErrorTolerance=0.0005
    )

    # this is crude but does the trick
    nan_causing_template = template.copy()
    kinetics = template.kinetics.copy()
    # this is crude but does the trick
    kinetics.velocities = kinetics.velocities.copy()
    kinetics.velocities[0] = \
        (np.zeros(template.velocities.shape[1]) + 1000000.) * \
        u.nanometers / u.picoseconds
    nan_causing_template.kinetics = kinetics
def setup_package():
    # this should generate the trajectory.nc file which we'll use for
    # everything else
    mdtrajectory = md.load(data_filename("ala_small_traj.pdb"))

    snapshot = peng.snapshot_from_pdb(data_filename("ala_small_traj.pdb"))

    storage = Storage(filename=data_filename("ala_small_traj.nc"),
                      template=snapshot,
                      mode='w')

    mytraj = peng.trajectory_from_mdtraj(mdtrajectory, simple_topology=True)
    storage.trajectories.save(mytraj)

    storage.close()
示例#4
0
def run_steps(steps):
    template = peng.snapshot_from_pdb(
        "/Users/jan-hendrikprinz/Studium/git/openpathsampling/examples/data/Alanine_solvated.pdb")
    topology = peng.to_openmm_topology(template)

    # Generated using OpenMM Script Builder
    # http://builder.openmm.org

    forcefield = mm.app.ForceField(
        'amber96.xml',  # solute FF
        'tip3p.xml'     # solvent FF
    )

    # OpenMM System
    system = forcefield.createSystem(
        topology,
        nonbondedMethod=mm.app.PME,
        nonbondedCutoff=1.0*u.nanometers,
        constraints=mm.app.HBonds,
        ewaldErrorTolerance=0.0005
    )

    # OpenMM Integrator
    integrator = mm.LangevinIntegrator(
        300 * u.kelvin,
        1.0 / u.picoseconds,
        2.0 * u.femtoseconds
    )
    integrator.setConstraintTolerance(0.00001)

    # Engine options
    options = {
        'n_steps_per_frame': 2,
        'n_frames_max': 5
    }

    engine = peng.Engine(
        template.topology,
        system,
        integrator,
        options=options
    )

    engine.initialize('CPU')

    traj = engine.generate(template, paths.LengthEnsemble(steps).can_append)

    return traj
示例#5
0
def setup_package():
    # this should generate the trajectory.nc file which we'll use for
    # everything else
    mdtrajectory = md.load(data_filename("ala_small_traj.pdb"))

    snapshot = peng.snapshot_from_pdb(data_filename("ala_small_traj.pdb"))

    storage = Storage(
        filename=data_filename("ala_small_traj.nc"),
        template=snapshot,
        mode='w'
    )

    mytraj = peng.trajectory_from_mdtraj(mdtrajectory, simple_topology=True)
    storage.trajectories.save(mytraj)

    storage.close()
示例#6
0
def setup_package():
    if not md:
        return
    # this should generate the ala_small_traj.nc file which we'll use for
    # everything else
    # NOTE: tests using this must be skipped if there's no mdtraj!
    mdtrajectory = md.load(data_filename("ala_small_traj.pdb"))

    snapshot = peng.snapshot_from_pdb(data_filename("ala_small_traj.pdb"))

    storage = Storage(filename=data_filename("ala_small_traj.nc"),
                      template=snapshot,
                      mode='w')

    mytraj = peng.trajectory_from_mdtraj(mdtrajectory, simple_topology=True)
    storage.trajectories.save(mytraj)

    storage.close()
示例#7
0
def setup_package():
    # this should generate the trajectory.nc file which we'll use for
    # everything else
    mdtrajectory = md.load(data_filename("ala_small_traj.pdb"))

    snapshot = peng.snapshot_from_pdb(data_filename("ala_small_traj.pdb"))

    # print snapshot.__dict__
    # print snapshot.engine.__dict__

    # once we have a template configuration (coordinates to not really matter)
    # we can create a storage. We might move this logic out of the dynamics engine
    # and keep sotrage and engine generation completely separate!

    storage = Storage(filename=data_filename("ala_small_traj.nc"),
                      template=snapshot,
                      mode='w')

    mytraj = peng.trajectory_from_mdtraj(mdtrajectory, simple_topology=True)
    storage.trajectories.save(mytraj)

    storage.close()
示例#8
0
def setup_package():
    # this should generate the trajectory.nc file which we'll use for
    # everything else
    mdtrajectory = md.load(data_filename("ala_small_traj.pdb"))

    snapshot = peng.snapshot_from_pdb(data_filename("ala_small_traj.pdb"))

    # print snapshot.__dict__
    # print snapshot.engine.__dict__

    # once we have a template configuration (coordinates to not really matter)
    # we can create a storage. We might move this logic out of the dynamics engine
    # and keep sotrage and engine generation completely separate!

    storage = Storage(
        filename=data_filename("ala_small_traj.nc"),
        template=snapshot,
        mode='w'
    )

    mytraj = peng.trajectory_from_mdtraj(mdtrajectory, simple_topology=True)
    storage.trajectories.save(mytraj)

    storage.close()
 def test_masses_for_virtual_sites(self):
     snap = omm_engine.snapshot_from_pdb(data_filename("tip4p_water.pdb"))
     snap_masses = snap.masses
     # just check that the virtual site has a mass of 0
     assert snap_masses[3].value_in_unit(snap_masses[3].unit) == 0
    rigidWater=True,
    ewaldErrorTolerance=0.0005
)
hi_T_integrator = VVVRIntegrator(
    500*unit.kelvin, 
    1.0/unit.picoseconds, 
    2.0*unit.femtoseconds)
hi_T_integrator.setConstraintTolerance(0.00001)


# The storage file will need a template snapshot. In addition, the OPS OpenMM-based `Engine` has a few properties and options that are set by these dictionaries.

# In[3]:


template = omm.snapshot_from_pdb("AD_initial_frame.pdb")
openmm_properties = {'OpenCLPrecision': 'mixed'}
engine_options = {
    'n_steps_per_frame': 10,
    'n_frames_max': 2000
}


# In[4]:


hi_T_engine = omm.Engine(
    template.topology, 
    system, 
    hi_T_integrator, 
    openmm_properties=openmm_properties,