Lammps topology file to Gromacs/Charmm Parameters file

1,131 views
Skip to first unread message

Vasiliy Triandafilidi

unread,
May 2, 2013, 7:52:36 AM5/2/13
to mdnalysis-...@googlegroups.com
Dear MDnalysis users,
I am relatively new to MDnalysis and i want a piece of advice from you.
I want to analyze the trajectory generated by Lammps ( I have options DCD, XTC, XYZ file-formats). But as far I understood I need a parameters file for analyzing it. I don't have, but I do have a LAMMPS DATA_file.
Is there any way of converting LAMMPS_data file to the PARAMER_file?

Thank you,
Vasiliy.

Oliver Beckstein

unread,
May 2, 2013, 3:38:44 PM5/2/13
to mdnalysis-...@googlegroups.com
Hi Vasiliy,
You can either use a PDB file of your system as a topology together with your DCD (or XTC or XYZ – although I'd recommend using DCD over XTC over XYZ) or you convert your data file to a PSF:

We actually have most of the code to parse a data file. If you get the development branch (or simply drop the attached file into MDAnalysis/topology) you can split a data file into a PSF and PDB and load into MDAnalysis:

from MDAnalysis.topology.LAMMPSParser import LAMPPSData
d = LAMMPSData("lammps.data")
d.writePSF("lammps.psf")
d.writePDB("lammps.pdb")

Then read PSF and trajectory:

u = MDAnalysis.Unverse("lammps.psf", "lammps.dcd", format="LAMMPS")

This code used to work for LAMMPS 2007 data files; not sure if it still works. (This code was also available as MDAnalysis.util.LAMMPSParser but it had a small bug: change numpy.Float64 to numpy.float64.)

If you want to see a proper MDAnalysis parser for LAMMPS data files then file an issue report. It's not hard but we'll not make an effort if no-one is interested.

Oliver



LAMMPSParser.py

Richard Gowers

unread,
Oct 4, 2014, 3:27:39 PM10/4/14
to mdnalysis-...@googlegroups.com
Late update to this; data files should be supported in the latest develop version now.

Vasiliy Triandafilidi

unread,
Oct 11, 2014, 12:58:54 AM10/11/14
to mdnalysis-...@googlegroups.com
Thank you Richard,

I even forgot about this question I asked :)
At that time I found a topotools utility written by Axel Kohlmeyer and I have used that ever since.
But thank you anyway for your question. It is very handy to use Lammps data files directly.
I was wondering:
In the VMD when one loads  a PSF file (data file and then creates PSF) and wrapped trajectory file for polymers it results in bonds across the whole domain(on the borders of PBC box). I was wondering is it still the case for MDanalysis?
In VMD I had to remove long bonds explicitly, Is there any easy way to do it in MDanalysis?

Thank you,
Vasiliy.

Vasiliy Triandafilidi

unread,
Dec 2, 2014, 9:00:45 PM12/2/14
to mdnalysis-...@googlegroups.com
Dear Richard,

I try to follow this procedure to load lammps data files, but it seems to fail.

from MDAnalysis.topology.LAMMPSParser import LAMMPSData
d = LAMMPSData("init.data")

But since I don't specify the type of data file I have(f.e what type of atoms do I use, do I have dihedrals, angles) how is it supposed to work?

Thank you,
Vasiliy


On Saturday, October 4, 2014 12:27:39 PM UTC-7, Richard Gowers wrote:

Richard Gowers

unread,
Dec 3, 2014, 6:32:41 AM12/3/14
to mdnalysis-...@googlegroups.com
It should just work as

u = MDAnalysis.Universe('lammps.data')

It should work out your atom types and the information you've given it.

Oliver Beckstein

unread,
Dec 3, 2014, 11:36:17 AM12/3/14
to mdnalysis-...@googlegroups.com
Hi,

Just to add: LAMMPSData is not really needed anymore and will be removed. Just load as a Universe. (I already renamed LAMMPSData to LAMMPSDataConverter to decrease ambiguity but we really don't need it anymore.)

I should also say that the latest develop branch has currently some issues regarding accessing unit cells (ie Timestep.dimensions) as part of some ongoing work. This should all be fixed in the next few days. 

Oliver

--
Oliver Beckstein
skype: orbeckst

--
You received this message because you are subscribed to the Google Groups "MDnalysis discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mdnalysis-discus...@googlegroups.com.
To post to this group, send email to mdnalysis-...@googlegroups.com.
Visit this group at http://groups.google.com/group/mdnalysis-discussion.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages