Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008 Washington University in St. Louis
This file is part of APBS.
Copyright (c) 2002-2008, Washington University in St. Louis.
Portions Copyright (c) 2002-2008. Nathan A. Baker
Portions Copyright (c) 1999-2002. The Regents of the University of California.
Portions Copyright (c) 1995. Michael Holst.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Table of Contents
List of Tables
List of Examples
List of Equations
APBS is a software package for the numerical solution of the Poisson-Boltzmann equation (PBE), one of the most popular continuum models for describing electrostatic interactions between molecular solutes in salty, aqueous media. Continuum electrostatics plays an important role in several areas of biomolecular simulation, including:
simulation of diffusional processes to determine ligand-protein and protein-protein binding kinetics,
implicit solvent molecular dynamics of biomolecules,
solvation and binding energy calculations to determine ligand-protein and protein-protein equilibrium binding constants and aid in rational drug design,
and biomolecular titration studies.
APBS was designed to efficiently evaluate electrostatic properties for such simulations for a wide range of length scales to enable the investigation of molecules with tens to millions of atoms.
APBS uses PMG to solve the Poisson-Boltzmann equation numerically. PMG is developed and maintained by the Holst Research Group at UC San Diego, and is designed to solve the nonlinear Poisson-Boltzmann equation and similar problems with linear space and time complexity through the use of box methods, inexact Newton methods, and algebraic multilevel methods. More information about PMG may be found at http://www.fetk.org.
Additionally, APBS uses the "Aqua" library, a version of Holst group PMG that has been specially optimized by Patrice Koehl for improved memory usage and speed when solving the Poisson-Boltzmann equation.
APBS also uses FEtk to solve the Poisson-Boltzmann equation numerically. FEtk is developed and maintained by the Holst Research Group at UC San Diego, and is designed to solve general coupled systems of nonlinear partial differential equations accurately and efficiently using adaptive multilevel finite element methods, inexact Newton methods, algebraic multilevel methods. More information about FEtk may be found at http://www.fetk.org.
Financial support. The development of APBS has been supported financially by:
Citing APBS. Please acknowledge your use of APBS by citing:
Citing FEtk and PMG. Please acknowledge your use of PMG and FEtk by citing:
M. Holst and F. Saied, Multigrid solution of the Poisson-Boltzmann equation. J. Comput. Chem., 14 (1993), pp. 105-113.
M. Holst and F. Saied, Numerical solution of the nonlinear Poisson-Boltzmann equation: Developing more robust and efficient methods. J. Comput. Chem., 16 (1995), pp. 337-364.
M. Holst, Adaptive numerical treatment of elliptic systems on manifolds. Advances in Computational Mathematics, 15 (2001), pp. 139-191.
R. Bank and M. Holst, A New Paradigm for Parallel Adaptive Meshing Algorithms. SIAM Review, 45 (2003), pp. 291-323.
Contributing authors. APBS was primarily written by Nathan Baker during his graduate work with J. Andrew McCammon and Michael Holst and extensively developed over the subsequent years. APBS uses several libraries written by Mike Holst and members of the Holst group, including: PMG (multigrid solver for Cartesian mesh discretization), FEtk (provides finite element framework, error estimators, and solvers), and MALOC (hardware abstraction library for code portability). Additionally, a number of people have made important contributions to enhance APBS functionality and usability. The full author list (in alphabetical order) is:
Nathan A. Baker
Primary author
Steve Bond
Contributor: FEtk library compatibility and Vopot functions
Larry Canino
Contributor: solvent accessibility function modification
Todd Dolinsky
Developer and contributor: Python wrappers, PDB2PQR, output logging, examples, and other tools
Adrian Elcock
Contributor: parameter files
David Gohara
Developer
Michael J. Holst
Advisor and author of several routines scattered about APBS, and author of PMG (the multigrid library used by this code), author of MALOC (hardware abstraction library used by this code), author of FEtk (finite element library incorporated in developmental versions of this code)
Adrian Kaats
Contributor: multivalue.c
Patrice Koehl
Contributor: Aqua, a streamlined version of the Holst group PMG multigrid library
Robert Konecny
Contributor: parameters, CHARMM FORTRAN interface
Jung-Hsin Lin
Contributor: OpenDX to MOLMOL conversion
Chiansan Ma
Contributor: format conversion scripts
J. Andrew McCammon
Advisor, financial and equipment support, functionality suggestions
Jens Nielsen
Contributor: PDB2PQR
Jay Ponder
Contributor: TINKER Interface
Michael Schnieders
Contributor: Polarizable atomic multipole routines, TINKER interface
David Sept
Contributor: scripts and tools, VMD compatibility, general suggestions about functionality
Tongye Shen
Contributor: finite element mesh generation
Justin Xiang
Contributor: generalized Born Python utilities
Table of Contents
The following sections outline the installation of APBS on a generic UNIX platform as well as installation instructions for various specific machines.
The latest version of APBS can always be found at http://apbs.sourceforge.net. APBS is available in both source code form and binaries for a variety of architectures.
We currently offer binaries for the RedHat Linux platform on a variety of architectures as well as command line binaries for WinXP and Mac OS X. Binaries can be downloaded from the APBS download page. For all other systems, please install from source on your particular platform and feel free to contact the APBS users mailing list for more help and/or to request a binary for that system.
APBS binaries are provided in compressed tar format (*.tgz). On most systems, the binaries can be unarchived by simply double-clicking or opening the archive. This can also be accomplished on the comamnd line by
$gzip -dc apbs-1.0.0-XYZ.tgz | tar xvf -
where XYZ is the particular architecture of the binary you downloaded.
Note that this will expand into a directory called apbs-1.0.0-XYZ. The contents of this directory can be placed anywhere on your system that you prefer (and have access to). The specific sub-directory of this archive is described in Section 2.3.5, “APBS directory structure”, which contains information about the location of documentation, examples, libraries, header files, and binaries. The APBS binaries do not contain dependencies on special data files, etc. and can be moved out of this directory structure without causing any problems for APBS execution.
If you were unable to find the binary pacakge for your system, or would like to compile APBS yourself, you'll need to read the instructions in this section.
In order to install APBS from the source code, you will need:
C and Fortran compilers
The APBS source code (see above)
![]() | Note |
|---|---|
Note that the Holst group MALOC source code is now provided with APBS to facilitate installation. |
It may also be useful to have:
Source-code-based installation has been tested on the following systems
However, the installation procedure is rather generic and generally works on most UNIX-based systems. System-specific installation notes and caveats are provided in Section 2.3.6, “System-specific notes”.
In what follows, I'll be assuming you're using bash, a shell available on most platforms (UNIX and non-UNIX).
First, please look at Section 2.3.6, “System-specific notes” section of this document for appropriate compiler flags, etc. to be set via pre-configuration environmental variables. This section outlines generic installation procedures with default compilers and options.
There are a few directories you'll need to identify prior to installation. The
first, which we'll call APBS_SRC, will contain the APBS
and MALOC source code. This directory can be deleted after installation, if you
wish. The second directory will be the permanent location for APBS and MALOC;
we'll call this APBS_PREFIX. If you have root
permission, you could pick a global directory such as
/usr/local for this; otherwise, pick a directory for which
you have write permission. The following commands set up the directories and
environmental which point to them:
$export APBS_SRC=/home/soft/src$export APBS_PREFIX=/home/soft$mkdir -p ${APBS_SRC} ${APBS_PREFIX}
Before compiling/installing APBS, you need to configure with the autoconf
configure script. You can examine the various configure options with
the --help option. For many platforms, no options need to be
specified. Therefore, most users who want single-CPU (not parallel)
binaries can configure as follows:
$cd ${APBS_SRC}/apbs$./configure --prefix=${APBS_PREFIX}
Other configuration options, including the compilation of parallel binaries and the use of machine-specific compilers and Python usage, are discussed in Section 2.3.6, “System-specific notes”.
Assuming all has gone well with the configuration (you'll generally get an error message if configuration fails), you're ready to compile
$make all
and install APBS:
$make install
The APBS installation process (whether compiled from source or installed as pre-compiled binaries) will create several directories under
${APBS_PREFIX}:
bin, where the main
apbs binary resides
share, which contains the documentation (user guide, tutorial, programmer's guide) as well as a number of
examples and test cases for APBS
include, which contains header files for
using APBS libraries with other applications
lib, which contains library files for
using APBS libraries with other applications
tools, which contains a number of "helper"
applications for use with APBS.
At this point you are ready to use APBS; either by calling the binary directly or adding the above directory to your path. As mentioned above, there are also several tools provided with APBS that remain in the APBS directory; these are described in later portions of this manual. You may wish to copy these to a global location (or the same place as your APBS binary) at this time.
![]() | Important |
|---|---|
If you have tips or tricks on improving APBS performance and/or installation on your machine, please let us know! |
This section provides tips on compiling APBS on specific platforms and outlines some of the basic options available for parallel execution, Python linkage, etc. Note that many aspects of this section have changed from previous releases. In particular, APBS now tries to detect the optimal compilers and BLAS libraries on most systems without user intervention.
As described above, the default configure-make-install procedure is
$./configure --prefix=${APBS_PREFIX}$make$make install
The configure script includes a number of generic options to manually set default compilers, link behaviors, preprocessors, etc. These can be reviewed by running
$./configure --help
If an optimized (vendor) BLAS library is available, it should be used with APBS since it will generally provide better performance. This can be enabled by the --with-blas=... option. The configure-make-install procedure is:
$./configure --with-blas='-L/path/to/blas -lblas'$make$make install
where /path/to/blas is the location of a library named libblas.a.
Python libraries and related tools can be enabled at configure-time. Currently, Python libraries compile on most Linux and Mac systems. Other systems are untested. The configure-make-install procedure is:
$./configure --enable-python --prefix=${APBS_PREFIX}$make$make install
APBS uses MPI for parallel execution. In general, MPI support requires informing the APBS configure script about:
MPI compiler options. For most MPI implementations, you
simply need to set the CC and
F77 variables to point to the
MPI-savvy C and FORTRAN compilers. However, it is
occasionally necessary to manually specify compiler
options by setting
CFLAGS,
CPPFLAGS,
FFLAGS, and
LDFLAGS before configuration.
MPI library/header file locations. As outlined below,
paths to the library and header files for LAM and
MPICH
implementations of MPI can be specified with the
--with-lam,
--with-mpich, or
--with-mpich2 configure options. Other
MPI implementations will require the
CFLAGS,
CPPFLAGS,
FFLAGS, and
LDFLAGS variables to be set
correctly before configuration to locate the required
headers and libraries.
It is important that you enable FORTRAN support and use the same
compilers you will use to compile APBS when installing/compiling
LAM MPI. For example, if
your C compiler is set in the environmental variable
${CC} and your FORTRAN compiler is set in the
environmental variable ${F77}, then you should
configure LAM with the command
$./configure --prefix=${MPI_PREFIX} --with-fc=${F77}
Let ${MPI_PREFIX} be an environmental variable
pointing to the directory where LAM MPI is installed.
In
other words, ${MPI_PREFIX}/lib should contain the
LAM MPI libraries and ${MPI_PREFIX}/include should
contain the LAM MPI header files. The configure-make-install procedure
is then
$export CC=${MPI_PREFIX}/bin/mpicc$export F77=${MPI_PREFIX}/bin/mpif77$./configure --with-lam=${MPI_PREFIX} --prefix=${APBS_PREFIX}$make$make install
This procedure was tested with LAM MPI 7.2.1.
It is important that you enable FORTRAN support and use the same
compilers you will use to compile APBS when installing/compiling
MPICH1.
For example, if your C compiler is set in the environmental variable
${CC} and your FORTRAN compiler is set in the
environmental variable ${F77}, then you should
configure MPICH1 with the command
$./configure --prefix=${MPI_PREFIX} ... --enable-f77
where ... denotes other machine-specific options such as
--with-device=ch_p4 or
--with-arch=LINUX.
Let ${MPI_PREFIX} be an environmental variable
pointing to the directory where
MPICH1
is installed. In other words, ${MPI_PREFIX}/lib
should contain the
MPICH1
libraries and ${MPI_PREFIX}/include should contain
the
MPICH1
header files. The configure-make-install procedure
is then
$export CC=${MPI_PREFIX}/bin/mpicc$export F77=${MPI_PREFIX}/bin/mpif77$./configure --with-mpich=${MPI_PREFIX} --prefix=${APBS_PREFIX}$make$make install
This procedure was tested with MPICH2 1.0.6p1.
It is important that you enable FORTRAN support and use the same compilers you will use to compile APBS when installing/compiling MPICH2.
Let ${MPI_PREFIX} be an environmental variable
pointing to the directory where
MPICH2
is installed. In other words, ${MPI_PREFIX}/lib
should contain the
MPICH2
libraries and ${MPI_PREFIX}/include should contain
the
MPICH2
header files. The configure-make-install procedure
is then
$export CC=${MPI_PREFIX}/bin/mpicc$export F77=${MPI_PREFIX}/bin/mpif77$./configure --with-mpich2=${MPI_PREFIX} --prefix=${APBS_PREFIX}$make$make install
This procedure was tested with MPICH1 1.2.7p1.
In order to enable support for the finite element features in APBS, you must
compile it against the FEtk libraries.
Please use the same compilers for both APBS and FEtk.
Let ${FETK_PREFIX} be an environmental variable pointing
to the directory where FEtk was installed. In other words,
${FETK_PREFIX}/lib should contain the FEtk machine-specific
library directories and ${FETK_PREFIX}/include should
contain the FEtk header files. You'll first need to identify the appropriate
library directory for your system in ${FETK_PREFIX}/lib.
For the purposes of this example, let's suppose this directory is
${FETK_PREFIX}/lib/x86_64-unknown-linux-gnu.
The configure-make-install procedure for APBS is then
$./configure --with-fetk-include=${FETK_PREFIX}/include --with-fetk-library=${FETK_PREFIX}/lib/x86_64-unknown-linux-gnu --prefix=${APBS_PREFIX}$make$make install
We are happy to now provide native APBS command line binaries for Windows. The binary is probably the best option available, but if you would still like to compile your own binaries you will need to use either the Cygwin or MinGW environments. Binaries compiled under Cygwin tend to require Cygwin DLLs and thus can only be run on systems with Cygwin. Performance for the Windows binaries and all compiled systems will be fairly mediocre as they depend on the GNU compilers.
If you do choose to use Cygwin and compile your own code, compilation should be rather straightforward.
We are happy to now provide a Mac install package for Mac OS 10.4 (Tiger). Unfortunately this is the only binary for Mac that we have available, so users on OS 10.3 may have to compile binaries for themselves - you may want to examine the apbs-users mailing list which has a number of threads which discuss installation on Mac OS platforms. Alternatively you can try using Fink for the installation - please see Bill Scott's excellent guidelines at http://chemistry.ucsc.edu/~wgscott/xtal.
A few notes about compiling on Macintosh:
It has become apparent from the mailing lists that some "packages" of the GNU development software available for MacOS contain different major versions of the C and FORTRAN compilers. This is very bad; APBS will not compile with different versions of the C and FORTRAN compilers. If you use GCC 4.0, for instance, gfortran 4.0 will work while g77 3.3 will not. If you see link errors involving "restFP" or "saveFP" this is most likely the cause.
In gcc 4.0 (included in Xcode 2.0 and higher) the -fast option turns on the -fast-math flag. This flag optimizes by using rounding, and thus can lead to inaccuate results and should be avoided.
As it stands now the autoconf script does not support using the native vecLib framework as an architecture-tuned BLAS replacement. In testing there were only slight timing improvements over using the MALOC-supplied BLAS as it is.
We have had success using IBM's XLF for Mac in conjunction with GCC 4.0, although the corresponding XLC compilers do not seem to work under Tiger.
Finally, Dave Gohara has prepared a nice tutorial on building APBS from within Xcode to take advantage of its development and debugging features.
Table of Contents
This chapter gives an overview of the binaries, tools, etc. distributed as part of the APBS software package. It is organized by directory; later chapters provide a more in-depth description on tools specific to particular applications.
As mentioned in the
Installation intructions, the main
APBS binary is installed in
${FETK_PREFIX}/bin/${prefix}/ where
${prefix} is a machine-specific directory. Of course,
you can move the binary to any directory you choose. APBS is invoked with a
very simple syntax:
apbs [options] input-file
Command line options include:
--outputfile=nameSets the output logging path (as described in the
output logging section of
the manual) to name, or
name_N for parallel runs, where
N is the processor ID.
If --outputformat is not specified, flat-file
format will be used as the default.
--outputformat=typeSets the output logging format. Accepted values are:
flatFlat-file format (default).
xmlXML format
--helpDisplays command line usage
--versionDisplays the current APBS version
input-file is an input file with a
specific syntax described in Section 4.2, “Input files”.
Besides the output files specified in
input-file and optional logs as specified by
use of the --output-file command line
option, APBS writes data to three additional places:
Standard output. This will appear on your screen (if you don't redirect it somewhere) and will contain all the basic information about the electrostatics calculation.
Standard error. This will also appear on your screen (if you don't redirect it somewher) and will contain warnings and error messages.
The file io.mc (or
io.mc_N for parallel runs, where
N is the processor ID. This gives you detailed
information about the progress of the run with a particular focus on
the numerical solver.
APBS contains a number of tools to facilitate the preparation of APBS runs and analysis of the results.
![]() | Note |
|---|---|
NOTE: In addition to the tools provided with APBS, there are a number of other programs which interoperate with our code. Please see the Other Programs section of this manual for more information. |
Unfortunately, the majority of problems encountered during electrostatics calculations arise in process of taking a structure from the Protein Data Bank and transforming into a file that can be used by the APBS software. The PDB2PQR service was orginally developed in conjunction with Jens Nielsen and Andy McCammon to address these issues. The service has since evolved and has been completely rewritten by Todd Dolinsky and Nathan Baker. PDB2PQR is able to:
Fill in missing atoms in the PDB (within reason)
Add hydrogens to the structure to optimize the hydrogen-bonding network.
Calculate side-chain pKas
Assign charges and radii according to one of the following force fields: CHARMM23, AMBER02, or PARSE
Return the results in PQR format
Generate APBS input files.
Please visit the PDB2PQR home page ( http://pdb2pqr.sourceforge.net) for more information, links to available servers, and download options.
Additionally, APBS provides the ability to read plain PDB-format files and assign charges and radii from user-supplied parameter files. These features are described in the READ PARAM command description.
Finally, APBS provides a few other miscellaneous tools for converting and parameterizing structures:
tools/conversion/qcd2pqr.awk
Convert a QCD file (UHBD format for a molecule) to PQR format.
tools/conversion/amber2charmm.sh
A script which converts a PDB file with AMBER atom names to a PDB file with CHARMM atom names. Useful for preprocessing files before converting with pdb2pqr.
tools/conversion/WHATIF2AMBER.sed
A sed script for converting a PDB file with WHATIF atom names to a PDB file with AMBER atom names. Useful for preprocessing files before converting with pdb2pqr. Contributed by Chiansan Ma.
In addition to parameterization of the molecule, there are several common operations which are performed to setup the calculation. This section reviews some of the tools available for these operations. Please note that PDB2PQR (see Section 3.2.1, “Parameterization” above) also prepares APBS input files.
The following scripts help generate or transform APBS input files:
Get the dimensions and center of a molecule in PQR format. Very useful for setting up input files (i.e., grid dimensions, lengths, spacings, etc.) for APBS calculations. Written by Todd Dolinsky and Nathan Baker.
apbs/tools/manip/inputgen.py
Generate an APBS input file from PQR format data using "suggested" parameters. Also can decouple a parallel calculation into a series of sequential (asynchronous) calculations to be performed on a single processor. Written by Todd Dolinsky and Nathan Baker.
tools/mesh/mgmesh
List acceptable grid dimensions/multigrid levels combinations for mg-manual calculations. Written by Nathan Baker
The following tools perform typical analyses of the output data, usually in OpenDX format. These scripts are not meant to be comprehensive; instead, they provide templates for users to generate their own tools.
tools/mesh/uhbd_asc2bin
Converts UHBD-format grid files from ASCII to binary. Contributed by Dave Sept.
tools/mesh/dx2mol
Converts OpenDX format data to MOLMOL format. Contributed by Jung-Hsin Lin with bug fixes by Fred Damberger.
tools/mesh/dx2uhbd
Converts OpenDX format data to UHBD format. Contributed by Robert Konecny.
tools/mesh/mergedx
Merge
OpenDX format
data from several domains (e.g., from a
mg-para
calculation into a single file. This
program is deprecated (replaced by
mergedx2 and will be
removed in an upcoming release. Contributed
by Steve Bond.
tools/mesh/mergedx2
Merge OpenDX
format
data from several domains (e.g., from a
mg-para
calculation into a single file while
allowing resampling of the data to
increase/decrease resolution. This function
will eventually replace
mergedx. Contributed
by Dave Gohara.
tools/mesh/smooth
Apply a very inefficient Gaussian filter to OpenDX format data from APBS. Written by Nathan Baker.
This section describes the data visualization tools provided with APBS. A more complete discussion of the various ways to visualize APBS output is presented in the Visualization section of this manual.
tools/visualization/vmd
This directory contains scripts which facilitate the visualization of APBS data with VMD.
![]() | Note |
|---|---|
NOTE: As described in the Visualization section, a much more elegant interface has been developed for APBS and is available from the VMD plugins page. |
The version distributed with APBS was written by Nathan Baker and
Dave Sept based on example Tcl scripts by John Stone. The file
loadstuff.vmd is the command file to be
modified to the users' tastes and loaded into VMD. The file
read_dx contains the Tcl
functions needed to read the APBS output.
tools/visualization/opendx
This directory contains the
OpenDX
program files (*.net) required to visualize
APBS data with OpenDX. In particular, one can visualize single-file
potential isocontours (pot.*), single-file
potential data mapped onto molecular surfaces
(potacc.*), or multiple-file potential data
(multipot.*).
The main APBS executable calculates molecular volumes, surface areas, and other surface-based properties from PQR-format structural data. Such calculations are often used to determine apolar solvation contributions to binding events, etc. See the new APOLAR keyword for more documentation on this APBS feature.
These utilities are provided for occasional use and are definitely not optimized for speed.
![]() | Note |
|---|---|
NOTE: Many of these tools will be incorporated into the main APBS executable during upcoming releases! |
The program tools/manip/coulomb calculates
vacuum Coulomb law energies from a PQR file. It
has a number of options which can be viewed by running the
coulomb program with no arguments.
The program tools/manip/born is a crude,
non-optimal, buggy program (are you still reading?!?) for calculating
Generalized Born electrostatic energies. This is only intended for
hacking and general comparison with Poisson-Boltzmann results.
The Python-based program tools/python/runGB.py
is a test program designed to
calculate generalized Born radii from
APBS Poisson-Boltzmann calculations
following the general methods of
Onufriev A, Case DA, Bashford D.
Effective Born radii in the generalized
Born approximation: The importance of
being perfect. J Comput Chem. 23
(14), 1297-304, 2002. http://dx.doi.org/10.1002/jcc.10126.
More information on this program can be
obtained by running it from the command
line with the --help
option.
The Python-based program
tools/python/readGB.py
is a test program designed to use radii
calculated from
runGB.py (see
above) and print out solvation
energies. More information on this
program can be obtained by running it
from the command line with the
--help option.
Both of these Python-based programs were written by Justin Xiang.
tools/arpack/driver
If APBS is linked with ARPACK (see configure
--help), this routine will perform eigenvalue analyses of
matrices produced by APBS.
There are a number of example Python tools and wrappers provided in the tools/python directory. These tools all make use of the APBS SWIG wrappers developed by Todd Dolinsky, Nathan Baker, Alex Gillet, and Michel Sanner. The SWIG wrappers are compiled by default during normal installation. The Python scripts which link to the wrappers (and thereby illustrate their use) include:
tools/python/main.py
Drop-in replacement for main APBS executable. Only permits sequential runs.
tools/python/noinput.py
Similar to main.py, but adds the ability to read input files and PQR files as Python strings and return energies and forces as Python lists. This makes it a very useful tool for working with APBS via Python without dealing with a great deal of file I/O.
tools/python/vgrid/
Python wrappers for Vgrid class to allow OpenDX format file I/O in Python scripts
The APBS sub-directory examples contains
several test systems which show how to use APBS for
binding energy, solvation energy, and force calculations. The file
examples/README.html contains descriptions of the
test cases and links to anticipated results. Examples can be run
and compared to expected results by running make test
in each example directory.
Additional examples are provided as part of the APBS tutorial
(doc/html/tutorial/), described in more detail in
the Documentation section.
The APBS sub-directory doc contains guides for
using APBS and developing code based on APBS libraries. The
subdirectories include:
doc/html/user-guide/index.html
HTML-format User Guide
doc/html/programmer/index.html
HTML-format Programmer Guide
HTML-format APBS tutorial
The APBS sub-directory src contains the source
code for the APBS libraries and main executable. These files are
described in more detailed in the
Programming section.
Table of Contents
As mentioned in the
Installation intructions, the main
APBS binary is installed in
${FETK_PREFIX}/bin/${prefix}/ where
${prefix} is a machine-specific directory. Of course,
you can move the binary to any directory you choose. APBS is invoked with a
very simple syntax:
apbs [options] input-file
Command line options include:
--outputfile=nameSets the output logging path (as described in the
output logging section of
the manual) to name, or
name_N for parallel runs, where
N is the processor ID.
If --outputformat is not specified, flat-file
format will be used as the default.
--outputformat=typeSets the output logging format. Accepted values are:
flatFlat-file format (default).
xmlXML format
--helpDisplays command line usage
--versionDisplays the current APBS version
input-file is an input file with a
specific syntax described in Section 4.2, “Input files”.
Besides the output files specified in
input-file and optional logs as specified by
use of the --output-file command line
option, APBS writes data to three additional places:
Standard output. This will appear on your screen (if you don't redirect it somewhere) and will contain all the basic information about the electrostatics calculation.
Standard error. This will also appear on your screen (if you don't redirect it somewher) and will contain warnings and error messages.
The file io.mc (or
io.mc_N for parallel runs, where
N is the processor ID. This gives you detailed
information about the progress of the run with a particular focus on
the numerical solver.
APBS input files are loosely-formatted files which contain
information about the input, parameters, and output for each calculation.
These files are whitespace- or linefeed-delimited. Comments can be added
to the input files via the # character; all text
between the # and the end of the line is not parsed by
APBS. Specific examples of APBS input are described in the
Examples section.
![]() | Tip |
|---|---|
Please note that there are several tools which help prepare APBS input files based on molecular structures, memory constraints, etc. These tools are described in more detail in Section 3.2.2, “Problem setup”. |
APBS input files contain three basic sections which can be repeated any number of times:
The APBS input file is constructed from these sections in the following format:
Example 4.1. Template for APBS input file
READ ... END ELEC ... END APOLAR ... END ELEC ... END APOLAR ... END PRINT ... END QUIT
These sections can occur in any order, however, they are clearly interdependent. For example, PRINT requires ELEC and/or APOLAR while ELEC requires one or more READ sections. Sections can also be repeated; several READ statements may be used to load molecules and multiple ELEC or APOLAR sections would specify various electrostatics calculations on one or more molecules.
READ [keywords...]END
One of these sections must be present for every molecule involved in the APBS calculation. Molecule and "map" IDs are assigned implicitly assigned for each molecule/map read, based on order and starting at 1. This section has the following keywords:
This command specifies the molecular data to be read into APBS. The arguments are:
formatThe format of the input data. Acceptable flags include:
Molecular data is in PQR format
Molecular data is in PDB format.
![]() | Warning |
|---|---|
We do not completely follow the PDB format, as specified in the above link. Specifically, we allow general whitespace-, tab-, or newline-delimited format, thereby permitting the manipulation of molecules with coordinates outside the ±999 range. |
![]() | Note |
|---|---|
Beginning with APBS 0.5.0, the optional use of the chain ID field is now supported in both PDB and PQR formats. |
pathThe location of the molecular data file. This pathname should not include spaces.
This command specifies the charge and radius data to be used with PDB-format molecule files. The arguments are:
formatThe format of the parameter file. Acceptable flags include:
APBS XML parameter format
pathThe location of the parameter data file. This pathname should not include spaces.
This command allows APBS to read the dielectric function
mapped to 3 meshes shifted by one-half grid spacing in the x, y, and z
directions. The inputs are maps of dielectric variables between the
solvent and biomolecular dieletric constants; these values are unitless.
In general, this command will read dielectric maps written by
write
commands in earlier APBS calculations.
![]() | Note |
|---|---|
NOTE: if you choose this option and have a non-zero ionic strength, you must also include a read kappa statement |
Arguments for this command are:
formatThe format of the dielectric map. Acceptable values include:
OpenDX format (see Formats section)
path-xThe location of the x-shifted dielectric map file. This pathname should not include spaces.
path-yThe location of the y-shifted dielectric map file. This pathname should not include spaces.
path-zThe location of the z-shifted dielectric map file. This pathname should not include spaces.
This command allows APBS to read the ion-accessibility function
mapped to a mesh. The inputs are maps of ion accessibility values which
range between 0 and the build Debye-Hückel screening parameter;
these values have units of Å-2. In
general, this command will read kappa-maps written by
write
commands in earlier APBS calculations.
![]() | Note |
|---|---|
NOTE: if you choose this option, you must also include a read diel statement |
Arguments for this command are:
formatThe format of the kappa map. Acceptable values include:
OpenDX format (see Formats section)
pathThe location of the kappa map file. This pathname should not include spaces.
This command allows APBS to read the fixed (molecular) charge density function mapped to a mesh. The inputs are maps of charge densities; these values have units of ec (electron charge) per Angstrom3. In general, this command will read charge-maps written by write commands in earlier APBS calculations. Arguments for this command are:
formatThe format of the charge map. Acceptable values include:
OpenDX format (see Formats section)
pathThe location of the charge map file. This pathname should not include spaces.
This command allows APBS to read a finite element mesh to use as a starting point for finite element calculations. The input is simply the mesh geometry; e.g., as produced by a finite element mesh generation program such as LBIE-Mesher or GAMer. Arguments for this command are:
formatThe format of the input mesh. Acceptable values include:
MCSF format (description coming soon!)
pathThe location of the meshes file. This path should not include spaces.
ELEC [name id] {type} [keywords...]END
This section is the main component for polar solvation calculations in APBS runs. There may be several ELEC sections, operating on different molecules or using different parameters for multiple runs on the same molecule. The order of the ELEC statement matters (see above); the arguments are:
id This optional command allows users to assign an alphanumeric string to the calculation to facilitate later operations (particularly in the PRINT statements).
type Specify the type of electrostatics calculation to perform (these are described in greater detail below):
mg-auto for automatically-configured sequential focusing multigrid calculations.
mg-para for automatically-configured parallel focusing multigrid calculations.
mg-manual for manually-configured multigrid calculations.
fe-manual for manually-configured adaptive finite element calculations.
mg-dummy for calculations of surface and charge distribution properties which do not require solution of the PBE.
keywords Keywords describing the parameters of the electrostatic calculation. These are described in the Keywords section below.
This automatically sets up and performs a string of single-point PBE calculations to "focus" on a region of interest (binding site, etc.) in a system. It is basically an automated version of mg-manual designed for easier use. Most users should probably use this version of ELEC.
The keywords for this command (described in more detail in the Keywords section) are listed below. All keywords are required (no default values!) unless otherwise noted: dime , cglen , fglen , cgcent , fgcent , mol , lpbe or npbe or smpbe , bcfl , ion (optional) , pdie , sdie , chgm , usemap (optional) , useaqua (optional) , sdens , srfm , srad , swin , temp , calcenergy , calcforce , write , writemat
This calculation closely resembles mg-auto in syntax. However, it is basically designed to perform single-point calculations on systems in a parallel focusing fashion. While this method does provide support for decreasing the domain size from a coarse (large) global grid to a fine (smaller) global grid, it should not be used to look at subsets of biomolecules such as titration sites, etc. Such subset calculations require more complicated energy evaluation which is not yet supported by mg-para. However, since parallel focusing was designed to provide detailed evaluation of the electrostatic potential on a large scale, such subset calculations are better left to traditional focusing via the mg-auto keyword.
![]() | Important |
|---|---|
Please note that some of the parameters change in meaning a bit for this type of calculation. In particular, dime should be interpreted as the number of grid points per processor. This interpretation helps manage the amount of memory per-processor -- generally the limiting resource for most calculations. |
The keywords for this command (described in more detail in the Keywords section) are listed below. All keywords are required (no default values!) unless otherwise noted: dime , ofrac , pdime , async , cglen , fglen , cgcent , fgcent , mol , lpbe or npbe or smpbe , bcfl , ion (optional) , pdie , sdie , chgm , usemap (optional) , useaqua (optional) , sdens , srfm , srad , swin , temp , calcenergy , calcforce , write , writemat
This is the standard single-point PBE calculation performed by most solvers. The mg-manual calculation offers the most control of parameters to the user. Several of these calculations can be strung together to perform focusing calculations by judicious choice of the bcfl flag, however, the setup of the focusing is not automated as it is in mg-auto and mg-para calculations and therefore this command should only be used by more experienced users.
The keywords for this command (described in more detail in the Keywords section) are listed below. All keywords are required (no default values!) unless otherwise noted: dime , nlev , glen or grid , gcent , mol , lpbe or npbe or smpbe , bcfl , ion (optional) , pdie , sdie , chgm , usemap (optional) , useaqua (optional) , sdens , srfm , srad , swin , temp , calcenergy , calcforce , write , writemat
This is a single-point PBE calculation performed by our adaptive finite element PBE solver. It requires that APBS was linked to the Holst group FEtk finite element library (http://www.fetk.org) during compilation.
The finite element solver uses a "solve-estimate-refine" cycle. Specifically, starting from an initial mesh, it performs the following iteration:
solve the problem
estimate the error in the solution
adaptively refine the mesh
until a global error tolerance is reached.
![]() | Note |
|---|---|
These methods are most useful for a select set of problems which can benefit from adaptive refinement of the solution. Furthermore, this implementation is experimental. In general, the sequential and parallel focusing multigrid methods offer the most efficient solution of the PBE for most systems |
The keywords for this command (described in more detail in the Keywords section) are listed below. All keywords are required (no default values!) unless otherwise noted: domainLength , usemesh (optional) , etol , ekey , akeyPRE , akeySOLVE , targetNum , targetRes , maxsolve , maxvert , mol , lpbe or npbe or lrpbe or nrpbe , bcfl , ion (optional) , pdie , sdie , chgm , usemap (optional) , useaqua (optional) , sdens , srfm , srad , swin , temp , calcenergy , calcforce , write , writemat
This allows users to write out dielectric, ion-accessibility, and charge distribution maps based on biomolecular geometry without actually solving the PB equation. The syntax is identical to mg-dummy.
The keywords for this command (described in more detail in the Keywords section) are listed below. All keywords are required (no default values!) unless otherwise noted: dime , nlev , cglen or grid , gcent , mol , lpbe or npbe or smpbe , bcfl , ion (optional) , pdie , sdie , chgm , usemap (optional) , useaqua (optional) , sdens , srfm , srad , swin , temp , calcenergy , calcforce , write , writemat
This is a list of keywords used in the ELEC statements of APBS. Note that not all keywords are used in every ELEC statement; see above.
akeyPRE {key}
Specify how the initial finite element mesh should be constructed (from refinement of a very coarse 8-tetrahedron mesh prior to the solve-estimate-refine iteration. This allows for various a priori refinement schemes.
key The method used to guide initial refinement:
Uniform refinement
Geometry-based refinement at molecular surfaces and charges
akeySOLVE {key}
Specify how the the finite element mesh should be adaptively subdivided during the solve-estimate-refine iterations. This allows for various a posteriori refinement schemes.
key The method used to guide adpative refinement:
Residual-based a posteriori refinement
async { rank }
This optional keyword allows users to perform the different tasks
in a parallel run asynchronously. Specifically, a processor masquerades
as process rank in a parallel focusing run
and provides output (data files and energies/forces) appropriate to
that processor's local partition. The user must then assemble the
results after all processes complete. First, this option is useful for
scheduling on-demand resources: this makes it easy for users to
backfill into the available processes in a queue. Second, this option
is useful for running on limited resources: this enables users without
access to large parallel machines to still perform the same
calculations.
rank The ID of the particular processor to masquerade as.
Processor IDs range from 0 to N-1,
where N is the total number of
processors in the run (see
pdime).
Processor ranks are related to their position in the overall
grid by

where nx is the number of processors in the x-direction, ny is the number of processors in the y-direction, nz is the number of processors in the z-direction, i is the index of the processor in the x-direction, j is the index of the processor in the y-direction, k is the index of the processor in the z-direction, and p is the overall rank of the processor.
bcfl {flag}
Specify the type of boundary conditions used to solve the Poisson-Boltzmann equation:
flagThe flag specifying the boundary condition definition:
"Zero" boundary condition. Potential at boundary is set to zero. This condition is not commonly used and can result in large errors if used inappropriately.
"Single Debye-Hückel" boundary condition. Potential at boundary is set to the values prescribed by a Debye-Hückel model for a single sphere with a point charge, dipole, and quadrupole. The sphere radius is set to the radius of the biomolecule and the sphere charge, dipole, and quadrupole are set to the total moments of the protein. This condition works best when the boundary is sufficiently far from the biomolecule.
"Multiple Debye-Hückel" boundary condition. Potential at boundary is set to the values prescribed by a Debye-Hückel model for a multiple, non-interacting spheres with a point charges. The sphere radii are set to the atomic radii of the biomolecule and the sphere charges are set to the total charge of the protein. This condition works better than sdh for closer boundaries but can be very slow for large biomolecules.
"Focusing" boundary condition. Potential at boundary is set to the values computed by the previous (usually lower-resolution) PB calculation. This is used in sequential focusing performed manually in mg-manual calculations. All of the boundary points should lie within the domain of the previous calculation for best accuracy; if any boundary points lie outside, their values are computed using single Debye-Hückel boundary conditions (see above).
calcenergy { flag }
This optional keyword controls electrostatic energy output from a PBE calculation.
![]() | Note |
|---|---|
Note that this option must be used consistently for all
calculations that will appear in subsequent
PRINT statements.
For example, if the statement |
flag Specify the types of energy values to be returned:
(Deprecated) don't calculate any energies.
Calculate and return total electrostatic energy for the entire molecule.
Calculate and return total electrostatic energy for the entire molecule as well as electrostatic energy components for each atom.
calcforce { flag }
This optional keyword controls electrostatic and apolar force output from a PBE calculation.
![]() | Note |
|---|---|
Note that this option must be used consistently for all
calculations that will appear in subsequent
PRINT statements.
For example, if the statement |
flag Specify the types of force values to be returned:
(Deprecated) don't calculate any forces.
Calculate and return total electrostatic and apolar forces for the entire molecule.
Calculate and return total electrostatic and apolar forces for the entire molecule as well as force components for each atom.
cgcent { mol id | xcent ycent zcent }
Specify the center of the coarse grid (in a focusing calculation) based on a molecule's center or absolute coordinates. The arguments for this keyword are:
idCenter the grid on molecule with ID
id; as assigned in the
READ section.
Molecule IDs are assigned in the order they're read, starting
at 1.
xcent ycent zcentThe coordinates (in Å) at which the grid is centered. Based on the PDB coordinate frame.
cglen {xlen ylen zlen}
Specify the coarse mesh domain lengths in a focusing calculation; this may be different in each direction. This is the starting mesh, so it should be large enough to complete enclose the biomolecule and ensure that the chosen boundary condition (see bcfl) is appropriate.
xlen ylen zlenGrid lengths in the x-, y-, and z-directions in Å.
chgm {flag}
Specify the method by which the biomolecular point charges (i.e., Dirac delta functions) are mapped onto the grid. As we are attempting to model delta functions, the support (domain) of these discretized charge distributions is always a function of the grid spacing.
flagDiscretization method (options have multiple declarations for backward-compatibility):
Traditional trilinear interpolation (linear splines). The charge is mapped onto the nearest-neighbor grid points. Resulting potentials are very sensitive to grid spacing, length, and position.
Cubic B-spline discretization. The charge is mapped onto the nearest- and next-nearest-neighbor grid points. Resulting potentials are somewhat less sensitive (than spl0) to grid spacing, length, and position.
Quintic B-spline discretization. Similar to spl2, except the charge/multipole is additionally mapped to include next-next-nearest neighbors (125 grid points receive charge density).
dime {nx ny nz}
Number of grid points per processor for grid-based discretization. For mg-manual, the arguments are dependent on the choice of nlev by the formula

where n is the dime argument,
c is a non-zero integer, l is the
nlev value. The most common values for grid
dimensions are 65, 97, 129, and 161 (they can be different in each
direction); these are all compatible with a nlev
value of 4. If you happen to pick a "bad" value for the dimensions
(i.e., mismatch with nlev), the code will adjust the
specified dime downwards to more appropriate values. This means that
"bad" values will typically result in lower resolution/accuracy
calculations! The arguments for this keyword are:
nx ny nzNumber of grid points in the x-, y-, and z-directions.
![]() | Important |
|---|---|
Please note that some of the parameters change in meaning a bit for this mg-para calculations. In particular, dime should be interpreted as the number of grid points per processor. This interpretation helps manage the amount of memory per-processor -- generally the limiting resource for most calculations. |
domainLength {xlen ylen zlen}
Specify the rectangular finite element mesh domain lengths; this may be different in each direction. If the usemesh keyword is included, then this command is ignored.
xlen ylen zlenMesh lengths in the x-, y-, and z-directions in Å.
ekey { flag }
Specify the method used to determine the error tolerance in the solve-estimate-refine iterations of the finite element solver.
flag Tolerance is interpreted as...
...per-simplex error limit
...global (whole domain) error limit
...fraction of simplices you'd like to see refined
etol { tol }
Specify the tolerance for error-based adaptive refinement during the solve-estimate-refine iterations of the finite element solver. See also: ekey.
tol The error tolerance for adaptive finite element refinement. The exact definition of this tolerance is determined by the value of ekey.
fgcent { mol id | xcent ycent zcent }
Specify the center of the fine grid (in a focusing calculation) based on a molecule's center or absolute coordinates. The arguments for this keyword are:
idCenter the grid on molecule with ID
id; as assigned in the
READ section.
Molecule IDs are assigned in the order they're read, starting
at 1.
xcent ycent zcentThe coordinates (in Å) at which the grid is centered. Based on the PDB coordinate frame.
fglen {xlen ylen zlen}
Specify the fine mesh domain lengths in a focusing calculation; this may be different in each direction. This should enclose the region of interest in the molecule.
xlen ylen zlenGrid lengths in the x-, y-, and z-directions in Å.
gcent { mol id | xcent ycent zcent }
Specify the center of the grid based on a molecule's center or absolute coordinates. The arguments for this keyword are:
idCenter the grid on molecule wi