Tinker with Molecular Dynamics for Fun and Profit
Molecular dynamics computations make up a very large proportion of the computer cycles being used in science today. For those of you who remember chemistry and or thermodynamics, you should recall that all of the calculations you made were based on treating the material in question as a homogeneous mass where each part of the mass simply has the average value of the relevant properties. Under average conditions, this tends be adequate most times. But, more and more scientists were running into conditions that would be on the fringes of where they could apply those types of generalizations.
Enter molecular dynamics, or MD. With MD, you have to move down almost to the lowest level of matter that we know of, the level of atoms and molecules. At this level, most of the forces you are dealing with are electrical in nature. Atoms and molecules interact with each other through their electron clouds. Several packages are available for doing this type of work, such as GROMACS and GAMESS. In this article though, I take look at TINKER.
Unlike most of the software I've covered in this space, TINKER isn't available in the package systems of most distributions. This means you will have to go out and download it from the main Web site. There are binary files for Linux (32-bit and 64-bit), Mac OS X and Windows (32-bit and 64-bit). Although these should work in many cases, you probably will want to download the source code and build it with the exact options you want. You can download either a tarball or a zip file containing the source code for TINKER.
Once it is unpacked, change directory to the tinker subdirectory. There are a number of subdirectories named after the various operating system options available. Because you're using Linux, you will want to move to the linux subdirectory.
will find a series of subdirectories for each of a number of possible
compilers. For this article, I chose to use the gfortran compiler. Inside
the gfortran subdirectory, you will find a number of scripts to handle
each of the build steps. The first step is to run
build all of the required objects. These scripts need to be run from
the location where the source code resides, so once you know which
set of scripts you are going to use, move over to the subdirectory
tinker/source. From here, I ran
to compile all of the source code I needed into object files.
next step is to combine these into a single library file by running
../linux/gfortran/library.make. The last step is to do the linking
with the system libraries to create a final executable. This is done by
You now will have a full set of executable files, recognizable by filenames that end with .x. These executable files then can be moved to any other location to make them easier to use.
You should find that 61 different executable files have been created. Each of these executables handles some separate task in the analyses that TINKER is designed to do. I look at only a few different executables here to give you a flavor of the types of tasks that you can do.
The first is
analyze.x. This executable will ask for
a structure file (in the TINKER .xyz file format) and the type of
analysis to run. The output you get back includes the following items:
the total potential energy of the system; the breakdown of the energy
by potential function type or over individual atoms; the computation
of the total dipole moment and its components, moments of inertia and
radius of gyration; the listing of the parameters used to compute
selected interaction energies; and the energies associated with
specified individual interactions.
The next executable,
performs a molecular dynamic or stochastic dynamic computation. On an
initial computation, it will take a .xyz structure file as input. If a
previous computation was check-pointed, you can use the resultant dynamics
trajectory file (or restart file) as input too. These two programs are
both deterministic in their methods.
monte.x provides a
way to apply Monte Carlo minimization methods to molecular dynamics. It
takes a random step for either a single atom or a single torsional angle,
then applies the Metropolis sampling method.
scan.x executable takes
a .xyz structure file as input and finds an initial local minimum. From
this first local minimum, the program starts searching out along normal
modes to try to find other minima. Once it has searched along each of
these modes, it then will terminate.
A number of these 61 executables are
support utility programs that do non-computational work. For example,
intxyz.x convert back and forth between
the .xyz structure file format and the .int internal coordinates
For all of these programs, the specific details of how they work is determined by a keyword file (with a filename ending with .key). TINKER uses a huge number of keywords to decide the specifics of any particular run. For example, you could set a single bond stretching parameter with the keyword BOND. The keyword CHARGE will set a single atomic partial charge electrostatic parameter. A full listing of the keywords is available in the TINKER documentation.
All of these executables are designed to run as command-line programs. The output tends to be files of numbers, which are hard for a human to evaluate. The group who created TINKER also created a program called Force Field Explorer (FFE).
Figure 1. On initial startup, you will get an empty project window and a TINKER console.
The executables built above are not compiled to interface with FFE as is. If you want to compile your own copy and have it interact with FFE, it requires changing a number of source files. In this case, I would suggest that you go ahead and download one of the installation packages that include FFE. These come as a gzipped shell archive. After gunzipping it, you can run the shell script to start up the Java-based installer. It will let you select which portions to install along with FFE. Once it is all done, go ahead and start up FFE. It will open up the main window and a console window. From within FFE, you can load up structure files and start various TINKER analyses.
When you first open an .xyz file, the structure is rendered and displayed in the main window. You then can select the Modeling Commands tab to select which specific TINKER analysis to run. By default, these TINKER runs happen locally on the same machine, but it doesn't have to be this way. FFE gives you the option of connecting to a remote machine, likely more powerful than your desktop, and getting the actual TINKER programs to run over there.
Figure 2. You have access to all of the TINKER analysis routines, directly from FFE.
Once you have results, you can change the visual details like colors and whether to use wireframe or tube and so on. You also have the option of exporting a visual as an image file in one of several file formats.
I easily could fill the entire contents of Linux Journal just covering the most basic functionality TINKER provides. Hopefully, you will have seen enough to get an idea of whether this software might be of use to you. If so, a rather large amount of detailed documentation is available at the main TINKER Web site.
Limited Time Offer
Take Linux Journal for a test drive. Download our September issue for FREE.
Topic of the Week
The cloud has become synonymous with all things data storage. It additionally equates to the many web-centric services accessing that same back-end data storage, but the term also has evolved to mean so much more.