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

foyer.forcefield.apply does not carry over atomic_number information from the input structure #466

Open
jennyfothergill opened this issue Sep 28, 2021 · 0 comments

Comments

@jennyfothergill
Copy link
Contributor

Bug summary

I am using mbuild/foyer in a workflow in planckton. We have a couple older input mol2 files which were typed with antechamber, and for these the particle name will match the type name in a gaff (custom) forcefield. The element in the compound is manually set, and this transfers to the parmed structure, but when the apply function is used, the atomic number is not carried over from the input structure.

Code to reproduce the behavior

I'm using the example I described from planckton--if needed, I can work up a simpler example.

from planckton.compounds import COMPOUND
from planckton.forcefields import FORCEFIELD
from planckton.init import Compound

p3ht = Compound(COMPOUND["P3HT-16-gaff"])
gaff = FORCEFIELD["gaff-custom"]
residues = [p3ht.name]
pmd = p3ht.to_parmed(residues=residues)
s = gaff.apply(pmd, assert_dihedral_params=False)

p0 = [p for p in p3ht.particles()][0]
a0 = [a for a in pmd.atoms][0]
s0 = [a for a in s.atoms][0]
print(p0.name, p0.element.atomic_number)
print(a0.name, a0.atomic_number)
print(s0.name, s0.atomic_number)

output:

_cc 6
_cc 6
_cc 0

Software versions

NOTE: The below template should have dunder around version:

  • Which version of Foyer are you using? (python -c "import foyer; print(foyer.__version__)")
    0.9.4
  • Which version of Python (python --version)?
    Python 3.7.11
  • Which operating system?
    CentOS Linux release 7.8.2003 (Core)
jennyfothergill added a commit to jennyfothergill/planckton that referenced this issue Sep 28, 2021
- foyer.Forcefield.apply does not carry over the set atomic_number info
from the pmd_structure. mosdef-hub/foyer/issues/466 This workaround will
fix it.
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

1 participant