moltemplate

repository·master·Indexed 43 days ago

https://github.com/jewettaij/moltemplate

A general, cross-platform, text-based molecule builder designed for LAMMPS. It allows users to build custom coarse-grained molecular models and prepare all-atom simulations, including support for AMBER (GAFF2), OPLSAA, and COMPASS force fields. The tool includes utilities like amber2lt.py and mol22lt.py for converting AMBER force field and molecule files into moltemplate format.

Tokens
94.2K
Snippets
309
Records
489
Agent score
51%

What's inside moltemplate

  1. Overview of the 2-bead Heteropolymer Example

    master

    This example demonstrates a coarse-grained, protein-like heteropolymer simulation. The model consists of 14 residues per polymer, with each residue containing 2 particles: a backbone bead (CA) and a residue bead (R). The simulation includes 27 copies of this polymer.

    Interaction Model:

    • H residues: Sidechain beads from H residues are attracted to each other (labeled HR, shown in orange).
    • Other particles: All other particle interactions are repulsive.
  2. Understand the MARTINI DPPC bilayer preformed example

    master

    This example demonstrates the formation of a coarse-grained DPPC lipid bilayer using the Martini force-field v2.0 (2013-10).

    In this specific version, lipids are initially arranged in a periodic lattice in the XY plane, all pointing in the same direction. If you require a bilayer with random lipid orientations, you should use the PACKMOL-based assembly method instead (see the DPPC_bilayer_formation_PACKMOL example directory).

    Key Configuration Files:

    • moltemplate_files/system.lt: Defines the simulation size, the number of lipids and water molecules, and the initial placement.
    • run.in.npt and run.in.nvt: Control the simulation conditions (NPT and NVT ensembles).
  3. Overview of the 3bp2p coarse-grained DNA model

    master

    The 3bp2p (3 base pairs = 2 particles) model is a coarse-grained approach for simulating double-stranded (ds) DNA.

    Key Features

    • Double-helical conformation: Includes major and minor grooves.
    • High flexibility: The polymer can be bent arbitrarily far without kinking or numerical instability, allowing for larger timesteps.
    • Adjusted masses: Masses are tuned to allow a timestep of 1.0, facilitating integration with other coarse-grained models.

    Physical Properties (at T=300K)

    This model is calibrated to match experimental values:

    • Persistence length: ~48.7 nm
    • Torsional persistence length: ~110 nm
    • Helical twist angle (between base-pairs): ~34.3 deg
    • Distance along axis (between base-pairs): ~0.332 nm

    Force field parameters are defined in moltemplate_files/dna_forcefield.lt using degrees of freedom: r1, r2, θ1, θ2, φb, and φt.

  4. Customize atomic charges using multiple methods

    master

    In complex simulations where different atoms use different force fields (e.g., a mix of standard parameters and OPLSAA), you may need to specify charges using multiple methods. Moltemplate supports both the LAMMPS DATA file method and the set command method.

    1. Standard Data Atoms Method

    For atoms using standard force fields, specify charges directly in the Data Atoms section of your .lt files. After running moltemplate.sh, these charges are written to the Atoms section of the generated system.in.data file.

    2. Force Field Lookup Method (e.g., OPLSAA)

    For atoms using the OPLSAA force field, charges are assigned via a lookup table based on @atom type. This information is written to the system.in.charges file. Because LAMMPS reads the charges file after the data file, these values will override any charges specified in the Atoms section.

    3. Individual Atom Customization via 'set' commands

    To modify the charge of a specific atom without changing its type (especially when that atom belongs to a force field like OPLSAA), you can append a LAMMPS set command to a file named In XXX.

    Any text written to a file named In charges will be appended to the end of the system.in.charges file. This allows you to override the charge for a specific atom ID using the LAMMPS set syntax.

    Example Pattern: To modify the charge of a specific atom in a Graphene_NH2 object, add a set command to the end of the graphene_nh2.lt file (or a file that generates the In charges section).

  5. Structure of moltemplate examples

    master

    Each example directory in the examples/ folder follows a consistent structure to facilitate building, running, and visualizing simulations.

    • moltemplate_files/: Contains the .LT (moltemplate) files and other auxiliary files required to build the system.
    • images/: Contains visual representations of the molecules in the system.
    • README_setup.sh: Provides specific instructions on how to use moltemplate to generate the necessary simulation files.
    • README_run.sh: Provides instructions on how to execute the LAMMPS simulation after the files have been created.
    • README_visualize.txt: Provides instructions for viewing the resulting DATA or DUMP files in VMD.
    • run.in.*: LAMMPS input scripts (e.g., run.in.min, run.in.npt, run.in.nvt) that load the files created by moltemplate and contain the simulation commands (timesteps, integrators, etc.).
  6. Determine monomer size and length in base pairs

    master

    To map coarse-grained monomers to biological DNA lengths, use the Kuhn length of the chromatin fiber.

    Mapping Guidelines:

    • Kuhn Length: Approximately twice the persistence length of the fiber. An estimated lower bound for the persistence length is 600 bps (based on 3 consecutive nucleosomes and their linker DNA). This results in a Kuhn length of $\approx$ 1200 bp.
    • Monomer Definition: Each monomer should represent a fragment of chromatin equal to the Kuhn length (e.g., 6 nucleosomes).
    • Volume Scaling: To maintain physical consistency, the volume of a single spherical monomer should be equal to (or slightly above) the volume of the biological components it represents (e.g., $V = 6 \times 600\text{ nm}^3$).
    • Example Mapping: A simulated chain of 4000 monomers corresponds to approximately 4.8 Mb of packed DNA.
  7. How to create LT files for your molecule

    master

    To create .lt (moltemplate) files for a new molecule, you need to define two primary sections within the file:

    1. Data Atoms: A list of atoms including their types, charges, and positions.
    2. Data Bond List: A list of bonds between the atoms.

    For atom type selection, refer to the DREIDING_label_manual.pdf. If you have an XYZ file, you can use scripts like those found in the moltemplate-DREIDING repository to convert XYZ files into the .lt format required by moltemplate.

  8. Tune mechanical properties like persistence length

    master

    While the iterative adjustment of $\theta_0$ and $k$ works for local distances and angles, it may not correctly capture global mechanical properties like stiffness (persistence length and torsional persistence length).

    For biomolecules like DNA, local parameter refinement might result in models that are too stiff. To achieve correct mechanical properties:

    1. Target specific physical constants: Instead of just local angles, aim to reproduce measured persistence lengths (e.g., 50nm for dsDNA) and torsional persistence lengths (e.g., 111nm).
    2. Manual/Iterative Tuning: This often requires manual adjustment of dihedral angle stiffness parameters and angle stiffness parameters, followed by new simulations to verify the resulting persistence lengths.
    3. Reference Implementation: For a detailed walkthrough of how these parameters were tuned for DNA, refer to the dna_forcefield_more_comments.lt file in the same directory, which contains the parameter history and measured properties from each iteration.
  9. Configure LAMMPS DUMP format for periodic boundary tools

    master

    When creating trajectories in LAMMPS using the dump command, ensure the output includes molecule IDs. This is necessary for tools like VMD's pbc wrap to correctly handle periodic boundaries without breaking molecules in half.

    Use an atom_style that supports molecule IDs and include id mol type x y z ix iy iz in your custom dump command.

    dump 1 all custom 5000 DUMP_FILE.lammpstrj id mol type x y z ix iy iz
  10. Warning: Atomic charge calculation for AMBER force field

    master

    The AMBER force field does not include charge information. In this specific example, charges were borrowed from oplsaa2024.lt, which is not recommended for production use.

    To correctly set up charges for your own simulations:

    1. Use 3rd party software to calculate atomic partial charges for each atom type in your molecule.
    2. Manually edit the corresponding .lt files in the moltemplate_files directory to include these calculated charges.
  11. Understand the MOLC coarse-grained modeling strategy

    master

    MOLC (Modeling of Organic functional materials via Coarse-graining) is a strategy for generating coarse-grained versions of all-atom molecules using bonded ellipsoids.

    Workflow:

    1. All-atom representation: Create an all-atom model of the molecule (e.g., using the ATB molecule server at https://atb.uq.edu.au/).
    2. Conversion: Convert the all-atom model to a MOLC coarse-grained model following the procedure described in: "MOLC. A reversible coarse grained approach using anisotropic beads for the modelling of organic functional materials" (Phys.Chem.Chem.Phys. (2019), 21(47):26195-26211).

    Model Characteristics (Example: Biphenyl):

    • Representation: A biphenyl molecule is represented by only two particles.
    • Intra-molecular interactions: Represented by a single bond.
    • Inter-molecular interactions: Described using a short-range Gay-Berne potential and a long-range Coulomb potential.
  12. Override atomic charges in OPLSAA/LOPLSAA molecules

    master

    By default, atomic charges for OPLSAA atoms are determined by the @atom type using a lookup table defined in the force field file (e.g., oplsaa2008.lt). Any charges listed in the Data Atoms section of your molecule's .lt file will be ignored by default.

    To customize or override these charges, refer to the main project documentation on Customizing atomic charges in OPLSAA molecules.