Beispiel #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
Beispiel #2
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
Beispiel #3
0
def main():
    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 = 10000
    options.use_amap = True
    options.amap_beta_bias = 10

    runner = system.OpenMMRunner(sys, options)
    runner.set_alpha_and_timestep(0., 0)

    pos = sys._coordinates.copy()
    vel = numpy.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
Beispiel #4
0
def setup_system():
    s = system.builder.load_amber_system("system.top", "system.mdcrd")
    s.temperature_scaler = system.ConstantTemperatureScaler(300.)

    # create the options
    options = system.RunOptions(solvation="explicit")
    options.enable_pme = True
    options.pme_tolerance = 0.0005
    options.enable_pressure_coupling = True
    options.pressure = 1.0
    options.pressure_coupling_update_steps = 25
    options.timesteps = 10
    options.minimize_steps = 50

    # create a store
    store = vault.DataStore(s.n_atoms,
                            N_REPLICAS,
                            s.get_pdb_writer(),
                            block_size=BLOCK_SIZE)
    store.initialize(mode="w")
    store.save_system(s)
    store.save_run_options(options)

    # create and store the remd_runner
    l = ladder.NearestNeighborLadder(n_trials=48 * 48)
    a = adaptor.NullAdaptor(N_REPLICAS)

    remd_runner = master_runner.MasterReplicaExchangeRunner(N_REPLICAS,
                                                            max_steps=N_STEPS,
                                                            ladder=l,
                                                            adaptor=a)
    store.save_remd_runner(remd_runner)

    # create and store the communicator
    c = comm.MPICommunicator(s.n_atoms, N_REPLICAS)
    store.save_communicator(c)

    # create and save the initial states
    states = [gen_state(s, i) for i in range(N_REPLICAS)]
    store.save_states(states, 0)

    # save data_store
    store.save_data_store()

    return s.n_atoms
Beispiel #5
0
    def test_runner(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 = 10000

        runner = system.OpenMMRunner(sys, options)
        runner.set_alpha_and_timestep(0., 1)

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

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

        assert state