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 snapshot to mbuild Compound backmapping method #83

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

chrisjonesBSU
Copy link
Member

Right now, finegrain.py has a method that performs back mapping on an mBuild compound. This PR adds a method that performs the back mapping on a gsd.hoomd.Frame (i.e. Snapshot) and returns an mBuild compound.

Still a couple of things left to do:

  • Add doc strings
  • Add unit tests
  • Figure out if the in-situ energy minimization is working as expected, if not we can take it out
  • Add an example to the documentation.

@chrisjonesBSU
Copy link
Member Author

After chatting with @StephMcCallum there was some discussion about how to handle cases where two atoms need to be removed to form monomer-monomer bonds during fine-graining. A common example would be removing the -OH group from something like in polyalanine.

I suggested we keep the behavior as explicit as possible, so that it only ever removes particles you tell it to. To support removing multiple particles when needed, bond_head_index and bond_tail_index need to work if multiple indices are passed in. Then, to make this approach easier, we begin adding a library/database of common chemistries.

If we want to be less strict, we could add a check that if the particle given by one of the bond_x_index parameters is not a hydrogen, then automatically remove only any hydrogens that were also bonded to it.

particle.name != "H"
): # removes hydrogen when reacting group is -OH
remove_atoms.append(
[p for p in particle.direct_bonds()][1]
Copy link
Member Author

Choose a reason for hiding this comment

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

We need to be careful here. We should iterate through particle.direct_bonds() and make sure we are ony removing ones that are hydrogens.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants