choderalab / openmmtools

A batteries-included toolkit for the GPU-accelerated OpenMM molecular simulation engine.
http://openmmtools.readthedocs.io
MIT License
235 stars 76 forks source link

Adding customized standard in determining the probability of acceptance for Hamiltonian REMD #456

Open chemlove opened 4 years ago

chemlove commented 4 years ago

I am new to openmmtools and I try to perform a Hamiltonian-exchange MD with customized standard in determining the probability of acceptance.

For example, I want to add a residue-residue distance to monitor the MD process, and integrate this CV into the Hamiltonian to determine the probability of acceptance in replica exchanges.

As a biginner of enhanced sampling MD, I don't know whether it is meaningful to do this and how to modify relevant codes in openmmtools to achieve it. Can you give me some advice?

It seems the REMD output trajectory in openmmtools is a single trajectory containing all replicas, another problem to be solved is how to calculate the customized CV for different replicas on-the-fly?

Any advice on these problems are very appreciated.

andrrizzi commented 4 years ago

Hi @chemlove . I'm not sure I understand your requirements exactly, but I suggest you look at the CustomCVForce in OpenMM (http://docs.openmm.org/latest/api-python/generated/simtk.openmm.openmm.CustomCVForce.html#simtk.openmm.openmm.CustomCVForce).

Currently, the simulation doesn't store the CVs, but you could either extend the MultiStateSampler and MultiStateReporter code to do so or do it manually after each iteration with something like

for iteration in range(n_iterations):
    hrex_simulation.run(n_iterations=1)
    for sampler_state in hrex.sampler_states:
        # Store sampler_state.collective_variables