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

Incorrect atom types in PSF when using gaff.xml #328

Open
jpotoff opened this issue Mar 10, 2020 · 3 comments
Open

Incorrect atom types in PSF when using gaff.xml #328

jpotoff opened this issue Mar 10, 2020 · 3 comments

Comments

@jpotoff
Copy link

jpotoff commented Mar 10, 2020

@rsdefever

I'm continuing my quest to develop some robust workflows for GOMC and found some strange behavior when loading gaff.xml and using it to assign parameters. The parameter file that is produced looks fine, but in the PSF file, the atom types (column 6 in the PSF), and partial charges are set incorrectly.

I'm a bit mystified as to where C3LTU and HCLTU (atom types) are coming from, since they are nowhere to be found in gaff.xml. Thoughts?

test.zip

@rsdefever
Copy link
Member

rsdefever commented Mar 10, 2020

Partial charges in GAFF come from RESP --> so all the partial charges in gaff.xml are set to 0.0. antefoyer can call antechamber to extract AM1-BCC charges. Writing a QM+RESP module for MoSDeF is on my radar. If this is something you are also interested in we should chat.

The C3LTU atom types are a bit more mysterious. They seem to be added by the .save function (this is a parmed function.

Here is a minimal example:

import mbuild
import foyer

ff=foyer.Forcefield(forcefield_files='gaff.xml')
ethanol = mbuild.load("CCO", smiles=True)
ethanol_param=ff.apply(ethanol, assert_dihedral_params=False, verbose=False)

print(ethanol_param[0].type)

ethanol_param.save('ethanol.psf', overwrite=True)

print(ethanol_param[0].type)

@ahy3nz
Copy link
Contributor

ahy3nz commented Mar 10, 2020

Quick glance at parmed, here and here

@jpotoff
Copy link
Author

jpotoff commented Mar 16, 2020

Quick glance at parmed, here and here


def _typeconv(name):
    if isinstance(name, integer_types):
        return name
    if name.upper() == name:
        return name.replace('*', 'STR').replace('+', 'P').replace('-', 'M')[:6]
    # Lowercase letters present -- decorate the type name with LTU --
    # Lower To Upper
    return ('%sLTU' % name.upper()).replace('*', 'STR').replace(
            '+', 'P').replace('-', 'M')[:6]

Ok, I have to say that's a bit weird. This has got to be a bug appending "LTU" to lower case atom types. Why would anyone want that behavior?

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