mosdef-hub / foyer

A package for atom-typing as well as applying and disseminating forcefields
https://foyer.mosdef.org
MIT License
117 stars 76 forks source link

Improper dihedral coefficients in oplsaa.xml #509

Closed HUANGZR86 closed 5 months ago

HUANGZR86 commented 2 years ago

Dear developer,

I am using the default oplsaa.xml force field with customized atom types on my molecule "CCC[S+]1CCCC1". However, all the improper dihedrals cannot be parameterized.

image

In this case, will there be any problem with my MD simulation if these improper parameters are missing? Or how can I find and add those improper coefficients?

Can you give me some advice to deal with it?

Best wishes, Ziru

HUANGZR86 commented 2 years ago

More specifically, is there any symbol that stands for all atom classes in foyer, e.g. class="*", similar to the atom class 0 in the Tinker OPLSAA.prm ?

image

daico007 commented 2 years ago

Usually, we only expect improper parameters for ring structure, so for the molecule you have above, that may be necessary. Unfortunately, I don't think our current oplsaa.xml has any impropers in it (but you can add those in to your local xml file). And to present a wildcard (that can take any atom classes), you just leave it as an empty string, for example:

<Proper class1="CA" class2="CA" class3="N" class4="" c0="8.7864" c1="0.0" c2="-8.7864" c3="0.0" c4="0.0" c5="0.0"/>

Here, class4 is a wildcard.

HUANGZR86 commented 2 years ago

Thank you very much for the reply. I am now adding the OPLSAA improper parameters from Gromacs ffbonded.itp to my xml file as:

`

`

I think the improper dihedral with ids (0, 1, 8, 9) and types ['opls_135', 'opls_136', 'opls_140', 'opls_140'], which is CT-CT-HC-HC, should be able to be parameterized. However, the error message of missing dihedral still appears. Is it because I am using the RB torsion so foyer processes those improper as propers?

HUANGZR86 commented 2 years ago

<Improper class1="CT" class2="" class3="" class4="" c0="9.20480" c1="0.00000" c2="-9.20480" c3="0.00000" c4="0.00000" c5="0.00000"/>

bc118 commented 2 years ago

RB torsions are regular dihedrals, not impropers, so you need to add those parameters. This is expected because it appears you are adding atom types to the XML file. Also, yes, the * is the wildcard symbol in the XML files.

HUANGZR86 commented 2 years ago

Thank you for the reply. However, I tried the wildcards "", " ", and "*", but none of them can work.

<Improper class1="*" class2="*" class3="*" class4="*" c0="9.20480" c1="0.00000" c2="-9.20480" c3="0.00000" c4="0.00000" c5="0.00000"/> <Improper class1=" " class2=" " class3=" " class4=" " c0="9.20480" c1="0.00000" c2="-9.20480" c3="0.00000" c4="0.00000" c5="0.00000"/> <Improper class1="" class2="" class3="" class4="" c0="9.20480" c1="0.00000" c2="-9.20480" c3="0.00000" c4="0.00000" c5="0.00000"/>

bc118 commented 2 years ago

I understand.
From my understanding, but I can not be sure for every writer and engine...., dihedral and improper wildcards are only accepted with wildcards in these locations.

If this does not work, it may be that the specific file writer (for GROMACS or LAMMPS, ...) is not supporting the "*" symbol as a wildcard. In this case, you can just add in all the combinations and it will work. like: CT-CT-NT-CT CT-CT-CT-NT etc