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 MD simulations #97

Merged
merged 12 commits into from Mar 27, 2024
Merged

Add tutorial for MD simulations #97

merged 12 commits into from Mar 27, 2024

Conversation

hannahbaumann
Copy link
Contributor

No description provided.

Copy link

Binder 👈 Launch a binder notebook on branch OpenFreeEnergy/ExampleNotebooks/md_cookbook

@hannahbaumann
Copy link
Contributor Author

I added this as a tutorial, but could also be a cookbook instead.

@RiesBen RiesBen self-requested a review February 21, 2024 12:20
@RiesBen RiesBen added the enhancement New feature or request label Feb 21, 2024
@IAlibay
Copy link
Contributor

IAlibay commented Mar 4, 2024

Just cycling this PR in the hope that reviewnb kicks in.

@IAlibay IAlibay closed this Mar 4, 2024
@IAlibay IAlibay reopened this Mar 4, 2024
@@ -0,0 +1,369 @@
{
Copy link
Contributor

@IAlibay IAlibay Mar 4, 2024

Choose a reason for hiding this comment

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

[enhancement]

What would be super useful here is some kind of rough table of how the protocol works like

  1. Input handling using gufe
  2. Parameterization using OpenMMForceFields & OpenFF
  3. OpenMM object creation
  4. Minimization
  5. NVT equilibration (if not gas phase)
  6. NPT equilibration (if not gas phase)
  7. NPT production (if not gas phase)

The table could have the columns "step", "software used", and "outputs". That way folks know what files come out of which steps.


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a table describing these steps.

@@ -0,0 +1,369 @@
{
Copy link
Contributor

@IAlibay IAlibay Mar 4, 2024

Choose a reason for hiding this comment

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

We can probably go without the "when creating the OpenMM simulation objects" since those aren't exposed to users.


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this

@@ -0,0 +1,369 @@
{
Copy link
Contributor

@IAlibay IAlibay Mar 4, 2024

Choose a reason for hiding this comment

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

1)

The bullet points go from 8 to 10 (also there's a weird indentation for 10).

If you felt like it, it might be worth seeing if a table format might be cleaner here (but that's really just if you want to play around with formatting).

2)

"not the entire system with all the atoms should be saved" - a bit nitpicky, but this is a bit difficult to read because of the "not". Maybe "Special output indices can be defined to select which portions of the system should be saved" (it's the same but without the "not"). We should also make it clear as to what the default is (I think it's "not water"?)

It would be good to highlight the specific attributes that would need changing if possible. e.g. output_indices.


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good idea! I moved the bullet points into a table, changed the sentence to your suggestion and changed some of the descriptions to highlight the code attributes. I hope this is intuitive for the user.

@@ -0,0 +1,369 @@
{
Copy link
Contributor

@IAlibay IAlibay Mar 4, 2024

Choose a reason for hiding this comment

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

Line #6.    settings.simulation_settings.equilibration_length_nvt = 0.01 * unit.nanosecond

[enhancement]

To help the reader, it may be worth adding inline comments here about what these are doing?

Something along the lines of "# setting the nvt equilibration length to 0.1 ps"


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this!

openmm_md/plain_md.ipynb Show resolved Hide resolved
openmm_md/plain_md.ipynb Show resolved Hide resolved
openmm_md/plain_md.ipynb Show resolved Hide resolved
@@ -0,0 +1,369 @@
{
Copy link
Contributor

@IAlibay IAlibay Mar 4, 2024

Choose a reason for hiding this comment

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

It might be good to give a final look at what files were created (i.e. the output of an ls), and maybe a comment about if you set protocol_repeats to >1 then you will get N full replicates of these outputs?


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this!

@@ -0,0 +1,369 @@
{
Copy link
Contributor

@IAlibay IAlibay Mar 4, 2024

Choose a reason for hiding this comment

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

1)

I'd remove the output from this cell folks might get confused as to why it's CPU only :P

2)

[enhancement]

You could possibly add a "performance consideration" section - something along the lines of "if you're running gas phase, then we suggest setting OPENMM_CPU_THREADS to 1".


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this!

Copy link
Contributor

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

Thanks so much for working on this @hannahbaumann !

I've added some comments via reviewnb (it's an app that sits on top of github to help augment jupyter notebook reviews). If you click on the Reply via ReviewNB link then it'll take you to a place where you can more easily review comments.

Anything that's tagged [enhancement] is me saying "this would be nice to have but not an obligation if you don't want to think about it here".

@@ -0,0 +1,369 @@
{
Copy link
Contributor

@RiesBen RiesBen Mar 4, 2024

Choose a reason for hiding this comment

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

Optional: can we add a simple complex picture here?

  • I could make one for you :)

Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yes, that would be great if you can make a pretty picture for this!

Copy link
Contributor

Choose a reason for hiding this comment

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

added :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, this looks great!

@@ -0,0 +1,369 @@
{
Copy link
Contributor

@RiesBen RiesBen Mar 4, 2024

Choose a reason for hiding this comment

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

short comment on: why is this useful? what can it be used for?

  • Maybe you only want to see quickly the dynamics of a system.
  • or want to pre equilibrate a given complex in order to use it for FEs later.


Reply via ReviewNB

@@ -0,0 +1,369 @@
{
Copy link
Contributor

@RiesBen RiesBen Mar 4, 2024

Choose a reason for hiding this comment

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

Line #1.    transformation = openfe.Transformation(

could we use a NonTransformation gufe class here?

That way we could get rid of SystemB :)


Reply via ReviewNB

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, I changed this!

@RiesBen
Copy link
Contributor

RiesBen commented Mar 4, 2024

Hi @hannahbaumann this is a really cool PR, I like it a lot!

I will try it out know directly on my machine and let you know how things go :)

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@@ -0,0 +1,428 @@
{
Copy link
Contributor

@IAlibay IAlibay Mar 5, 2024

Choose a reason for hiding this comment

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

This doesn't seem to be rendering properly on my end - are you getting the same thing?


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screen Shot 2024-03-05 at 1 54 28 PM This is what it looks like for me! Is it different for you?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah it's showing as a broken table on preview (by comparison the showcase notebook looks fine).

The second table now looks fine after your latest commit though!

Copy link
Contributor

Choose a reason for hiding this comment

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

Quick test in #116 - looks like the table is missing a | at the end of each row starting from the third row? Adding those in makes the render work.

Copy link
Contributor

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

Thanks for addressing all the comments!

Only thing left on my end is that the tables don't seem to render properly - I'm not sure if it's just me though.

@hannahbaumann
Copy link
Contributor Author

Merged in your fix of the table!

@hannahbaumann
Copy link
Contributor Author

Only thing missing would be a pretty complex picture, if @RiesBen you have one, it would be great if you can add it, but this is something that would be nice to have but not required for merging.

a complex picture :)
testing adding the complex image
@IAlibay
Copy link
Contributor

IAlibay commented Mar 22, 2024

@mikemhenry do you have any idea what's going on with that container build step?

@richardjgowers richardjgowers self-assigned this Mar 25, 2024
@IAlibay
Copy link
Contributor

IAlibay commented Mar 27, 2024

@richardjgowers you are assigned here - can we go ahead and merge this so we can resolve OpenFreeEnergy/openfe#781?

@richardjgowers richardjgowers merged commit 60e9636 into main Mar 27, 2024
4 checks passed
@richardjgowers richardjgowers deleted the md_cookbook branch March 27, 2024 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants