mdanalysis
mdanalysis copied to clipboard
An example for loading a LAMMPS data (topology) and dump (trajectory) pair in MDAnalysis documentation
Problem
There is no example in the documentation that shows how a pair of LAMMPS data (topology) and dump (trajectory) can be loaded with the format="LAMMPSDUMP" option of the mda.Universe(...)
.
Solution
The following example is given in the documentation,
topology = glob("./topology.data")
trajectory = glob("./trajectory.lammpstrj")
u = mda.Universe(topology[0], trajectory[0], format="LAMMPSDUMP")
here, the attached files are used (txt is added to the end of the file to be able to upload them on Github). topology.data.txt trajectory.lammpstrj.txt
I think we can simplify the example (no need for glob) and add some context:
To read a dump file you can indicate the format with the ``format="LAMMPSDUMP`` keyword
in case your filename has a non-standard file name extension::
u = mda.Universe("./topology.data", "./trajectory.lammpstrj", format="LAMMPSDUMP")
With the above command, the :class:`DumpReader` will be used for the trajectory file "./trajectory.lammpstrj"
and the :class:`~MDAnalysis.topology.LAMMPSParser.DATAParser` for the topology file "./topology.data".
You could add it to the section https://docs.mdanalysis.org/stable/documentation_pages/coordinates/LAMMPS.html#dump-files in the file coordinates/LAMMPS.py
after https://github.com/MDAnalysis/mdanalysis/blob/149eb504e35670568201af28306fa04462f6c100/package/MDAnalysis/coordinates/LAMMPS.py#L55-L59
Hi @hmacdope , I want to work on this task but before that, can you please elaborate more about this task and what all things i should know beforehand to complete this task? does this require any technical knowledge regarding it?
You don’t need to write code for this task. You should know what MDAnalysis does (ie you should have gone at least through the QuickStart Tutorial and read the 2016 paper and perhaps watched some of our videos).
Then the task is to add documentation as I outlined in my comment above.
We don’t “reserve” issues. We simply review the first PR that references the issue so just get started and we comment on your PR. It is an iterative process where we give feedback, you change your work in response, and we repeat until we have high quality work that can go into MDAnalysis.
@orbeckst I would like to work on this issue. I will update the file and create the PR asap. Thanks !
Please do. As I said above: create a PR and mention this issue #3337 in the PR text so that it gets linked to this issue.