Created
November 11, 2019 15:15
-
-
Save rmatsum836/963aeacd7936775be58b33e14e7449ce to your computer and use it in GitHub Desktop.
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
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