Code Monkey home page Code Monkey logo

Comments (13)

chrisiacovella avatar chrisiacovella commented on July 22, 2024

This isn't an issue with the Foyer code itself, rather that there are 6 dihedrals found in the molecule that haven't been found in the forcefield xml file. I.e., they need to be defined by haven't yet.

I'll note that in some cases you may have quartets that don't require dihedral parameters (especially for CHARMM as the dihedral parameters are corrections to the 1-4 interactions not a replacement). If that is the case, then you'd just want to modify your apply call to tell it to ignore this (i.e., raise a warning, but not throw an error):

typed_gly = charmm.apply(gly,verbose=True, assert_dihedral_params=False)

Bonds, angles, dihedrals, and impropers each have an associated assert flag that can be set (i.e., assert_bond_params, assert_angle_params, assert_dihedral_params, assert_improper_params). This is especially useful as, e.g., a CG forcefield might not need to define dihedral or angle parameters or one might use fictitious bonds in mbuild to orient building blocks in the system, but not want them to be actually chemically bound. See the documentation about this

I'm going to close this issue as it appears the code is functioning as expected, but send me a message if you have more questions.

from foyer.

CalCraven avatar CalCraven commented on July 22, 2024

@chrisiacovella I think there is more going on here than meets the eye. All of the missing dihedrals seem to be found in the forcefield. Additionally, the atomtyping works using the GMSO methodology:

from forcefield_utilities import FoyerFFs
loader = FoyerFFs()
gmso_ff = loader.load('ffs/charmm_foyer/glycine.xml').to_gmso_ff()
from gmso.parameterization import apply
from gmso.external.convert_mbuild import from_mbuild
gmso_top = from_mbuild(gly) #object created using above recipe
apply(gmso_top, gmso_ff, identify_connections=True)
print(gmso_top.is_typed)

Since this seems to work properly, there seems to be something more than just missing parameters causing the openmm issues seen here. I can spend a little bit of time better showing the dihedrals in the forcefield, and the identities of the missing dihedrals.

from foyer.

daico007 avatar daico007 commented on July 22, 2024

I checked this XML manually and the dihedral is actually there (for example: <Proper class1="O" class2="C" class3="CT2" class4="NH1" periodicity1="1" phase1="0.0" k1="0.0" />), but was just not being found. This might be on the foyer side (or our use of openmm/parmed).

from foyer.

kierannp avatar kierannp commented on July 22, 2024

glycine.txt

from foyer.

kierannp avatar kierannp commented on July 22, 2024

Heres the xml for this molecule

from foyer.

bc118 avatar bc118 commented on July 22, 2024

I added the line to the PeriodicTorsionForce and it still errors out with a missing dihedral

Proper class1="" class2="" class3="" class4="" periodicity1="1" phase1="0" k1="0"

from foyer.

chrisiacovella avatar chrisiacovella commented on July 22, 2024

Ah I was too quick in closing. So this is a ParmEd issue we have run into in the past. If the dihedral has all the phase parameters set to 0 (i.e., it doesn't modify anything), ParmEd ignores them. The check_dihedrals function does not ignore them and throws an error.

from foyer.

bc118 avatar bc118 commented on July 22, 2024

I added phase1="3.141592653589793" to all the ones with k1=0 and this error is the same as before, so I'm not sure this is the issue, provided this is what you meant

from foyer.

chrisiacovella avatar chrisiacovella commented on July 22, 2024

regardless of what you set phase1 to be if k1 is hero it doesn't modify it in anyway, so ParmEd ignores it.

from foyer.

bc118 avatar bc118 commented on July 22, 2024

OK, yeah it works if I change K=1 to K=0.0000000001 for ones with only 1 K-value

from foyer.

bc118 avatar bc118 commented on July 22, 2024

@chrisiacovella good call !!!

from foyer.

bc118 avatar bc118 commented on July 22, 2024

See the file for K=1 to K=0.0000000001 for ones with only 1 K-value

glycine_mod_ks_to_near_0_values.txt

from foyer.

bc118 avatar bc118 commented on July 22, 2024

This solution seems to work so I am closing this issue

from foyer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.