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

compound.to_parmed() stopping early in ancestor hierarchy (ancestor override functionality) #370

Open
ahy3nz opened this issue Jun 20, 2017 · 2 comments

Comments

@ahy3nz
Copy link
Contributor

ahy3nz commented Jun 20, 2017

For example: level 3 (ancestor) -> level 2 -> level 1 (particle). Level 3 and level 2 are passed to residues arg, so particle adopts the level 2 residue name, not the level 3 residue name. Within the same overall system, level 2 might actually be the desired residue name. This might require an "ancestor override" where residue names located higher up on the hierarchy override the lower ones (so that level 3 is preferred over level 2)

@ctk3b
Copy link
Member

ctk3b commented Jun 21, 2017

Could you give a specific piece of code that reproduces this and what specifically the other option would produce?

@loganguy11
Copy link

The issue arose when I was trying to create a .gro file for the Bilayer Builder. In my current mb.Compound hierarchy, some atoms in my DSPC molecules were being labelled improperly. This is because my DSPC is composed of a head group (written as a python class PCHead()) and tail group (PCTails()); the PCTails class is also composed partially of free fatty acids (FFA()).

The problem arises when I instantiate a Bilayer class (at the bottom of attached file bilayer.py) composed of DSPC and FFA molecules. When I create the .gro file (also attached), it can be seen that some of the atoms in the DSPC molecules get assigned to a residue of FFAUA, not DSPC as they should.

We believe the issue is due to lines 1717-8 of compound.py; by looping through atom.ancestors() and breaking the loop as soon as the first ancestor that exists in residues is found, we are failing to account for the possibility that an atom may have more than one ancestor which is contained in residues. The solution would ideally produce, in my case, a .gro file where all atoms in the DSPC molecule are assigned to the correct residue (DSPC, not FFAUA).
bilayer.py.zip
DSPC_0.5_FFAUA_0.5_UA.gro.zip

NOTE: This issue is resolved by simply changing the name attribute of the FFAUA compound when it is added to the DSPC compound, but it could be beneficial to have functionality built into mBuild that prevents users from having to do that in the future.

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

No branches or pull requests

3 participants