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

[BUG] Dummy atom atomtypes are no longer written to GROMACS topology files #306

Closed
akalpokas opened this issue Jun 24, 2024 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@akalpokas
Copy link
Contributor

Describe the bug
It seems that dummy atom atomtypes are no longer written to GROMACS topology files, which might have been caused by some of the recent changes to the dummy atom code (not outputting them when LJ params are 0?). When looking at a GROMACS input file, I can see:

[ atomtypes ]
; name      at.num        mass      charge   ptype       sigma     epsilon
    2C           6   12.010700    0.000000       A    0.339967    0.457730
    3C           6   12.010700    0.000000       A    0.339967    0.457730
     C           6   12.010700    0.000000       A    0.339967    0.359824
    C8           6   12.010700    0.000000       A    0.339967    0.457730
    CA           0    0.000000    0.000000       A    0.339967    0.000000
    CC           6   12.010700    0.000000       A    0.339967    0.359824
    CO           6   12.010700    0.000000       A    0.339967    0.359824
    CR           6   12.010700    0.000000       A    0.339967    0.359824
    CT           6   12.010700    0.000000       A    0.339967    0.457730
    CW           6   12.010700    0.000000       A    0.339967    0.359824
    CX           6   12.010700    0.000000       A    0.339967    0.457730
     H           1    1.007940    0.000000       A    0.106908    0.065689
    H1           1    1.007940    0.000000       A    0.247135    0.065689
    H4           1    1.007940    0.000000       A    0.251055    0.062760
    H5           1    1.007940    0.000000       A    0.242146    0.062760
    HA           1    1.007940    0.000000       A    0.259964    0.062760
    HC           1    1.007940    0.000000       A    0.264953    0.065689
    HO           1    1.007940    0.000000       A    0.000000    0.000000
    HP           1    1.007940    0.000000       A    0.195998    0.065689
    HS           1    1.007940    0.000000       A    0.106908    0.065689
    Hx           0    0.000000    0.000000       A    0.106908    0.000000
     N           7   14.006700    0.000000       A    0.325000    0.711280
    N2           0    0.000000    0.000000       A    0.325000    0.000000
    N3           7   14.006700    0.000000       A    0.325000    0.711280
    NA           7   14.006700    0.000000       A    0.325000    0.711280
    NB           7   14.006700    0.000000       A    0.325000    0.711280
     O           8   15.999400    0.000000       A    0.295992    0.878640
    O2           8   15.999400    0.000000       A    0.295992    0.878640
    OH           8   15.999400    0.000000       A    0.306647    0.880314
     S          16   32.065000    0.000000       A    0.356359    1.046000
    SH          16   32.065000    0.000000       A    0.356359    1.046000

Whereas with my previous input files saved with an older BioSimSpace version (about 2-3 weeks ago):

[ atomtypes ]
; name      at.num        mass      charge   ptype       sigma     epsilon
    2C           6   12.010700    0.000000       A    0.339967    0.457730
 2C_du           0    0.000000    0.000000       A    0.000000    0.000000
    3C           6   12.010700    0.000000       A    0.339967    0.457730
     C           6   12.010700    0.000000       A    0.339967    0.359824
    C8           6   12.010700    0.000000       A    0.339967    0.457730
    CA           6   12.010700    0.000000       A    0.339967    0.359824
    CC           6   12.010700    0.000000       A    0.339967    0.359824
    CO           6   12.010700    0.000000       A    0.339967    0.359824
 CO_du           0    0.000000    0.000000       A    0.000000    0.000000
    CR           6   12.010700    0.000000       A    0.339967    0.359824
    CT           6   12.010700    0.000000       A    0.339967    0.457730
    CW           6   12.010700    0.000000       A    0.339967    0.359824
    CX           6   12.010700    0.000000       A    0.339967    0.457730
    Cl          17   35.453000    0.000000       A    0.440104    0.418400
     H           1    1.007940    0.000000       A    0.106908    0.065689
    H1           1    1.007940    0.000000       A    0.247135    0.065689
    H4           1    1.007940    0.000000       A    0.251055    0.062760
    H5           1    1.007940    0.000000       A    0.242146    0.062760
    HA           1    1.007940    0.000000       A    0.259964    0.062760
    HC           1    1.007940    0.000000       A    0.264953    0.065689
 HC_du           0    0.000000    0.000000       A    0.000000    0.000000
    HO           1    1.007940    0.000000       A    0.000000    0.000000
    HP           1    1.007940    0.000000       A    0.195998    0.065689
    HS           1    1.007940    0.000000       A    0.106908    0.065689
    HW           1    1.007940    0.000000       A    0.000000    0.000000
 HW_du           0    0.000000    0.000000       A    0.000000    0.000000
     N           7   14.006700    0.000000       A    0.325000    0.711280
    N2           7   14.006700    0.000000       A    0.325000    0.711280
    N3           7   14.006700    0.000000       A    0.325000    0.711280
    NA           7   14.006700    0.000000       A    0.325000    0.711280
    NB           7   14.006700    0.000000       A    0.325000    0.711280
    Na          11   22.989770    0.000000       A    0.332840    0.011590
     O           8   15.999400    0.000000       A    0.295992    0.878640
    O2           8   15.999400    0.000000       A    0.295992    0.878640
 O2_du           0    0.000000    0.000000       A    0.000000    0.000000
    OH           8   15.999400    0.000000       A    0.306647    0.880314
    OW           8   15.999400    0.000000       A    0.315061    0.636386
     S          16   32.065000    0.000000       A    0.356359    1.046000
    SH          16   32.065000    0.000000       A    0.356359    1.046000

The dummy atoms themselves are still written to the [atoms] directive in the topology file (as before), they are just missing in the [atomtypes] directive

Without the dummy atom types, grompp will refuse to solvate input files containing dummy atoms, so this bug also breaks the Hydration free energy tutorial code.

To Reproduce
This can be quickly tested using:

import BioSimSpace as BSS
ethane = BSS.Parameters.gaff("CC").getMolecule()
methanol = BSS.Parameters.gaff("CO").getMolecule()
mapping = BSS.Align.matchAtoms(ethane, methanol)
ethane = BSS.Align.rmsdAlign(ethane, methanol, mapping)
merged = BSS.Align.merge(ethane, methanol, mapping)
solvated = BSS.Solvent.tip3p(molecule=merged, box=3 * [5 * BSS.Units.Length.nanometer])
  • OS: Ubuntu 22.04 LTS
  • Version of Python: 3.11.7
  • Version of BioSimSpace: 2024.2.0.dev+70.g2af4e967.dirty
@akalpokas akalpokas added the bug Something isn't working label Jun 24, 2024
@lohedges
Copy link
Contributor

lohedges commented Jun 24, 2024

Could you update sire. This was a bug there. The LJParameters object has an isDummy method that was only returning true if both the sigma and epsilon value were zero, which is no longer the case for dummy atoms. This went in as part of another PR, so might not have been obvious.

@lohedges
Copy link
Contributor

For reference, this issue was mention in the LJ sigma PR here.

@akalpokas
Copy link
Contributor Author

Yes, that fixed the issue, thanks! I had to rebuild my BSS conda environment from scratch because for some reason it wouldn't allow updating to a newest sire version (apparently 2024.1.0.dev was the latest it could support).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants