dump molfile

Dear developpers,
LAMMPS version 19 Sep2019
I wish to produce a mol2 file using dump molfile. In the documentation I read :
The format keyword determines what format is used to write out the dump. For this to work, LAMMPS must be able to find and load a compatible molfile plugin that supports this format
Is mol2 format supported or should I use the custom style instead of molfile ?
Alternately, is pdb conserving charge ? sometimes it does not.
Thanks a lot
Best regards
Pascal

Dear developpers,
LAMMPS version 19 Sep2019
I wish to produce a mol2 file using dump molfile. In the documentation I read :
The format keyword determines what format is used to write out the dump. For this to work, LAMMPS must be able to find and load a compatible molfile plugin that supports this format
Is mol2 format supported or should I use the custom style instead of molfile ?

mol2 should be supported. the conditions for support are the following: 1) there must be molfile plugin for that format (and there is one for mol2), 2) that plugin must have support for writing (not all have, but the mol2 plugin does).

Alternately, is pdb conserving charge ? sometimes it does not.

no. the pdb format has no provisions for storing charges. that is why the APBS people invented the PDBQ format, which does.

here is an example for dumping to mol2 that works by adding these lines to one of the input examples of examples/USER/tally/

dump d1 all molfile 10 spce.mol2 mol2 .
dump_modify d1 element OW HW

this assumes that you copy (or symlink) the matching molfile plugin to the working directory. otherwise, you can also give the location of the VMD folder that has the plugin .so files.

axel.

Dear Axel
Thanks a lot for your help.
Best
Pascal

Hi Axel,
I have an issue with the location of the molfile plugin.
In the documentation the call to the plugin directory is for Linux version.
I am using Windows lammps binary, for which I undestood that MOLFILE-USER package is compiled.
None of following are working.
dump d1 all molfile 10 spce.mol2 mol2 .
dump d1 all molfile 10 spce.mol2 mol2 ‘C:\Program Files (x86)\University of Illinois\VMD\plugins\WIN32\molfile’
dump d1 all molfile 10 spce.mol2 mol2 “C:\Program Files (x86)\University of Illinois\VMD\plugins\WIN32\molfile”
dump d1 all molfile 10 spce.mol2 mol2 C:\Program Files (x86)\University of Illinois\VMD\plugins\WIN32\molfile

I think it is a problem with how to call a folder in the script language
Thanks for your help.
Pascal

Soory,
I forgot to copy/paste the error message :

ERROR on proc 0: No suitable molfile plugin found (…/dump_molfile.cpp:104)
Last command: dump d1 all molfile 10 H-C2H-C2H2_10Mit_CHonly-IR.mol2 mol2 ‘C:\Program Files (x86)\University of Illinois\VMD\plugins\WIN32\molfile’

i would just copy the plugin binary to the working directory and use “.” as the folder name (which is also the default, IIRC).

axel.

Thanks a lot
I put the mol2plugin.so file in ma working directory.
But it got the same message :

ERROR on proc 0: No suitable molfile plugin found (…/dump_molfile.cpp:104)
Last command: dump d1 all molfile 10 H-C2H-C2H2_10Mit_CHonly-IR.mol2 mol2 .

Maybe this not the good file ?

best regards
PAscal

Thanks a lot
I put the mol2plugin.so file in ma working directory.
But it got the same message :

ERROR on proc 0: No suitable molfile plugin found (…/dump_molfile.cpp:104)
Last command: dump d1 all molfile 10 H-C2H-C2H2_10Mit_CHonly-IR.mol2 mol2 .

Maybe this not the good file ?

please have a look at the vmdplugin.h file bundled with your VMD version.

there should be a define like this somewhere:

#define vmdplugin_ABIVERSION 17

if the number is not 17, then the plugins you have are not compatible with your LAMMPS version (assuming that your LAMMPS version is recent enough).
When the dump molfile package is compiled, it pulls in the vmdplugin.h header. The one bundled with LAMMPS (and used when compiling the windows packages) is the one from the last stable VMD release 1.9.3.

the check on the ABI version is the same kind of check that VMD performs itself for determining compatible plugins.

axel.

Thanks again
I will check this. My Lammps version 19 Sep2019 and VMD 1.9.4.
Thanks again
Pascal

Pascal Brault
DR CNRS
GREMI UMR 7344
CNRS Université d’Orléans

Thanks a lot
I put the mol2plugin.so file in ma working directory.
But it got the same message :

ERROR on proc 0: No suitable molfile plugin found (…/dump_molfile.cpp:104)
Last command: dump d1 all molfile 10 H-C2H-C2H2_10Mit_CHonly-IR.mol2 mol2 .

Maybe this not the good file ?

please have a look at the vmdplugin.h file bundled with your VMD version.

there should be a define like this somewhere:

#define vmdplugin_ABIVERSION 17

if the number is not 17, then the plugins you have are not compatible with your LAMMPS version (assuming that your LAMMPS version is recent enough).
When the dump molfile package is compiled, it pulls in the vmdplugin.h header. The one bundled with LAMMPS (and used when compiling the windows packages) is the one from the last stable VMD release 1.9.3.

the check on the ABI version is the same kind of check that VMD performs itself for determining compatible plugins.

axel.

there are currently only alpha versions of VMD 1.9.4 available, no 1.9.4 release.

Hi Axel
I verify :

I am using VMD 1.9.3 with mol2plugin.so and lammpsplugin.so in the working directory and I always got the same error message :

No suitable molfile plugin found (…/dump_molfile.cpp:105)

right now, i can only test this on Linux and there are no problems. i am currently on a different continent than my (dual boot windows) test machine, so i won’t be able to check this out by myself for real for another week.

axel.

Hi Axel
Thanks a lot.

I will go on testing.
Best
Pascal

right now, i can only test this on Linux and there are no problems. i am currently on a different continent than my (dual boot windows) test machine, so i won’t be able to check this out by myself for real for another week.

axel.

Hi Axel,
I have re-installed VMD release 1.9.3 : ABI is 17.
I have copy and paste all files of the C:\Program Files (x86)\University of Illinois\VMD\plugins\WIN32\molfile folder directly in the working directory and it does not work again.
I will go on to search which kind of problem it can be.
Best
Pascal

Pascal,

I think you have done about everything that you can do as a person that is not compiling/debugging the executable.
I am not much of a Windows expert (my in-depth Windows knowledge is at the level of Windows 3.1; after that I have used Windows very rarely and the LAMMPS executables are not compiled on a windows machine, but on a Linux box with a cross compiler.

The only thing that we have not (yet) discussed is whether you are using 64-bit or 32-bit binaries. If i remember correctly VMD for windows is only available as 32-bit package, and 32-bit plugins would not load into a 64-bit LAMMPS binary.

One other thing that you might want to consider is to use the Windows subsystem for Linux, assuming that you have a recent Windows 10 version.
https://lammps.sandia.gov/doc/Howto_bash.html

Then you would be using a Linux LAMMPS executable and the corresponding Linux VMD plugins.

Axel.

Hi Axel
Thanks again for help.
I came to a similar conclusions : doing it on a linux (viryua) machine
Yes VMD 32 bits and LAMMPS 64 could be an issue for this.
Best
Pascal