TopoTools by Axel Kohlmeyer.
1) Build a PSF file for use in viewing with VMD.
This step works with VMD 1.9 and topotools 1.2. (Older versions, like VMD 1.8.6, don't support this.)
a) Start VMD
b) Menu Extensions->Tk Console
c) Enter:
(I assume that the the DATA file is called "system.data")
$ topo readlammpsdata system.data full
$ animate write psf system.psf
2) Later, to Load a trajectory in VMD: Start VMD Select menu: File->New Molecule -Browse to select the PSF file you created above, and load it. (Don't close the window yet.) -Browse to select the trajectory file. If necessary, for "file type" select: "LAMMPS Trajectory" Load it. If the trajectory is a DUMP file, then make sure the it contains the information you need for pbctools (see below. I've been using this command in my LAMMPS scripts to create the trajectories: dump 1 all custom 5000 DUMP_FILE.lammpstrj id mol type x y z ix iy iz
It's a good idea to use an atom_style which supports molecule-ID numbers so that you can assign a molecule-ID number to each atom. (I think this is needed to wrap atom coordinates without breaking molecules in half.) Of course, you don't have to save your trajectories in DUMP format, (other formats like DCD work fine) I just mention dump files because these are the files I'm familiar with.
3) ----- Wrap the coordinates to the unit cell
(without cutting the molecules in half)
a) Start VMD
b) Load the trajectory in VMD (see above)
c) Menu Extensions->Tk Console
d) Try entering these commands:
pbc wrap -compound res -all
pbc box
----- Optional ----
Sometimes the solvent or membrane obscures the view of the solute. It can help to shift the location of the periodic boundary box To shift the box in the y direction (for example) do this:
pbc wrap -compound res -all -shiftcenterrel {0.0 0.15 0.0}
pbc box -shiftcenterrel {0.0 0.15 0.0}
Distances are measured in units of box-length fractions, not Angstroms. Alternately if you have a solute whose atoms are all of type 1, then you can also try this to center the box around it:
pbc wrap -sel type=1 -all -centersel type=2 -center com
4)
You should check if your periodic boundary conditions are too small. To do that:
select Graphics->Representations menu option
click on the "Periodic" tab, and
click on the "+x", "-x", "+y", "-y", "+z", "-z" checkboxes.
5) Optional: If you like, change the atom types in the PSF file so that VMD recognizes the atom types, use something like:
sed -e 's/ 1 1 / C C /g' < system.psf > temp1.psf
sed -e 's/ 2 2 / H H /g' < temp1.psf > temp2.psf
sed -e 's/ 3 3 / P P /g' < temp2.psf > system.psf
If you have built a system using the tools which come with materials studio, for example (including bonds, atom charges, force-field parameters). You could try using the "msi2lmp" tool to convert your
materials studio files to LAMMPS "DATA file" format. See: http://lammps.sandia.gov/doc/Section_tools.html#msi (The msi2lmp tool was written in 2004, although I am under the impression people still use it. Hopefully it works for you.) Once you have created a LAMMPS DATA file, you can use "gen_all_angles_topo.sh", "ltemplify/moltemplate" or "VMD/topotools" to add angles, dihedrals, and impropers to your system.
1) Take a look at the "gen_all_angles_topo.sh" script. http://www.moltemplate.org/other/index.html
2) Alternately, you can try using "ltemplify.py" script which comes with moltemplate to convert it into moltemplate (.LT) format. If you have molecules in addition to carbon, then you can create different LT
files for each molecule type. To generate angular interactions, you can add "Data Angles By Type" sections to your LT file. See the many instructions and examples in chapter 6 and appendix A of the
moltemplate manual. There is also an example of this online: http://www.moltemplate.org/images/translocation/polymer.jpghttp://www.moltemplate.org/examples/translocation/monomer.lt http://www.moltemplate.org/examples/translocation/polymer.lt
3) Alternatley, you can also use topotools. See: https://sites.google.com/site/akohlmey/software/topotools/topotools-tutorial---part-1 However, you still must manually assign coeffs for these interactions
(for example, using "pair_coeff", "bond_coeff", "angle_coeff", "dihedral_coeff", and "improper_coeff" input script commands).
I hope this addresses your question.
---- automagic molecule builders ----
Ideally it sounds like many lammps users want a program which can read a coordinate file (PDB or XYZ), generate bonds by distance, and angle topology, and "automagically" determine the force-field parameters for your system using a "canned" force field. There are commercial programs which can do this. However I agree with Axel: I would not automatically trust any such program without investigating it first. There is no way to make this process completely automatic. At a minimum, you would have to find out which type of canned force-field works well with the type of molecules you are interested in studying. (And, as Axel said, you have to be very careful with atom-type-names.) Although I have not used them, I am under the impression that several commercial programs including AMBER and Materials Studio do come with tools which can read a PDB files and XYZ files and assign "canned" force-field parameters. AMBER comes with the GAFF force field for general organic molecules. Materials Studio supports several force-fields (http://msc.psu.edu/software/materials-studio).It would be nice if it was not necessary to use external commercial programs like these. Unfortunately, neither topotools nor moltemplate can do all of these steps, yet. (topotools does not yet assign "coeffs", and moltemplate does not yet generate bonds-by-distance. As mentioned earlier, both of these programs can generate angles, dihedrals, and impropers, but you must manually assign coeffs for these interactions yourself.) If someone has a favorite "canned" force-field style (such as GAFF,DREIDING, COMPASS, CVFF, PCFF, UNIVERSAL), then I can offer lots of advice if someone else if they are do the hard work of converting the parameter settings into "moltemplate" (.LT) format. I do not use any of these force-fields settings in my own work and do not understand their file format. Someone else would have to volunteer their time and expertise to make this happen, but I can help. (It's possible I could also add some features to moltemplate to make this easier, such having moltemplate automatically generate bonds-by-distance.)