示例#1
0
    def test_explicit_runner_scaler(self):
        # alanine dipeptide in TIP3P box
        sys = system.builder.load_amber_system(self.top_path, self.mdcrd_path)
        sys.temperature_scaler = system.ConstantTemperatureScaler(300.)
        rest2_scaler = system.GeometricTemperatureScaler(0, 1, 300., 350.)

        options = system.RunOptions(solvation="explicit")
        options.rest2_scaler = system.REST2Scaler(300., rest2_scaler)
        options.timesteps = 20
        options.use_rest2 = True

        runner = OpenMMRunner(sys, options, platform="Reference")
        runner.prepare_for_timestep(0., 1)

        pos = sys._coordinates.copy()
        vel = np.zeros_like(pos)
        alpha = 0.
        energy = 0.
        box_vectors = sys._box_vectors
        state = system.SystemState(pos, vel, alpha, energy, box_vectors)

        state = runner.minimize_then_run(state)
        state = runner.run(state)

        assert state
示例#2
0
    def test_explicit_runner_scaler(self):
        # alanine dipeptide in TIP3P box
        sys = system.builder.load_amber_system(self.top_path, self.mdcrd_path)
        sys.temperature_scaler = system.ConstantTemperatureScaler(300.)
        rest2_scaler = system.GeometricTemperatureScaler(0, 1, 300., 350.)

        options = system.RunOptions(solvation="explicit")
        options.rest2_scaler = system.REST2Scaler(300., rest2_scaler)
        options.timesteps = 20
        options.use_rest2 = True

        runner = OpenMMRunner(sys, options, test=True)
        runner.prepare_for_timestep(0., 1)

        pos = sys._coordinates.copy()
        vel = np.zeros_like(pos)
        alpha = 0.
        energy = 0.
        box_vectors = sys._box_vectors
        state = system.SystemState(pos, vel, alpha, energy, box_vectors)

        state = runner.minimize_then_run(state)
        state = runner.run(state)

        assert state
示例#3
0
    def test_implicit_runner_amap(self):
        p = system.ProteinMoleculeFromSequence("NALA ALA CALA")
        b = system.SystemBuilder()
        sys = b.build_system_from_molecules([p])
        sys.temperature_scaler = system.ConstantTemperatureScaler(300.)

        options = system.RunOptions()
        options.timesteps = 20
        options.use_amap = True
        options.amap_beta_bias = 10

        runner = OpenMMRunner(sys, options, platform="Reference")
        runner.prepare_for_timestep(0., 1)

        pos = sys._coordinates.copy()
        vel = np.zeros_like(pos)
        alpha = 0.
        energy = 0.
        box_vectors = np.zeros(3)
        state = system.SystemState(pos, vel, alpha, energy, box_vectors)

        state = runner.minimize_then_run(state)
        state = runner.run(state)

        assert state
示例#4
0
    def test_implicit_runner_amap(self):
        p = system.ProteinMoleculeFromSequence("NALA ALA CALA")
        b = system.SystemBuilder()
        sys = b.build_system_from_molecules([p])
        sys.temperature_scaler = system.ConstantTemperatureScaler(300.)

        options = system.RunOptions()
        options.timesteps = 20
        options.use_amap = True
        options.amap_beta_bias = 10

        runner = OpenMMRunner(sys, options, test=True)
        runner.prepare_for_timestep(0., 1)

        pos = sys._coordinates.copy()
        vel = np.zeros_like(pos)
        alpha = 0.
        energy = 0.
        box_vectors = np.zeros(3)
        state = system.SystemState(pos, vel, alpha, energy, box_vectors)

        state = runner.minimize_then_run(state)
        state = runner.run(state)

        assert state