Amber And Ubuntu Part 1. Amber10 (Serial Execution) Installation In Ubuntu 8.10 (Intrepid Ibex)

[15 March 2009: In case you miss it while searching, the MPI build of Amber is provided in a future link.  Check out www.somewhereville.com/?p=437 for installation and commentary.]

Ubuntu continues to be a pleasantly stable and very, very clean Linux distribution (although my last Ubuntu post about a minor glitch was only a few weeks ago).  That said, for the typical research user perhaps not used to dealing with either Linux distributions or code compilation, it may appear to be a little too clean.  In my previous learning endeavors with Fedora and OpenSuse, I often found myself installing the entire DVD for fear of missing an important library or some random program (almost entirely unnecessary after you learn your way around a distribution, but when your hard drives break the 200 GB point, what's a waste of 5 GB when you don't have to dig up the DVD again?).  With the standard Ubuntu installation and an internet connection, your only problem becomes determining which programs and libraries are needed to complete a compilation from source.

Posted here is a procedure for building a serial execution (not parallel, that is en route as part of an upcoming post) version of Amber10 under Ubuntu 8.10 (Server or Desktop, makes no difference), completed on all 15 of the Dell quad-core boxes that make up the contents of the Chemistry Department Learning Center in the new Life Sciences Building at Syracuse (the transition from Windows to Ubuntu is shown above because it looks neat).  Like a number of oft-employed computational chemistry programs, pre-compiled binaries can be hard to come by and, if you've never had to compile a program before, even more difficult to build on your own.  My hope is that, with only an Ubuntu 8.10 installation and an internet connection, the procedure below will walk you from download to execution.

About the procedure

The content below assumes a limited knowledge of Linux and is written in such a manner that people in the Chemistry Department at S.U. can, if they have to after I spontaneously combust, reinstall Amber10 and AmberTools.  If you find yourself asking "why is he spending so much time on such a trivial point?", then consider yourself a 1334 hax0r or something and ignore everything in black.

This procedure is very likely general to Amber and AmberTools, but is specifically addressing the installation of Amber10 and AmberTools 1.2 in Ubuntu 8.10 with g95.  One never knows what may change in one or assorted programs.

LEGEND

Text in black – my ramblings.

Text in bold preformatted red - things you will type in the Terminal

Text in green – text you will either see or will type into files (using pico, my preference)

Step 0: Coming To Grips With sudo

The one aspect of Ubuntu that differs from most other Linux distributions is the differentiation between root, Administrator, and user right from the installation.  Whereas you set up the root user in Suse and Fedora as part of  the installation process, you set up an Administrator account during Ubuntu installation that is distinct from root.  As a result, if you do not set up the root account to perform installations and system-level modifications, you are left in the Administrator account to use the sudo (super-user do…) command to allow you, the Administrator, to build and install programs outside your home ($HOME) directory.

"Do I have to constantly sudo everything?"  No.  Accessing a pure "root" terminal for installations is straightforward after the root password is assigned, it is simply argued by many (including the Ubuntu wiki) that it is safer to use sudo.  If you want to go the root route, check out help.ubuntu.com/community/RootSudo.

Step 1. Install Ubuntu 8.10 Desktop or Server

Default installation, simply walk through the entire installation process.  If your machine requires DNS registering to dive into your subnet's IP pool (as is the case at S.U.), this will be accomplished by simply opening a browser in most instances (and the standard install is set up for DHCP) after install. With the internet connection established, you'll likely get a message in the upper right-hand corner (wait a few minutes if you need to) mentioning that updates are available.  Not necessary for the Amber build, but it never hurts to be current.

Step 2. Terminal

There's no use in driving through the Applications drop box to get to a program you'll be using as often as Terminal.  If you didn't know it yet, go to Applications -> Accessories -> left-click-and-hold on the Terminal icon, then drag the icon to the panel (next to your handy Firefox icon, for instance) or right-click and "Add this launcher to panel."

Step 3. apt-get

It is at this point that your internet connection becomes vital in Ubuntu.  In the words of Bruce Byfield

"If any single program defines the Debian Linux project, that program is apt-get."

