-
Notifications
You must be signed in to change notification settings - Fork 19
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
Protocol to run plain MD simulations #516
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #516 +/- ##
==========================================
- Coverage 92.82% 91.38% -1.44%
==========================================
Files 128 132 +4
Lines 8711 9114 +403
==========================================
+ Hits 8086 8329 +243
- Misses 625 785 +160
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@hmacdope MD stuff here |
Is this a |
Yes, this is intended for use with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super super late review - sorry @hannahbaumann
Finally got to looking at this last night. Overall this looks great thanks!
Just a couple of things, mostly some updates for changes that occured in main
.
Hello @hannahbaumann! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2023-12-28 00:03:29 UTC |
@hannahbaumann - I think I know what's going on with that runner, I'm just going to push an extra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still need to do a proper review later, but here's a couple of things re: the __init__.py
files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing in chunks to make it easier 😅 - here's the protocol results, just needs better return information.
"""String of trajectory file name""" | ||
traj = [pus[0].outputs['nc'] for pus in self.data.values()] | ||
|
||
return traj |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely not for this PR, but something we should consider next is getting access to the various other files (e.g. equilibration, etc...). Then we should expand to do things like getting energy values etc...
|
||
return None | ||
|
||
def get_traj_filename(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, could you put a return annotation on this and/or in the docstring so that folks can easily check what they are getting back?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this, does that look ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
second set of comments - protocol looks great, mostly a few comments about names in settings, but nothing major / that I think should significantly change
|
||
# Set barostat frequency to zero for NVT | ||
for x in simulation.context.getSystem().getForces(): | ||
if x.getName() == 'MonteCarloBarostat': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Future TODO (not in this PR): we should expand this to cover all the barostats (I assume it won't work with flexible/anisotropic/membrane, etc.. variants).
# Save last frame NPT equilibration | ||
positions = to_openmm( | ||
from_openmm(simulation.context.getState( | ||
getPositions=True, enforcePeriodicBox=False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curiosity question - I've not played around with enforcePeriodicBox
much, does it bring along significant advantages to disable it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I'm not sure, this might depend on what the user wants to do with the trajectory/structure?
False is the default here and means "the position of each particle will be whatever position is stored in the Context, regardless of periodic boundary conditions".
So if the users want to e.g. visualize the structure afterwards, they might want to first remove pbc/make things whole.
Do you have a preference here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't really expose this file currently, and it's likely only going to really get used for debugging purposes. I think it's probably fine to leave it as it is.
simulation.reporters.append(openmm.app.CheckpointReporter( | ||
file=str(shared_basepath / simulation_settings.checkpoint_storage), | ||
reportInterval=simulation_settings.checkpoint_interval.m)) | ||
simulation.reporters.append(openmm.app.StateDataReporter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: as discussed in a call a few weeks back, in a next PR we should hook up the results object to point to these and maybe have methods for reading data out for commonly needed things (reduced potential etc..)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the one question on tests, otherwise it looks good to me :)
Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the one thing, but otherwise this lgtm!
# Save last frame NPT equilibration | ||
positions = to_openmm( | ||
from_openmm(simulation.context.getState( | ||
getPositions=True, enforcePeriodicBox=False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't really expose this file currently, and it's likely only going to really get used for debugging purposes. I think it's probably fine to leave it as it is.
Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com>
Going ahead with a merge here - waiting on this longer will hold up, amongst other things, #614 |
Thanks so much for getting this done @hannahbaumann ! |
Developers certificate of origin