Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tutorial for running REST #17

Merged
merged 7 commits into from
Apr 21, 2023
Merged

Conversation

zhang-ivy
Copy link
Contributor

@zhang-ivy zhang-ivy commented Apr 18, 2023

Here's my latest draft of a tutorial for building a REST system (using OpenMM) and running a REST simulation (using openmmtools). This is a part of a larger effort to draft OpenMM 8 tutorials for the paper.

Please let me know if anything is unclear or there are any typos. Also note that we will want to rename the notebook once it's finalized.

@zhang-ivy zhang-ivy mentioned this pull request Apr 18, 2023
3 tasks
Copy link
Member

@peastman peastman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really nice!

It's quite a complicated process, involving a lot of code. How about adding a few paragraphs at the beginning to give an overview of the process? Explain what steps you're going to perform and why. That will provide some context to help them understand each step as they come to it.

I found the get_rest_identifier() function confusing, because when you come to it you don't yet understand what it's for. Why are you creating lists of 1s and 0s to represent the different types? The answer is that you're setting values of parameters for custom forces, but the reader doesn't know that yet. How about moving this function down to after you create the CustomBondForce? At that point it will be more obvious why it's written the way it is.

}
],
"source": [
"pdb = app.PDBFile('/home/zhangi/choderalab/openmm-cookbook/notebooks/cookbook/villin.pdb')\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolute paths won't work on users' computers. Can you use a relative path instead, and provide a link for the user to download the file (https://raw.githubusercontent.com/openmm/openmm-cookbook/main/notebooks/cookbook/villin.pdb)?

"source": [
"Replica exchange solute tempering (REST) is an enhanced sampling approach that aims to improve sampling for a user-defined subset of atoms (i.e., REST atoms) by increasing its effective temperature.\n",
"\n",
"REST involves running replica exchange to sample a set of thermodynamic states, where one state contains the unmodified Hamiltonian and all other states involve modified Hamiltonians where REST atom interactions are scaled to increased temperatures (Wang et al. 2011, DOI: 10.1021/jp204407d).\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you include a hyperlink to the paper?

"\n",
"REST involves running replica exchange to sample a set of thermodynamic states, where one state contains the unmodified Hamiltonian and all other states involve modified Hamiltonians where REST atom interactions are scaled to increased temperatures (Wang et al. 2011, DOI: 10.1021/jp204407d).\n",
"\n",
"In this tutorial, we show how to build an REST-capable OpenMM system. At the end, we show how to use OpenMMTools (https://github.com/choderalab/openmmtools) objects to run REST."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to link to the documentation (https://openmmtools.readthedocs.io) rather than the github repo.

@zhang-ivy
Copy link
Contributor Author

@peastman : Thanks so much for the feedback! I've addressed all your comments and pushed my changes.

@zhang-ivy zhang-ivy changed the title Add tutorial for building REST system Add tutorial for running REST Apr 19, 2023
@peastman
Copy link
Member

If this is based on code in perses, would it make sense to show how to do this using perses?

I guess the question is, how would you recommend that someone do this in practice? Would you recommend that they do everything from scratch as shown here? Or would you recommend that they use perses? Whichever approach is preferred, that's what the tutorial should show.

#16 is merged, so we now have tutorials folder. Can you move the file there?

@zhang-ivy
Copy link
Contributor Author

If this is based on code in perses, would it make sense to show how to do this using perses? I guess the question is, how would you recommend that someone do this in practice? Would you recommend that they do everything from scratch as shown here? Or would you recommend that they use perses? Whichever approach is preferred, that's what the tutorial should show.

This tutorial is inspired by a factory in perses, but the perses factory creates REST-capable alchemical systems only, and doesn't allow for REST-capable non-alchemical systems. This tutorial shows how to create the latter, which is much simpler.

I think ideally the code in this tutorial could be moved to openmmtools, but for the time being, I would recommend creating the system from scratch.

@peastman
Copy link
Member

Ok, sounds good. In that case, if you just move it to the tutorials folder I think it will be good to merge.

@zhang-ivy
Copy link
Contributor Author

Just moved the notebook (and made a copy of the required input PDB) in tutorials/. Also added the notebook path to tutorials.md

@peastman
Copy link
Member

I think that means it's ready to merge. Thank you!

@peastman peastman merged commit d160781 into openmm:main Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants