Exemplo n.º 1
0
    def setup(self):
        self.mdtraj = md.load(data_filename("ala_small_traj.pdb"))
        self.traj_topology = peng.trajectory_from_mdtraj(self.mdtraj)
        self.traj_simple = peng.trajectory_from_mdtraj(self.mdtraj,
                                                       simple_topology=True)

        self.topology = self.traj_topology[0].engine.topology

        if os.path.isfile("myfile.nc"):
            os.remove("myfile.nc")
Exemplo n.º 2
0
    def setup(self):
        self.mdtraj = md.load(data_filename("ala_small_traj.pdb"))
        self.traj_topology = peng.trajectory_from_mdtraj(self.mdtraj)
        self.traj_simple = peng.trajectory_from_mdtraj(
            self.mdtraj,
            simple_topology=True)

        self.topology = self.traj_topology[0].engine.topology

        if os.path.isfile("myfile.nc"):
            os.remove("myfile.nc")
    def setup(self):
        if not md:
            raise SkipTest("mdtraj not installed")
        self.mdtraj = md.load(data_filename("ala_small_traj.pdb"))
        _ = pytest.importorskip('simtk.unit')
        self.traj_topology = peng.trajectory_from_mdtraj(self.mdtraj)
        self.traj_simple = peng.trajectory_from_mdtraj(self.mdtraj,
                                                       simple_topology=True)

        self.topology = self.traj_topology[0].engine.topology

        if os.path.isfile("myfile.nc"):
            os.remove("myfile.nc")
Exemplo n.º 4
0
    def setUp(self):
        self.mdtraj = md.load(data_filename("ala_small_traj.pdb"))
        self.traj = peng.trajectory_from_mdtraj(
            self.mdtraj, simple_topology=True)

        self.filename = data_filename("storage_test.nc")
        self.filename_clone = data_filename("storage_test_clone.nc")

        self.simplifier = ObjectJSON()
        self.template_snapshot = self.traj[0]
        self.solute_indices = range(22)

        self.toy_topology = toys.Topology(
            n_spatial=2,
            masses=[1.0, 1.0],
            pes=None
        )

        self.engine = toys.Engine({}, self.toy_topology)

        self.toy_template = toys.Snapshot(
            coordinates=np.array([[-0.5, -0.5]]),
            velocities=np.array([[0.0,0.0]]),
            engine=self.engine
        )
Exemplo n.º 5
0
    def setup(self):
        self.mdtraj = md.load(data_filename("ala_small_traj.pdb"))
        self.traj = peng.trajectory_from_mdtraj(
            self.mdtraj, simple_topology=True)

        self.filename = data_filename("storage_test.nc")
        self.filename_clone = data_filename("storage_test_clone.nc")

        self.simplifier = ObjectJSON()
        self.template_snapshot = self.traj[0]
        self.solute_indices = list(range(22))

        self.toy_topology = toys.Topology(
            n_spatial=2,
            masses=[1.0, 1.0],
            pes=None
        )

        self.engine = toys.Engine({}, self.toy_topology)

        self.toy_template = toys.Snapshot(
            coordinates=np.array([[-0.5, -0.5]]),
            velocities=np.array([[0.0,0.0]]),
            engine=self.engine
        )
    def setup(self):
        if not HAS_PLUMED:
            pytest.skip("PLUMED module not installed.")
        if not HAS_OPENMM:
            pytest.skip("OpenMM module not installed.")
        if not HAS_MDTRAJ:
            pytest.skip("MDTraj module not installed.")
        self.topology = peng_omm.tools.topology_from_pdb(
            data_filename("plumed_wrapper/" + "AD_initial_frame" + ".pdb"))

        self.trajectory = peng_omm.trajectory_from_mdtraj(
            md.load(data_filename("ala_small_traj" + ".pdb")))

        if os.path.isfile("test.nc"):
            os.remove("test.nc")
Exemplo n.º 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"))

    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()
Exemplo n.º 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"))

    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()
Exemplo n.º 9
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()
Exemplo n.º 10
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()
Exemplo n.º 11
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()