openmm / openmm-cookbook

The OpenMM Cookbook and Tutorials
39 stars 10 forks source link

Run a REST simulation and write a trajectory file #32

Open gitkol opened 1 year ago

gitkol commented 1 year ago

Hi, I have been using successfully the code in the REST tutorial, many thanks for that, but I am having a most likely trivial problem. I'd like to write a trajectory file of the thermodynamic state configurations for analysis, but I just couldn't figure out how to do this. Can you show me an example? Thank you very much, Istvan

sef43 commented 1 year ago

@zhang-ivy who wrote the REST tutorial might be able to help with this?

zhang-ivy commented 1 year ago

To extract trajectories for each thermodynamic state, you'll need to pull out the positions from the checkpoint file using openmmtools.

Here is a script from my recent paper that does this. The script is written for alchemical free energy calculations (where there is a hybrid topology that corresponds to old and new residues, aka two sets of positions). You'll need to adapt the script to handle a vanilla topology (and one set of positions). You'll also need to make sure to set state to the index of the thermodynamic state you're interested in pulling positions from and replica_id=None (the script as is currently writes out trajectories per replica using replica_id.) https://github.com/choderalab/perses-barnase-barstar-paper/blob/main/scripts/05_analyze/run_make_traj_per_replica.py

gitkol commented 1 year ago

Thank you Ivy, I can start from here. Appreciate it.

Best regards,

Istvan

On Mon, Aug 21, 2023 at 9:07 AM Ivy Zhang @.***> wrote:

To extract trajectories for each thermodynamic state, you'll need to pull out the positions from the checkpoint file using openmmtools.

Here is a script from my recent paper that does this. The script is written for alchemical free energy calculations (where there is a hybrid topology that corresponds to old and new residues). You'll need to adapt the script to handle a vanilla topology (and one set of positions).

https://github.com/choderalab/perses-barnase-barstar-paper/blob/main/scripts/05_analyze/run_make_traj_per_replica.py

— Reply to this email directly, view it on GitHub https://github.com/openmm/openmm-cookbook/issues/32#issuecomment-1686296083, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKDNJ2TMGTGCAWM2UKVKCP3XWNMRRANCNFSM6AAAAAA3ISDBYQ . You are receiving this because you authored the thread.Message ID: @.***>

gitkol commented 9 months ago

Thanks again, Ivy. I finally had time to try this and it works. :) Just one question, running REST on a single GPU is obviously pretty slow, I can see that. Is there a way to run these simulations on multiple GPUs if they are on the same machine?

Thanks and best regards,

Istvan

On Mon, Aug 21, 2023 at 9:47 AM Istvan Kolossvary @.***> wrote:

Thank you Ivy, I can start from here. Appreciate it.

Best regards,

Istvan

On Mon, Aug 21, 2023 at 9:07 AM Ivy Zhang @.***> wrote:

To extract trajectories for each thermodynamic state, you'll need to pull out the positions from the checkpoint file using openmmtools.

Here is a script from my recent paper that does this. The script is written for alchemical free energy calculations (where there is a hybrid topology that corresponds to old and new residues). You'll need to adapt the script to handle a vanilla topology (and one set of positions).

https://github.com/choderalab/perses-barnase-barstar-paper/blob/main/scripts/05_analyze/run_make_traj_per_replica.py

— Reply to this email directly, view it on GitHub https://github.com/openmm/openmm-cookbook/issues/32#issuecomment-1686296083, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKDNJ2TMGTGCAWM2UKVKCP3XWNMRRANCNFSM6AAAAAA3ISDBYQ . You are receiving this because you authored the thread.Message ID: @.***>