-
Notifications
You must be signed in to change notification settings - Fork 80
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
[WIP] Solvent-solute splitting #439
Open
maxentile
wants to merge
18
commits into
main
Choose a base branch
from
gbaoab-mts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
fee50cd
ignore pycharm
maxentile 143e067
add utility for generating solvent-solute splitting string
maxentile 3fe3b6b
add force factory for solvent-solute-splitting using exceptions
maxentile 40bc8ed
[WIP] add example script for g-BAOAB using solvent-solute splitting
maxentile 00dde8d
rename
maxentile 1d803c3
another attempt to split nonbonded force using subtraction
maxentile b503ebf
add tests (currently failing!)
maxentile a380cf1
Modified split_nb_using_exceptions
c-matthews c0a28e1
Added some results for g-baoab
c-matthews 7be2611
use CutoffPeriodic in nb_split tests
maxentile ac330ab
generate a slightly different conformation for testing
maxentile 8ec3266
update clone_nonbonded_parameters fxn
maxentile b30ae5e
add `split_nb_using_interaction_groups` fxn
maxentile fb0ce28
remove redundant imports
maxentile 458ebea
modified forces weren't in fact being added to the system!
maxentile 05b735a
don't use dispersion correction in test_split_nb_*
maxentile 256f190
allow cutoff and switching distance to be modified when splitting nb …
maxentile be65ec6
attempted simplification of interaction-group splitting
maxentile File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
update clone_nonbonded_parameters fxn
- Loading branch information
commit 8ec3266a7c30ec4622a13e7137652b62e8e66a84
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,7 +184,9 @@ def clone_nonbonded_parameters(nonbonded_force, | |
"""Creates a new CustomNonbonded force with the same global parameters, | ||
per-particle parameters, and exception parameters as """ | ||
|
||
#TODO: assert that nonbonded_force.getNonbondedMethod() indicates reaction field | ||
allowable_nb_methods = {openmm.NonbondedForce.CutoffPeriodic, openmm.NonbondedForce.CutoffNonPeriodic} | ||
assert(nonbonded_force.getNonbondedMethod() in allowable_nb_methods) | ||
|
||
|
||
# call constructor | ||
# The 'energy_prefactor' allows us to easily change sign, or e.g. halve the energy if needed | ||
|
@@ -193,24 +195,26 @@ def clone_nonbonded_parameters(nonbonded_force, | |
new_force.addPerParticleParameter('sigma') | ||
new_force.addPerParticleParameter('epsilon') | ||
|
||
|
||
# go through all of the setter and getter methods | ||
new_force.setCutoffDistance(nonbonded_force.getCutoffDistance()) | ||
#new_force.setEwaldErrorTolerance(nonbonded_force.getEwaldErrorTolerance()) | ||
#new_force.setForceGroup(nonbonded_force.getForceGroup()) | ||
#new_force.setNonbondedMethod(nonbonded_force.getNonbondedMethod()) # If PME, will be an Illegal value for CustomNonbonded | ||
new_force.setNonbondedMethod(nonbonded_force.getNonbondedMethod()) | ||
#new_force.setPMEParameters(*nonbonded_force.getPMEParameters()) | ||
#new_force.setReactionFieldDielectric(nonbonded_force.getReactionFieldDielectric()) | ||
#new_force.setReciprocalSpaceForceGroup(nonbonded_force.getReciprocalSpaceForceGroup()) | ||
new_force.setSwitchingDistance(nonbonded_force.getSwitchingDistance()) | ||
#new_force.setUseDispersionCorrection(nonbonded_force.getUseDispersionCorrection()) | ||
new_force.setUseSwitchingFunction(nonbonded_force.getUseSwitchingFunction()) | ||
new_force.setSwitchingDistance(nonbonded_force.getSwitchingDistance()) | ||
new_force.setUseLongRangeCorrection(nonbonded_force.getUseDispersionCorrection()) | ||
|
||
|
||
# now add all the particle parameters | ||
num_particles = nonbonded_force.getNumParticles() | ||
for i in range(num_particles): | ||
new_force.addParticle(nonbonded_force.getParticleParameters(i)) | ||
|
||
# now add all the exceptions | ||
# now add all the exceptions? # TODO: check if we want to do this... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you definitely want to copy all exceptions -> exclusions, or else you'll end up in NaNdyland. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do! |
||
# for exception_index in range(nonbonded_force.getNumExceptions()): | ||
# new_force.addException(nonbonded_force.getExceptionParameters(exception_index)) | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The nobonded methods may not directly translate from NonbondedForce to CustomNonbondedForce.
See: https://github.com/choderalab/openmmtools/blob/master/openmmtools/alchemy.py#L1488-L1491
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.
Thanks! Will follow this example more closely