Lammps tinker2lmp.py ERROR: bond not found

Hi,
I would like to use the tinker2lmp.py script in order to run a lammps MD simulation on a small organic molecule using the AMOEBA force field. For this I read the tutorial “8.4.2. AMOEBA and HIPPO force fields — LAMMPS documentation” where at one point it suggests to use the tinker2lmp.py script in order to generate a lammps data file that is parameterized according to a force field of my choice.

After performing the following command: ./pdbxyz, then i gave it the pathway to my pdb file, then the pathway to the amoebabio18.prm file, it gave me the tinker xyz file. It is this xyz file that i used for the following command that gave the error: $ python tinker2lmp.py -xyz test.xyz -amoeba amoebabio18.prm -data data.test.amoeba
ERROR: bond not found: 1 2: 17 5

Does anyone have similar issues? How else would you parameterize ligands with the amoeba force field?

Here is the input xyz file if you want to reproduce the error:
9
1 C -0.000000 0.000000 0.000000 64 2 3 4 5
2 H -1.000000 0.000000 0.000000 11 1
3 H 0.358000 -0.934000 0.000000 11 1
4 H 0.358000 0.467000 0.809000 11 1
5 O 0.505000 0.658000 -1.140000 82 1 6
6 C 1.914000 0.702000 -1.216000 64 5 7 8 9
7 H 2.111000 1.248000 -2.179000 11 6
8 H 2.349000 -0.323000 -1.269000 11 6
9 H 2.348000 1.276000 -0.362000 11 6
i tried multiple test molecules which all gave the same error.

Thanks!

Hi - that error is generated when the tinker2lmp.py tool does not find the needed bond listed in your PRM file. In this case, it is the bond between atoms 1 and 2, which map to PRM classes 17 and 5. That mapping is determined by the Atom Type Definitions section of the PRM. The Bond Stretching Params section of the PRM lists the bond params. That section has params listed for pairs of classes (not pairs of atom types). So I am guessing the class pair 5,17 or 17,5 does not exist in your PRM file.

If the PRM looks fine, then please post it so we can reproduce the error. Possibly it is a bug in the tinker2lmp.py script.

Steve

Hey steve thanks for your prompt answer!

As a new user i apparently cannot upload files, and the .prm files are too big to copy-paste in this message. But i used the amoebabio18.prm file from ( tinker/params at release · TinkerTools/tinker · GitHub ) which is also recommended from the tutorial.

I myself also think it is a bug in the python script, since I have tried several types of .prm files and it is always the same atoms (the very first one in the list) to which a wrong atom class is given. Meanwhile, I have been tinkering with the script myself and found out that the recognition of the atom types is correct, but it is the conversion of atom types to atom classes where I think there is a bug. In any case, good luck!

Regards,
Stijn

@stijn I just promoted you the the basic user level and the blocking of all file attachments (an anti-spam measure) should be gone.

Thanks
amoebabio18.prm (436.7 KB)

it works

Hi @sjplimp and @akohlmey , any news on the debugging of the tinker2lmp.py script?

So I reproduced your error, using your xyz file (9 atoms) and amoeba 18 PRM file you posted.

The issue is what I explained earlier, but now I can explain it with your 2 files.
(a) The first 2 atoms (1,2) in your xyz file have “PRM types” 64 and 11
(b) In your PRM file, look at the Atom Type Definitions section, at lines 64 and 11
The 3rd column on those lines is the “PRM class”, which is 17 and 5 for these 2 atoms
(c) There is a bond between atoms 1 and 2, as listed in your xyz file (atom 1 is bonded to 2,3,4,5)
(d) In the PRM file, bond params are listed in the Bond Stretching Parameters section
Bond params are not listed by PRM types, but by PRM classes.
The 2nd/3rd columns in that section are the two class IDs
The last 2 columns are the numeric bond params (prefactor K and distance in Angs)
(e) For the bond between atoms 1,2 in your xyz file, this PRM file thus requires
a bond entry for PRM classes 17 and 5.
If you scan the list, you will see it does not exist.
Hence the error.

If you do the same exercise for the xyz and PRM files in examples/amoeba you will see this is
never an issue. Which is why tinker2lmp.py works with all those files.

My guess is you have somehow generated or found an xyz file which does not match the PRM file.
Possibly my understanding of PRM file formats is limited and there are multiple formats for valid PRM files or multiple different flavors of xyz files which are supported by Tinker. Though I doubt it b/c I worked with a Tinker developer to write tinker2lmp.py

Thank you for your reply. But then how do i generate a correct xyz file that does match the PRM file? Is there any tutorial i can follow for this? Because as far as understood using the pdbxyz (from tinker itself) was the way to do it.

By hand. It’s not that hard.

On a more (or less?) serious note, isn’t an xyz file just a list of coordinates? That’s pretty easy to generate with plenty of online tools – LigParGen generates MD files (https://zarbi.chem.yale.edu/ligpargen/), but you can also use Molview whose interface I love (https://molview.org/) and download the MOL file from “Tools”.

Tinker .xyz files are different and contain more data. Here are the first lines of an example from the LAMMPS examples/amoeba/ folder

 9737  UBIQUITIN  (AMOEBA PROTEIN + 2835 WATERS)
     1  N      9.963103    5.604761    0.008413   234     2     5     6     7
     2  CA     9.595854    5.616857   -1.387669     8     1     3     8     9
     3  C      8.190092    6.079015   -1.537478     9     2     4    20
     4  O      7.228002    5.276741   -1.343729    11     3
     5  H      9.248539    5.324856    0.671238   235     1
     6  H     10.310756    6.543175    0.309331   235     1
     7  H     10.709289    4.952168    0.170763   235     1
     8  H     10.342605    6.385672   -1.876827    12     2
     9  C      9.777424    4.134312   -1.928716   178     2    10    13    14
    10  C      9.485635    3.817581   -3.412559   180     9    11    15    16
    11  S     10.117567    2.116666   -3.905314   182    10    12
    12  C      9.214556    1.102048   -2.698793   183    11    17    18    19
    13  H      8.995937    3.481218   -1.313618   179     9
    14  H     10.813555    3.756529   -1.729292   179     9
    15  H     10.074410    4.479912   -4.109344   181    10
    16  H      8.425285    3.844015   -3.623677   181    10
    17  H      9.476005    1.466410   -1.683717   184    12
    18  H      9.531462    0.065851   -2.728696   184    12
    19  H      8.157703    1.221346   -2.837348   184    12
    20  N      8.075651    7.407997   -1.589694     7     3    21    24
    21  CA     6.846787    8.085212   -1.711474     8    20    22    25    26
    22  C      6.189365    7.484141   -3.005186     9    21    23    37
    23  O      6.734597    7.675309   -4.068223    11    22
    24  HN     8.951370    7.929371   -1.808185    10    20
1 Like

Yeesh – that’s certainly a lot harder.

This feels like a job for moltemplate some day.