Skip to content

Instantly share code, notes, and snippets.

@rmatsum836
Created November 11, 2019 15:15
Show Gist options
  • Save rmatsum836/963aeacd7936775be58b33e14e7449ce to your computer and use it in GitHub Desktop.
Save rmatsum836/963aeacd7936775be58b33e14e7449ce to your computer and use it in GitHub Desktop.
def apply_multiple_forcefields(compound, residue_dict):
"""
Applies multiple forcefields to a mb.Compound
Parameters
----------
compound: mb.Compound
residue_dict: dict
Dictionary containing residues (key) and foyer Forcefields (value) pairs
Returns
-------
pmd.Structure: Parameterized ParmEd structure
"""
system = pmd.Structure()
for child in compound.children:
if child.name in residue_dict.keys():
system += residue_dict[child.name].apply(child)
system.box = [0, 0, 0, 90, 90, 90]
system.box[:3] = compound.periodicity
return system
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment