information needed to make an LT (moltemplate) file

Thanks for the detailed reply!
My main question was, how do you typically generate your moltemplate input
files? Do you have a set of scripts to convert xyz coordinates to input
files? It looks like it would take a long time to type out all the bonds,
angles and dihedrals from an input file.

Hi Carrie

    All of the .LT files that come with moltemplate were generated by
hand. However it is not usually that much information. They tend to
be short. The coordinates can often be omitted (see below).

   As an alternative to writing LT files by hand, I suspect in the
future, a significant number of moltemplate users will download .LT
files from the ATB database. They have what appears to be an
extremely large database of molecules already in moltemplate format
https://atb.uq.edu.au/

   If you are building these files by hand only things you usually
need to list are 1) the atom types, 2) a list of bonds between atoms
(3, atom charges, in some cases)

  Traditional molecule building software will attempt to infer this
information automatically from a PDB file. Moltemplate was designed
to allow users to create coarse grained molecules where the number of
particles and bonds per molecule is typically much shorter than an
all-atom molecule, and PDB files are mostly irrelevant. It might not
be the right tool for you if you have a lot of PDB files, and/or if
you are simulating large all-atom biomolecules.

   It's worth mentioning that you only have to specify this
information once for every -type- of molecule. Suppose you have 1000
acetone molecules in your simulation. Acetone has 10 atoms and 9
bonds, so the .LT file you need to write would contain approximately19
lines (plus a couple of additional lines to specify the number of
copies of acetone you want, and specify the simulation boundaries).

--- angles, dihedrals, impropers: ---

You almost never need to explicitly list the angles, dihedrals, or
impropers in a molecule. The MARTINI lipid example I forwarded you
below omits them. If you are using a force field (eg OPLSAA, GAFF,
COMPASS, MARTINI, etc...), then the force field generates those for
you. However you can specify angles, dihedrals, and impropers
explicitly if you want to, and the interactions you specify will
augment or override the interactions generated by the force field.

--- charges: ---

You can usually omit the atom charges as well. Force fields like
OPLSAA (before OPLSAA3) and COMPASS and PCFF (but not GAFF) specify
the atomic partial charges as well. For these force fields, you can
leave the charges in your molecule (4th column) as 0, if you like.
moltemplate will generate a list of "set" commands which will assign
charges to the atoms after you read the data file.

--- coordinates: ---

If you have a PDB or XYZ file containing the atomic coordinates of
your system, you can run moltemplate.sh with the "-pdb" or "-xyz"
arguments to read these coordinates from a file. (And in your .LT file
describing the molecule you can set the x y z coordinates (5th, 6th,
7th columns) to 0 0 0, if you like)

Alternatively, you can make a crude guess at what the coordinates
should be and use LAMMPS' minimize command to relax the molecule.

If you think it would be useful to have a script which copies
coordinates from an XYZ file or a PDB file into an individual LT file,
I can add this functionality to moltemplate.

--- ATB database ---

If you don't want to generate LT files manually, then you can download
.LT files describing molecules from the ATB database. (And these will
also include coordinates, charges, angles, dihedrals and impropers all
listed explicitly.) Presumably, these molecules have been carefully
parameterized and are safe to use.

Thank you again,

Your welcome. I don't know if I helped.

Andrew

Here's the MARTINI lipid example again.
(In this example, the charges and coordinates were specified, however
in most cases, they can be set to 0.)

import "martini.lt"
DPPC inherits MARTINI {
  # atomID molID atomTyle charge X Y Z
  write('Data Atoms') {
    $atom:NC3 $mol:. @atom:Q0 1.0 0.485 0.515 2.472
    $atom:PO4 $mol:. @atom:Qa -1.0 0.589 0.568 2.201
    $atom:GL1 $mol:. @atom:Na 0.0 0.509 0.536 1.838
    $atom:GL2 $mol:. @atom:Na 0.0 0.772 0.531 1.760
    $atom:C1A $mol:. @atom:C1 0.0 0.396 0.476 1.453
    $atom:C2A $mol:. @atom:C1 0.0 0.446 0.522 1.174
    $atom:C3A $mol:. @atom:C1 0.0 0.421 0.596 0.897
    $atom:C4A $mol:. @atom:C1 0.0 0.434 0.607 0.553
    $atom:C1B $mol:. @atom:C1 0.0 0.922 0.644 1.490
    $atom:C2B $mol:. @atom:C1 0.0 0.943 0.481 1.201
    $atom:C3B $mol:. @atom:C1 0.0 0.926 0.607 0.904
    $atom:C4B $mol:. @atom:C1 0.0 0.936 0.514 0.557
  }
  write('Data Bond List') {
    $bond:b1 $atom:NC3 $atom:PO4
    $bond:b2 $atom:PO4 $atom:GL1
    $bond:b3 $atom:GL1 $atom:GL2
    $bond:b4 $atom:GL1 $atom:C1A
    $bond:b5 $atom:C1A $atom:C2A
    $bond:b6 $atom:C2A $atom:C3A
    $bond:b9 $atom:C3A $atom:C4A
    $bond:b10 $atom:GL2 $atom:C1B
    $bond:b11 $atom:C1B $atom:C2B
    $bond:b12 $atom:C2B $atom:C3B
    $bond:b12 $atom:C3B $atom:C4B
  }
}