If you're a research scientist hoping to build software from source, it's about as an important an interface between Ubuntu and your programs as your neck is between your head and your body.  For building Amber10, you will need to install several programs (and associated libraries.  One required program, g95, is not get available by apt-get, but we'll get to that later).  apt-get makes this process (nearly) painless.

At the Terminal window:

sudo apt-get update

This updates the package list in the apt-get database (and it is recommended that you run this regularly, as it is your connection to newly available and updated programs).

sudo apt-get install fort77 g++ flex csh patch

This installs four base programs and many additional programs and libraries. The fort77 (fortran) compiler is required for the compilation of AmberTools (1.2).  Installing g++, the GNU Compiler Collection, takes care of your C and C++ compiling requirements.  flex is a fast lexical analyzer generator.  As of this writing (and, admittedly, with little research under my belt), I do not know exactly how this is used in Amber, but I know it will not compile without it.  Finally, csh.  Yes, you need to install csh (I was stunned at first that it wasn't already present).

NOTE 1: If you get an error related to hplip, see my previous post about fixing it.

NOTE 2: In my google travels, I discovered a page (that now I can't find.  How sad is that?) that used gfortran in a previous version of AmberTools (1.0, I think).  I started with gfortran out of ignorance of the apt-get for g77 and, because I did not want to deal with modifying installation scripts, simply placed a link from gfortran to g77 in the /usr/bin folder.  This compiles AmberTools 1.2 just fine, but g77 is specifically required to pass all of the tests for AmberTools (in the flags), so my seemly crafty ln -s trick failed me miserably.  Your life is made much easier by apt-get'ing g77 and it is my expectation that I'm the only person on the planet that tried to use gfortran for compiling AmberTools 1.2 in Ubuntu in such a cavalier manner.

Step 4: .bashrc and .profile Modifications

These next two steps (1) define the location of AMBERHOME (specifying for those programs that call "$AMBERHOME" to "look in … directory") and (2) add the amber10 directory to your path (so you need only type "antechamber" and not "/opt/amber10/bin/antechamber", etc.).  Both .bashrc and .profile (yes, I'm a bash user) are in your $HOME directory (simply typing "cd" will return you to $HOME and it is where the Terminal window starts you).

pico .bashrc

Into .bashrc, place the following (at bottom, just to keep track of the changes you make)

AMBERHOME=/location/to/amber10
export AMBERHOME

Crtl-X, The Enter Key twice, and done.

To make these changes to your account,

source .bashrc

In the interest of keeping track of where I install programs on a machine, I tend to use the /opt directory, which Perry thinks is crazy.  You may see /usr/local, /usr/local/bin, or various combinations thereof in your web searching travels.  If you're new to Linux, you'll blindly do what I did because you're concerned that something below will rely on something being in /opt.

pico .profile

Into .profile, place the following (at bottom, just to keep track of the changes you make)

PATH="/location/to/amber10/exe:$PATH"

Again, mine would be /opt/amber10/exe

Crtl-X, The Enter Key twice, and done.

To make these changes to your account,

source .profile

Step 5. Installing g95

The g95 program is an open source fortran compiler with support for f90 and f95.  I found myself NOT using CPMD a few years ago because I could not find a free f90 compiler (this was before the Intel Fortran Compiler became available for Linux) and am very happy that g95 has matured as of late.  That said, there is no apt-get for it yet, so you need to install this the olde-fashioned way.  With its Debian underpinnings, the Ubuntu g95 installation is trivial.  You need only be cognizant of whether you installed the 32-bit or 64-bit versions of Ubuntu.  If you don't know, it will be obvious when you go to build Amber10 (and you can simply install the other flavor over the old one).

At g95.org/downloads.shtml#CS, you will find the current snapshots for various flavors and installation formats for g95.  You either want to download the Linux x86 (Debian) or the Linux x86-64 (Debian) packages.  If you're using Firefox in Ubuntu, your download folder should be your Desktop.  Sticking to the Terminal, simply type the following:

cd ~/Desktop

to go to the Desktop Folder in your $HOME directory

sudo dpkg -i g95-x86.deb

if you downloaded with the intent of installing the 32-bit version, or

sudo dpkg -i g95-x86_64.deb

if you downloaded with the intent of installing the 64-bit version

The dpkg program is Debian's equivalent of Redhat's rpm (and vice versa).  It will extract the contents of a .deb file and place all of the executables and libraries in their proper folders PROVIDED you remember the sudo.  If you do not use the .deb package and decide to install from the .tgz file, you may find yourself having to copy libraries and executables into relevant directories.  If possible, stick with dpkg.

Ignorable Aside:

I did not use dpkg on my first pass of installations on the Learning Center machines above and had to go through the following steps to properly use g95 (which will fail with far harsher error messages than shown below).  The steps below extract the .tgz g95 file you download from the website (g95-x86-linux.tgz), move the executable f951 to a directory already in your path and copies all of the associated libraries into path libraries (the "1:30 am frustration" fix).  Do you see the benefit of dpkg!?

sudo mkdir /usr/local/bin/g95

makes the base g95 directory

sudo mv ~/Desktop/g95-x86-linux.tgz /usr/local/bin/g95

moves the downloaded g95-x86-linux.tgz to /usr/local/bin/g95

cd /usr/local/bin/g95
sudo tar xvjf g95-x86-linux.tgz

extracts g95-x86-linux.tgz, makes the directory g95-install

sudo mv g95-install/* /usr/local/bin/g95

moves all of the g95 files out of the g95-install directory (not mandatory)

sudo ln -s /usr/local/bin/g95/bin/*g95* /bin/g95

creates a link to the g95 executable that is placed into /bin (in the PATH)

sudo cp lib/gcc-lib/i686-suse-linux-gnu/4.0.3/f951 /bin

places a copy of f951 into /bin

sudo cp lib/gcc-lib/i686-suse-linux-gnu/4.0.3/*.o /usr/lib

places a copy of all files *.o into /usr/lib

sudo cp lib/gcc-lib/i686-suse-linux-gnu/4.0.3/*.a /usr/lib

places a copy of all files *.a into /usr/lib

NOTE: You do not need to type all of lib/gcc-lib/i686-suse-linux-gnu/4.0.3/.  Simply start the name and hit the TAB key to fill in the rest.  You're welcome.

Now, if you install the wrong build of g95 for your version of Ubuntu (32 instead of 64, 64 instead of 32), you will likely see an error at the Amber10 compilation stage (down below) that looks like:

Testing the Fortran compiler:
g95 -O0  -fsecond-underscore -o testp testp.f
/tmp/ccUG0LYy.s: Assembler messages:
/tmp/ccUG0LYy.s:11: Error: suffix or operands invalid for `push'
./configure_amber: 1169: ./testp: not found
Unable to compile a Fortran program using g95 -O0  -fsecond-underscore
Please check your compiler settings or configure flags.

At this point, simply download the OTHER version of g95 and dpkg -i it.

Step 6. Extract Amber and AmberTools

You should have already downloaded Amber10.tar.bz2 and AmberTools-1.2.tar.bz2 with your confirmation-of-purchase email.  I will assume that you've downloaded a fresh copy in Ubuntu so that both files are sitting on your Desktop.

sudo cp ~/Desktop/Amber* /opt
cd /opt
sudo tar xvjf Amber10.tar.bz2

will make a folder amber10 in opt/

sudo tar xvjf AmberTools-1.2.tar.bz2

will extract AmberTools-1.2 into the previously created amber10 folder

Step 7. Build and Test AmberTools 1.2

My 7th grade math teacher and one-time musical director Mr. Marshall Nye used to tell us that "Fools rush in where angels fear to tread," this obviously in reference to the manifold ways in which 7th graders had previously attempted to short-cut polynomial expansion in homework assignments.  I'd say a good 2 hours were spent dealing with foolish issues to streamline what is provided below and it is by no means guaranteed that the below will work flawlessly for you (unless you start with a pristine Ubuntu 8.10 install and do everything above exactly as typed, in which case you should be good to go).

cd $AMBERHOME

This takes you to /opt/amber10 or wherever else you defined the AMBERHOME directory to be

cd amber10/src

Enter the source directory for AmberTools

sudo ./configure_at gcc

This runs the configure script for AmberTools and specifies to use gcc flags (the compilers we installed with g77 and g++).  If you're using other compilers, you probably don't need this blog post anyway.  Your output should look as follows:

Setting AMBERHOME to /opt/amber10

Warning: the X11 libraries are not in the usual location !
To search for them try the command: locate libXt
On Fedora Core 5 install an xorg-x11-devel package.
On RedHat8 install an XFree86-devel package.
For the moment Amber will be configured not to build XLEaP.

Testing the C compiler:
gcc  -m64 -o testp testp.c
OK

Obtaining the C++ compiler version:
g++ -v
The version is 4.2.3
OK

Testing the g77 compiler:
g77 -O2 -fno-automatic -finit-local-zero -o testp testp.f
OK

Testing flex:
OK

Configuring netcdf; (may be time-consuming)

NETCDF configure succeeded.

The configuration file, config.h, was successfully created.

The next step is to type 'make -f Makefile_at'

sudo make -f Makefile_at

This builds the AmberTools programs.  This may take some time but provides plently of on-screen feedback.  To see what an otherwise flawless installation looks like, you can view my output HERE.

After the build is complete, we run the tests.  This was a MAJOR hassle for me for three reasons.

FIRST, sudo make test would fail instantaneously because it decided that AMBERHOME had not been defined, despite it being defined above.  I remedied this by not fully diagnosing the problem but instead simply adding two lines to the top of Makefile_at (see below).

SECOND, a linked gfortran is NOT the same thing as g77 to the test scripts and I spent a considerable amount of time re-writing and commenting out scripts before doing the obvious and looking-for-and-installing g77. This is fixed with proper g77 installation.

THIRD, the test sequence would come to a screeching halt at the ./Run.tp section of the script.  After much searching, I found a page that described the fix and am grateful to Mark Williamson for posting this on the Amber listserve at structbio.vanderbilt.edu/archives/amber-archive/2008/3476.php.

We'll deal with FIRST:

cd $AMBERHOME/test
sudo pico Makefile_at

To the almost-top of this file, I added two lines to re-define AMBERHOME, getting around my initial error.  My top 6 lines then looked like the following:

include ../src/config.h

AMBERHOME=/opt/amber10
export AMBERHOME

test: is_amberhome_defined \

Crtl-X, The Enter Key twice, and done.

Now the THIRD:

The file mopac.sh is written into /location/of/amber10/bin/.  We take care of all of the test issues associated with this file by changing the shell called at the top of the file.

sudo pico /opt/amber10/bin/mopac.sh

Change

#!/bin/sh

to

#!/bin/bash

Crtl-X, The Enter Key twice, and done.

If you want to know much more, have a read of structbio.vanderbilt.edu/archives/amber-archive/2008/3476.php.  I understand what's at issue, but my only concern is that it worked.

You should still be in $AMBERHOME/test at this point (you can cd $AMBERHOME/test if you're not).  Run those tests!

sudo make -f Makefile_at test

If you tried the gfortran trick for g77, you will notice the error at the cd antechamber/tp && ./Run.tp portion of the script (expectedly, at the first instance of .hasG77:).  These will take a while but confirm that nothing got butchered in the AmberTools build.  To see what an otherwise flawless installation looks like, you can view my output HERE.

Step 8. bugfix.all

I'm making this its own step so that you don't forget to do it.

download bugfix.all from ambermd.org/bugfixes10.html

sudo cp ~/Desktop/bugfix.all $AMBERHOME
sudo patch -p0 -N -r patch-rejects < bugfix.all

This will result in a small amount of on-screen output.  To compare and contrast with mine, see HERE.

Step 9. Build and Test Amber10

Finally!  Nearing completion with only one problem discovered in the test sequence.

cd $AMBERHOME/src
sudo ./configure_amber -gnucompat g95

You may or may not find considerable discussions about how much faster Amber10 execution is by using other compilers instead of the gcc variety.  As you should be spending money on hardware and minimizing your software costs, I say go with gcc all the way (unless you're offering).  Your output for this step should look like the following:

Setting AMBERHOME to /opt/amber10

Setting up Amber configuration file for architecture: g95
Using parallel communications library: none
The MKL_HOME environment variable is not defined.

Testing the C compiler:
gcc  -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O2 -m64 -o testp testp.c
OK

Testing the Fortran compiler:
g95 -O0  -fsecond-underscore -o testp testp.f
OK

——   Configuring the netCDF libraries:   ——–

Configuring netcdf; (may be time-consuming)
NETCDF configure succeeded.

The configuration file, config_amber.h, was successfully created.

sudo make serial

Again, making a serial (one processor) set of executables.  This will take a while and provide plenty of on-screen feedback.  To see what an otherwise flawless installation looks like, you can view my output HERE.

cd $AMBERHOME/test
sudo make test

I ran into failures of script (not of testing, but of the actual script) at Run.pbpgb. The output is as below.

cd pb_pgb && ./Run.pbpgb
./Run.pbpgb: line 3: syntax error near unexpected token `set'
./Run.pbpgb: line 3: `if( ! $?TESTsander ) set TESTsander = "http://www.somewhereville.com/exe/sander"'
make: *** [test.sander.BASIC] Error 2

I've found nothing about it online and have not yet found out what the problem is so, in the interest of getting the rest of this instruction set posted, I simply commented out the problematic lines and ran the rest of the tests otherwise flawlessly.  The commented Makefile will look like the following (simply not running anything related to pb_).

cd $AMBERHOME/test
sudo pico Makefile

Search down the file and add three # such that the lines look like the following:

cd trajene && ./Run.trajene
cd alp && ./Run.alp
#    cd pb_pgb && ./Run.pbpgb
#    cd pb_ivcap1 && ./Run.pb_ivcap1
#    cd pb_ivcap5 && ./Run.pb_ivcap5
cd umbrella && ./Run.umbrella
cd noesy && ./Run.noesy

Crtl-X, The Enter Key twice, and done.

You can see the results of my otherwise flawless tests HERE.

Final thoughts…

The parallel version is en route as I complete the installation of a new cluster and install mpi.  It will not differ much from the above, save the inclusion of an additional flag or two in the two ./configure scripts for AmberTools and Amber10.  If questions are raised, comments are thought of, speed-ups identified, etc., please either send me an email or post them here.  Our concern as computational chemists should be making predictions and interpreting data, not making compilation errors and interpreting error messages.

www.ubuntu.com
www.linux.org
www.somewhereville.com/?p=149
fedoraproject.org
www.opensuse.org/en/
ambermd.org
www.dell.com
chemistry.syr.edu
thecollege.syr.edu/lifesciences/about.html
www.syr.edu
www.microsoft.com
en.wikipedia.org/wiki/Spontaneous_human_combustion
en.wikipedia.org/wiki/Sudo
help.ubuntu.com/community/RootSudo
en.wikipedia.org/wiki/Domain_name_system
en.wikipedia.org/wiki/Dhcp
help.ubuntu.com/community/UsingTheTerminal
www.mozilla.com/en-US/firefox
members.axion.net/~bbyfield
www.linux.com/feature/113879
www.g95.org
www.debian.org/doc/manuals/apt-howto
www.gnu.org/software/fortran/fortran.html
gcc.gnu.org
flex.sourceforge.net
en.wikipedia.org/wiki/C_shell
hplipopensource.com/hplip-web/index.html
www.google.com
en.wikipedia.org/wiki/Bash
www.piermont.com
www.cpmd.org
www.intel.com/cd/software/products/asmo-na/eng/282048.htm
www.us.debian.org
g95.org/downloads.shtml#CS
en.wikipedia.org/wiki/Dpkg
en.wikipedia.org/wiki/RPM_Package_Manager
en.wikipedia.org/wiki/Fools_Rush_In_(Where_Angels_Fear_to_Tread)
en.wikipedia.org/wiki/Polynomial_expansion
structbio.vanderbilt.edu/archives/amber-archive/2008/3476.php
ambermd.org/bugfixes10.html

DNA-Specific (But Generally Applicable) AMBER With GROMACS 3.3.x: Installation And Notes

The following is the full procedure for installing the AMBER force field port for GROMACS (AMBER-in-GROMACS, AMBER-with-GROMACS, AMBER-on-GROMACS, whatever you want to call it) developed by Eric Sorin at California State University, Long Beach, providing a bit more depth in the installation process (specifically for GROMACS 3.3.x) and a few modified GROMACS files.

As brief background, AMBER (Assisted Model Building and Energy Refinement) is one of THE dominant molecular mechanics/molecular dynamics (MM/MD) force fields used today in biochemical simulations. The motivation for this page (my installing AMBER for use in GROMACS) stems from the current Nanorex focus on Structural DNA Nanotechnology (SDN) modeling, for which we're working on a reduced model force field for large-structure energy minimizations and, importantly, integrating the GROMACS MM/MD package for use via our CAD interface. You can read more about this in the poster presented at FNANO08 this past April. As a force field validated for DNA simulations, AMBER meets our needs of performing atomistic simulations on DNA nanostructures. While NAMD is also a possibility for DNA simulations, GROMACS meets Nanorex's open source needs.

Needless to say, finding that Sorin and co-workers had ported AMBER to GROMACS was a wonderful discovery (and that this same port appears to be driving the Folding@Home project). The installation directions on the AMBER-on-GROMACS website are good, but they don't mention a few important steps that I spent no small amount of time trying to figure out (and I'm definitely not complaining. 99% of the work was the porting, which has been graciously handed to the GROMACS community on a silver platter). Below is the complete set of steps required to get, as the first example, the Dickerson.pdb sample file provided with the porting files to energy minimize and MD correctly. Issues related to DNA-based simulations not using the Dickerson.pdb file will be covered in another post.

Dickerson DNA

QuteMol rendering of Dickerson.pdb (from Drew, H. R., Wing, R. M., Takano, T., Broka, C., Tanaka, S., Itakura, K. & Dickerson, R. E. (1981). Structure of a B-DNA dodecamer: conformation and dynamics. Proc. Natl. Acad. Sci. USA 78, 2179-2183. Protein Data Bank structure 1BNA).

Install/compile a custom installation of GROMACS

The AMBER port to GROMACS does not require modification of the GROMACS code but does require a few changes to force field text files. In the interest of remembering what was changed and what wasn't, I recommend a custom compilation of GROMACS or, at the very least, the installation of another copy of GROMACS you can modify the top directory of without risking changes to an already working GROMACS version.

If you don't know how to compile your own version of GROMACS, I recommend taking a look at Compiling Single-Precision And Double-Precision GROMACS 3.3.3 With OpenMPI 1.2.6 Under OSX 10.5 (Leopard).

My installation directory is /usr/local/gromacs333-amber (which I will refer to here as /ULG-A/ and all directory calls will be to this. Obviously, change all directory calls to match yours.

Download GROMACS-Ported AMBER force field files

I'm running a double-precision MPI version of GROMACS 3.3.3, meaning I'm using the GROMACS-ported AMBER force field files for GROMACS 3.3.1 (May 2006). And get the version "with pdfs." If you're going to be doing these calculations, you should know where the math come from!

Copy vdwradii.dat and aminoacids-NA.dat into /usr/local/gromacs-amber/share/gromacs/top

You will need to be logged in as root to do this (sudo cp FILENAME /ULG-A/top). The AMBER port file vdwradii.dat differs from the vdwradii.dat file in the /ULG-A/top directory of the GROMACS install by the addition of 5 lines:

???  P     0.15
???  LP1   0
???  LP2   0
LYSH MNZ1  0
LYSH MNZ2  0

With no removals or number changes.

The aminoacids.dat file is a little different. In order to use pdb2gmx to generate nucleic acid topology files, GROMACS requires the list of residue codes that reside in aminoacids-NA.dat. So far as I can tell, using aminoacids-NA.dat instead of aminoacids.dat does not change the handling of amino acids (why two files exist for a reason other than amino acid-centric organization is beyond my pay scale), so we'll be using aminoacids-NA.dat exclusively.

Move/delete/rename aminoacids.dat and rename aminoacids-NA.dat to aminoacids.dat

The aminoacids-NA.dat file includes 32 additional residue codes, accounting for the 3' (includes terminal H atom), 5' (included terminal H atom), in-strand (nucleic acid repeat unit) and molecule (individual hydrogen-terminated sugar and nucleic acid) topology information codes for DNA and RNA found in the .rtp files

Copy the ffamber files of interest into the /ULG-A/top directory

If you're doing this in Linux or OSX, you might as well move all of the files you want installed into a single directory and su cp * /ULG-A/top. Note that the .itp and .gro files in your ffamber_v3.3.1 (for the 3.3.x GROMACS) are the same for all of the AMBER force field flavors you can install. Further, all of the ffamber* files have unique names (94, 99, 03, etc.), so you can install all the force field files into /ULG-A/top and use whichever.

Modify /ULG-A/top/FF.dat to reflect the new force field files

The FF.dat file as installed by GROMACS looks like the following:

9
ffG43a1  GROMOS96 43a1 force field
ffG43b1  GROMOS96 43b1 vacuum force field
ffG43a2  GROMOS96 43a2 force field (improved alkane dihedrals)
ffG45a3  GROMOS96 45a3 force field (Schuler JCC 2001 22 1205)
ffG53a5  GROMOS96 53a5 force field (JCC 2004 vol 25 pag 1656)
ffG53a6  GROMOS96 53a6 force field (JCC 2004 vol 25 pag 1656)
ffoplsaa OPLS-AA/L all-atom force field (2001 aminoacid dihedrals)
ffencadv Encad all-atom force field, using scaled-down vacuum charges
ffencads Encad all-atom force field, using full solvent charges    

To include the AMBER force field files (so that these separate files can be called during pdb2gmx), we modify the FF.dat file by (1) incrementing the total number of force fields and (2) adding the force field code and text description to this file. The new FF.dat file will look like this if you added all of the ffamber force field files:

17
ffG43a1  GROMOS96 43a1 force field
ffG43b1  GROMOS96 43b1 vacuum force field
ffG43a2  GROMOS96 43a2 force field (improved alkane dihedrals)
ffG45a3  GROMOS96 45a3 force field (Schuler JCC 2001 22 1205)
ffG53a5  GROMOS96 53a5 force field (JCC 2004 vol 25 pag 1656)
ffG53a6  GROMOS96 53a6 force field (JCC 2004 vol 25 pag 1656)
ffoplsaa OPLS-AA/L all-atom force field (2001 aminoacid dihedrals)
ffencadv Encad all-atom force field, using scaled-down vacuum charges
ffencads Encad all-atom force field, using full solvent charges
ffamber94 AMBER94 Cornell et al. (1995), JACS 117, 5179-5197
ffamber96 AMBER96 Kollman (1996), Acc. Chem. Res. 29, 461-469
ffamberGS AMBER99GS Garcia & Sanbonmatsu (2002), PNAS 99, 2782-2787
ffamberGSs AMBER99GSs Nymeyer & Garcia (2003) PNAS 100, 13934-13939
ffamber99 AMBER99 Wang et al. (2000), J. Comp. Chem. 21, 1049-1074
ffamber99p AMBER99p Sorin & Pande (2005). Biophys. J. 88(4), 2472-2493
ffamber99SB AMBER99sb Hornak et. al (2006). Proteins 65, 712-725
ffamber03 AMBER03 Duan et al. (2003), J. Comp. Chem. 24, 1999-2012

Add and increment numbers as appropriate for the force field you want to use. You can download the complete FF.dat at the following link and comment:

Download amber_FF.txt, delete "amber_", change ".txt" to ".dat", place in /ULG-A/top

source /UGL-A/bin/GMXRC

The GMXRC file contains path-dependent settings for your shell.

In theory, you're all done. At least, this is the end of the installation process according to the official AMBER-on-GROMACS list. The IMPORTANT NOTES section contains relevant information but does not complete the installation. The additional steps are provided below.

Modify the /ULG-A/top/spc.itp file

If you're running through a complete energy minimization calculation with the website installation followed, your first source of error (hopefully) comes in the form of…

Program grompp_amber, VERSION 3.3.3
Source code file: toppush.c, line: 1193

Fatal error:
[ file "/usr/local/gromacs333_amber/share/gromacs/top/spc.itp", line 32 ]:
Atom index (1) in bonds out of bounds (1-0).
This probably means that you have inserted topology section "bonds"
in a part belonging to a different molecule than you intended to.
In that case move the "bonds" section to the right molecule.

The origin of this error is the lack of amberXX water parameters in the spc.itp file (nothing directly to do with the reported GROMACS error). The fix for this is straightforward, simply modifying the spc.itp file in the /ULG-A/top directory as follows below. The original spc.itp file below…

[ moleculetype ]
; molname       nrexcl
SOL             2

[ atoms ]
;   nr   type  resnr residue  atom   cgnr     charge       mass
#ifdef _FF_GROMACS
1     OW      1    SOL     OW      1      -0.82
2     HW      1    SOL    HW1      1       0.41
3     HW      1    SOL    HW2      1       0.41
#endif
#ifdef _FF_GROMOS96
#ifdef HEAVY_H
1     OW      1    SOL     OW      1      -0.82    9.95140
2      H      1    SOL    HW1      1       0.41    4.03200
3      H      1    SOL    HW2      1       0.41    4.03200
#else
1     OW      1    SOL     OW      1      -0.82   15.99940
2      H      1    SOL    HW1      1       0.41    1.00800
3      H      1    SOL    HW2      1       0.41    1.00800
#endif
#endif
#ifdef _FF_OPLS
1  opls_116   1    SOL     OW      1      -0.82
2  opls_117   1    SOL    HW1      1       0.41
3  opls_117   1    SOL    HW2      1       0.41
#endif

#ifdef FLEXIBLE
[ bonds ]
; i     j       funct   length  force.c.
1       2       1       0.1     345000  0.1     345000
1       3       1       0.1     345000  0.1     345000

[angles ]
; i     j       k       funct   angle   force.c.
2       1       3       1       109.47  383     109.47  383
#else
[ settles ]
; OW    funct   doh     dhh
1       1       0.1     0.16330

[ exclusions ]
1       2       3
2       1       3
3       1       2
#endif

is modified to this…

[ moleculetype ]
; molname       nrexcl
SOL             2

[ atoms ]
;   nr   type  resnr residue  atom   cgnr     charge       mass
#ifdef _FF_GROMACS
1     OW      1    SOL     OW      1      -0.82
2     HW      1    SOL    HW1      1       0.41
3     HW      1    SOL    HW2      1       0.41
#endif
#ifdef _FF_GROMOS96
#ifdef HEAVY_H
1     OW      1    SOL     OW      1      -0.82    9.95140
2      H      1    SOL    HW1      1       0.41    4.03200
3      H      1    SOL    HW2      1       0.41    4.03200
#else
1     OW      1    SOL     OW      1      -0.82   15.99940
2      H      1    SOL    HW1      1       0.41    1.00800
3      H      1    SOL    HW2      1       0.41    1.00800
#endif
#endif
#ifdef _FF_OPLS
1  opls_116   1    SOL     OW      1      -0.82
2  opls_117   1    SOL    HW1      1       0.41
3  opls_117   1    SOL    HW2      1       0.41
#endif

#ifdef _FF_AMBER94
; also applies to FF_AMBER96, FF_AMBERGS, and FF_AMBERGSs
1  amber94_42   1  SOL     OW      1      -0.82  15.99940
2  amber94_27   1  SOL    HW1      1       0.41   1.00800
3  amber94_27   1  SOL    HW2      1       0.41   1.00800
#endif

#ifdef _FF_AMBER99
; also applies to FF_AMBER99P, FF_AMBER99SB, FF_AMBER03
1  amber99_54   1  SOL     OW      1      -0.82  15.99940
2  amber99_55   1  SOL    HW1      1       0.41   1.00800
3  amber99_55   1  SOL    HW2      1       0.41   1.00800
#endif



#ifdef FLEXIBLE
[ bonds ]
; i     j       funct   length  force.c.
1       2       1       0.1     345000  0.1     345000
1       3       1       0.1     345000  0.1     345000

[ angles ]
; i     j       k       funct   angle   force.c.
2       1       3       1       109.47  383     109.47  383
#else
[ settles ]
; OW    funct   doh     dhh
1       1       0.1     0.16330

[ exclusions ]
1       2       3
2       1       3
3       1       2
#endif

This FFAMBER-included spc.itp file is downloadable in the following form and comment:

Download amber_spc.txt, delete "amber_" change ".txt" to ".itp", place in /ULG-A/top

At this point, pdb2gmx, editconf, genbox, grompp, and genion should all work without error. The next problem comes with the post-genion grompp, which can't find ion information…

Modify ions.itp

Similar to the spc.itp error, the error that comes up with the inclusion of counterions confounds the mind because everything seems to be in place.

Program grompp_amber, VERSION 3.3.3
Source code file: toppush.c, line: 1396

Fatal error:
No such moleculetype Na

With Na being whatever counterion you're trying. The AMBER-on-GROMACS website reports the following for AMBER ion inclusion:

Our AMBER ports include common ion definitions, which are listed in the ffamber*.rtp files (just below the TIP water models). This allows the AMBER ports to be used without modification or use of the GROMACS ions.itp file. At the moment these include Cl- , IB+, Na+, K+ , Rb+, Cs+, Li+ , Ca2+, Mg2+, Zn2+, Sr2+, and Ba2+. If your pdb file has ions present and pdb2gmx does not properly convert those ions, please check the atom and residue name of your ions and rename them if necessary to agree with the .rtp file. If you are using ion-related GROMACS tools, such as genion, you will need to enter the AMBER ion definition to the ions.itp file in the "top" directory of the GROMACS distribution.

The bases for the ion use are in the .rtp files, but the implementation, at least for GROMACS 3.3.3 and possibly earlier versions, is not as found in these files.

The proper format for both the FFAMBER_94 and FFAMBER_99 ion types in ions.itp is as follows:


#ifdef _FF_AMBER94

[ moleculetype ]
; molname       nrexcl
Na              1
[ atoms ]

; id    at type         res nr  residu name     at name  cgnr   charge    mass
1       amber94_31      1       Na              Na       1      1         22.99000
#endif

#ifdef _FF_AMBER99

[ moleculetype ]
; molname       nrexcl
Na              1
[ atoms ]

; id    at type         res nr  residu name     at name  cgnr   charge    mass
1       amber99_31      1       Na              Na       1      1         22.9900
#endif

This is the format used for the FF_GROMOS96 ions with one change. The atom type for the FF_AMBERXX parameters is NOT the atom label, but instead the AMBER force field label. In the case of Na, this is amber94_31 (for AMBER94) and amber99_31 (for AMBER99). Note that the mass must be specified (you have to scroll down the ions.itp file to see FF_GROMOS96. FF_GROMACS does not require mass specification).

For quick reference, here are the following [ atoms ] specifications for FF_AMBER94 and FF_AMBER_99.

#ifdef _FF_AMBER94
; id    at type         res nr  residu name     at name  cgnr   charge    mass
1       amber94_32      1       IB              IB       1      1         131.00000
1       amber94_56      1       Li              Li       1      1         6.94000
1       amber94_31      1       Na              Na       1      1         22.99000
1       amber94_51      1       K               K        1      1         39.10000
1       amber94_52      1       Rb              Rb       1      1         85.47000
1       amber94_53      1       Cs              Cs       1      1         132.90000
1       amber94_33      1       Mg              Mg       1      2         24.30500
1       amber94_15      1       Ca              Ca       1      2         40.08000
1       amber94_57      1       Zn              Zn       1      2         65.40000
1       amber94_58      1       Sr              Sr       1      2         87.62000
1       amber94_59      1       Ba              Ba       1      2         137.33000
1       amber94_30      1       Cl              Cl       1      -1        35.45000
#endif

#ifdef _FF_AMBER99
; id    at type         res nr  residu name     at name  cgnr   charge    mass
1       amber99_32      1       IB              IB       1      1         131.00000
1       amber99_56      1       Li              Li       1      1         6.94000
1       amber99_31      1       Na              Na       1      1         22.99000
1       amber99_51      1       K               K        1      1         39.10000
1       amber99_52      1       Rb              Rb       1      1         85.47000
1       amber99_53      1       Cs              Cs       1      1         132.90000
1       amber99_33      1       Mg              Mg       1      2         24.30500
1       amber99_15      1       Ca              Ca       1      2         40.08000
1       amber99_57      1       Zn              Zn       1      2         65.40000
1       amber99_58      1       Sr              Sr       1      2         87.62000
1       amber99_59      1       Ba              Ba       1      2         137.33000
1       amber99_30      1       Cl              Cl       1      -1        35.45000
#endif

To save yourself plenty of trouble, download the ions.itp file with all of the ion parameters in the form of the following link:

Download amber_ions.txt, delete "amber_", change ".txt" to ".itp", place in /ULG-A/top

With the ions.itp file complete, your GROMACS energy minimizations and dynamics simulations of amino acid and nucleic acid structures should go without hitch.

My thanks to Alan Wilter S. da Silva, D.Sc. – CCPN Research Associate, Department of Biochemistry, University of Cambridge, for catching a formatting error in the first version of the amber_ions.itp file.

If you find problems, questions, concerns, incompatibilities, etc., please let me know by setting up a user account and posting a comment in this post or email me so I can post whatever you might find.

And don't forget to cite ffAMBER if you use it!

Sorin & Pande (2005). Biophys. J. 88(4), 2472-2493

chemistry.csulb.edu/ffamber
www.gromacs.org
chemistry.csulb.edu/esorin
chemistry.csulb.edu
amber.scripps.edu
www.nanorex.com
en.wikipedia.org/wiki/DNA_nanotechnology
www.somewhereville.com/rescv/fnano08_2008_poster.jpg
www.cs.duke.edu/~reif/FNANO
www.ks.uiuc.edu/Research/namd
en.wikipedia.org/wiki/Open_source
folding.stanford.edu
qutemol.sourceforge.net
www.pdb.org
www.pdb.org/pdb/explore/explore.do?structureId=1BNA
www.linux.org
www.apple.com/macosx
www.gromacs.org/documentation/reference/online/pdb2gmx.html