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

phosaa14SB.xml KeyError and Resolution #234

Closed
jhmlam opened this issue Oct 10, 2021 · 2 comments
Closed

phosaa14SB.xml KeyError and Resolution #234

jhmlam opened this issue Oct 10, 2021 · 2 comments

Comments

@jhmlam
Copy link

jhmlam commented Oct 10, 2021

Dear Team,

First of all, thank you for taking efforts in reproducing a forcefield for phosphorylation.
When I try to access phosaa14SB.xml through the following commands, it throws a KeyError for "CX"


DIR_Openmmforcefield = 'openmmforcefields-master/'
from openmm.app import ForceField
forcefield = ForceField(
                        DIR_Openmmforcefield + 'amber/ffxml/phosaa14SB.xml'
)

The error seems to be resolved by defining the mass of the following atomtypes in the xml

    <Type element="C" name="CX" class="CX" mass="12.01"/>
    <Type element="C" name="2C" class="2C" mass="12.01"/>
    <Type element="C" name="3C" class="3C" mass="12.01"/>

Could you please confirm the correctness?

Thanks.

@jchodera
Copy link
Member

Thanks for reporting this!

The phosaa14SB.xml force field is intended to be used with ff14SB.xml, which provides the CX and other atom types.

Can you try changing

forcefield = ForceField(
                        DIR_Openmmforcefield + 'amber/ffxml/phosaa14SB.xml'
)

to

forcefield = ForceField(
                        DIR_Openmmforcefield + 'amber/ffxml/ff14SB.xml',
                        DIR_Openmmforcefield + 'amber/ffxml/phosaa14SB.xml'
)

to see if that helps?

Also, you shouldn't need to specify the directory if you have installed openmmforcefields via the conda or Python package. If you have done so, this should work:

forcefield = ForceField('amber/ff14SB.xml', 'amber/phosaa14SB.xml')

since it should auto-search the paths using the plugin support.

@jhmlam
Copy link
Author

jhmlam commented Oct 10, 2021

Yes, it works. Thank you! (I should have used compatible ff14SB rather than ff99SB)

@jhmlam jhmlam closed this as completed Oct 10, 2021
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

2 participants