[lammps-users] Problem with the charmm2lammps.pl perl script?

Hello

I think there is a problem with the charmm2lammps.pl perl script.

Below are snippets of either “recent” and “old” versions of the .rtf or .prm files.

Examples of “recent” par_all36_cgenff.prm andtop_all36_cgenff.rtf files:

ATOMS
!hydrogens
MASS -1 HGA1 1.00800 ! alphatic proton, CH
MASS -1 HGA2 1.00800 ! alphatic proton, CH2
MASS -1 HGA3 1.00800 ! alphatic proton, CH3
MASS -1 HGA4 1.00800 ! alkene proton; RHC=
MASS -1 HGA5 1.00800 ! alkene proton; H2C=CR
MASS -1 HGA6 1.00800 ! aliphatic H on fluorinated C, monofluoro
MASS -1 HGA7 1.00800 ! aliphatic H on fluorinated C, difluoro
MASS -1 HGAAM0 1.00800 ! aliphatic H, NEUTRAL trimethylamine (#)
MASS -1 HGAAM1 1.00800 ! aliphatic H, NEUTRAL dimethylamine (#)
MASS -1 HGAAM2 1.00800 ! aliphatic H, NEUTRAL methylamine (#)
!(#) EXTREME care is required when doing atom typing on compounds that look like this. Use ONLY
!on NEUTRAL METHYLAMINE groups, NOT Schiff Bases, but DO use on 2 out of 3 guanidine nitrogens
MASS -1 HGP1 1.00800 ! polar H
MASS -1 HGP2 1.00800 ! polar H, +ve charge
MASS -1 HGP3 1.00800 ! polar H, thiol
MASS -1 HGP4 1.00800 ! polar H, neutral conjugated -NH2 group (NA bases)
MASS -1 HGP5 1.00800 ! polar H on quarternary ammonium salt (choline)
MASS -1 HGPAM1 1.00800 ! polar H, NEUTRAL dimethylamine (#), terminal alkyne H
MASS -1 HGPAM2 1.00800 ! polar H, NEUTRAL methylamine (#)
MASS -1 HGPAM3 1.00800 ! polar H, NEUTRAL ammonia (#)

Examples of “older” versions of par_all36_cgenff.prm and op_all36_cgenff.rtf files:

!hydrogens
MASS 256 HGA1 1.00800 ! alphatic proton, CH
MASS 257 HGA2 1.00800 ! alphatic proton, CH2
MASS 258 HGA3 1.00800 ! alphatic proton, CH3
MASS 259 HGA4 1.00800 ! alkene proton; RHC=
MASS 260 HGA5 1.00800 ! alkene proton; H2C=CR
MASS 261 HGA6 1.00800 ! aliphatic H on fluorinated C, monofluoro
MASS 262 HGA7 1.00800 ! aliphatic H on fluorinated C, difluoro
MASS 263 HGAAM0 1.00800 ! aliphatic H, NEUTRAL trimethylamine (#)
MASS 264 HGAAM1 1.00800 ! aliphatic H, NEUTRAL dimethylamine (#)
MASS 265 HGAAM2 1.00800 ! aliphatic H, NEUTRAL methylamine (#)
!(#) EXTREME care is required when doing atom typing on compounds that look like this. Use ONLY
!on NEUTRAL METHYLAMINE groups, NOT Schiff Bases, but DO use on 2 out of 3 guanidine nitrogens
MASS 266 HGP1 1.00800 ! polar H
MASS 267 HGP2 1.00800 ! polar H, +ve charge
MASS 268 HGP3 1.00800 ! polar H, thiol

The files have changed format: MASS -1 (new) <----> MASS integer (old)

There may be more changes between the new and old parameter/RTF files as well.

What is insidious is that the examples in the subdirectories have the old files in them, and they work perfectly with the current version of the charmm2lammps.pl perl script

However, in making my own test case with new parameter and RTF files, the script failed.

The charmm2lammps.pl perl script does not seem to be parsing the newly formatted files correctly.

Thanks so much for your help with this.

Kind regards,

Angelo

Angelo,

your observation is confirmed. the charmm2lammps.pl script seems to be dependent on the enumeration of atom types in the MASS lines and thus gets confused if there is a -1.

you have to understand that this is a very old script (written about 15 years ago) and has seen very few changes since. the most notable is the addition of support for CMAP.
but it mainly assumes very old syntax of the CHARMM force field files (i suspect CHARMM19, but up to CHARM27 has been tested) and has several known deficiencies, including the lack of support for NBFIX.

the problems with doing correct CHARMM simulations with LAMMPS goes even deeper. there are multiple changes to the charmm styles in LAMMPS that need to be done for fully conform and especially get rid of the complex workaround that LAMMPS currently uses for the scaled 1-4 lennard-jones interactions.

thus there is no good suggestion besides doing a major refactor of CHARMM support in LAMMPS (starting with the C++ code and taking advantage of features in LAMMPS that were not available when the current versions were conceived and thus complex workarounds were implemented) and then also writing a new converter tool, or - better yet - teaching LAMMPS to read/parse parameter and .psf files directly.

Axel.

Dear Axel,

Thanks for the clarification. And thank you for your patience with me about this problem. Sometimes, I let my enthusiasm about a project get ahead of the appropriate orderly way to get an answer.

Warm regards,

Angelo