Anisotropic Network Model with Message Passing Interface
This page contains the source code for the research appearing in Modeling global changes induced by local perturbations to the HIV-1 capsid (Bergman & Lezon. J Mol Graphics Modelling 71:218-226 (2017)). In the paper, the Anisotropic Network Model (ANM) was applied to an all-residue model of the HIV-1 capsid to examine the effects of single-residue perturbations on the capsid's global dynamics. Owing to the large size of the capsid, several improvements to existing ANM code were introduced:
- RTB - The rotations and translations of blocks (RTB) approach was used to reduce the computational scale of the system and to reduce unwanted internal motions. Similar code already appears in membrane ANM and in the membrANM component of ProDy.
- MPI - To accelerate calculation of the Hessian matrix, parts of the code were implemented in parallel using Message Passing Interface (MPI). So far, only the Hessian calculation, which was the primary bottleneck in membrane ANM, runs in parallel. The remainder of the code is still a clumsy serial implementation and subject to Amdahl's law. The implementation speeds up RTB calculations, but does not significantly accelerate calculating all-residue ANM Hessians.
- BLZPACK - For efficient matrix decomposition, the Block LancZos PACKage (BLZPACK)libraries are called directly from the C source code using dynamically allocated memory. As opposed to LAPACK (e.g., as in lapdecomp_free.c, distributed with membrane ANM), BLZPACK is intended for use with sparse matrices. Using it greatly reduces computing time and cuts down on memory use. By dynamically allocating memory, we avoid potential problems associated with hard-coded size limitations. Currently, only serial implementation of BLZPACK is included in ANMMPI.
All of this code was built and tested on a Linux machine running Mint 17 (qiana) and using the Ubuntu 3.13.0-24-generic kernel. Code was executed on an Intel Core i7-4770K CPU @ 3.50GHz. Executables were built using the Gnu C compiler (GCC) and MPI C compiler (MPICH).
Please send any questions or comments to Tim Lezon.
ANMMPI and ProDy calculate full ANM Hessian matrices in comparable time. ANMMPI outperforms ProDy in calculating large RTB Hessian matrices. Results are shown for proteins 2gb1, 3cyt (chain I), 1w0e, 2nwl and 1aon. ANMMPI Hessian calculation is run on 4 processors. Blocks for RTB calculations are based on secondary structures.
The BLZPACK-based eigendecomposition allows modes of large systems to be calculated quickly.
Download the tarball:ANMMPI-1.0.tar.gz
Place it in your favorite directory and unpack:
$ tar -xzf ANMMPI-1.0.tar.gz
The code requires a C compiler and an MPI implementation. Nothing further is needed for constructing Hessian matrices. I recommend GCC and MPICH.
For matrix decomposition, several libraries are required:
- LAPACK is a Linear Algebra PACKage that can be found in standard repositories.
- BLAS is a collection of Basic Linear Algebra Subprograms. It can be found in standard repositories.
- BLZPACK is a Block LancZos PACKage for handling sparse matrices. It can be obtained for free from Lawrence Berkeley National Lab.
- MA47 is a library of matrix routines that can be obtained from Harwell for free, if you're an academic user.
To compile, unpack the tarball and change to the anmmpi/src. Alter the Makefile, if needed. The software assumes that the file MA47.f exists in the current directory. Although anmmpi can compile without it, the eigensolver cannot. MA47.f is not distributed with this software, but can be downloaded from HSL. Once the Makefile is ready and MA47.f is in place, type:
$ make all
To clean up, type
$ make clean
The executable created generates a Hessian matrix using the RTB approximation and a modified ANM potential in the x- and y- directions.
- block2full_free.c - Projects RTB eigenvectors into space of all residues
- anmmpi.c - The file that should probably be called 'main.c'
- blzdecomp_free.c - Driver for blzsolvesparse
- blzsolvesparse.c - BLZPACK-based code for decomposing sparse symmetric matrices
- nrstuff.c - Numerical Recipes utilities
- hex1.pdb hex2.pdb hex3.pdb
When rigid blocks are use, the input to ANMMPI is referred to as a blockfile. The first 6 characters in each row of the blockfile are a header that indicate the type of data in the row (similar to a PDB file). There are currently 3 types of required headers:
Indicates the name (including path) of a PDB file to be used in the calculation. These lines have the format
PDB filename.pdb file_id
The file ID is a string (no whitespace) that uniquely identifies the file. This allows multiple PDB files to be used as input to anmmpi.
Defines a rigid block. Each line contains 9 columns, separated by whitespace:
Blocks do not have to appear in order, and several blocks assigned to the same block ID will be grouped together in the calculation. This allows blocks to extend across PDB files. Blocks of single residues are allowed, and are treated as point particles. Blocks of two residues are discouraged. These are separated into two one-residue blocks.
Indicates the end of the BLOCK definitions and the file.
Rows beginning with '#' are considered comments.
As an example, the blockfile hex_of_hex.blk is provided, along with its associated PDB files hex1.pdb, hex2.pdb and hex3.pdb.
To view the command-line options of anmmpi, simply run the program without an input file:
The code should be run using MPI software, represented here by mpirun.
To run a simple ANM job in parallel using anmmpi:
$ mpirun -np NUM anmmpi ../data/hex1.pdb
This command tells anmmpi to run on NUM processors. When it completes, a file called hex1.sparsehessian will appear in ../data. This is the ANM Hessian calcualted with default parameters (15 Angstrom cutoff, unit force constant), and it can be decomposed with blzdecomp, discussed later.
To generate a RTB Hessian from the blocks:
$ mpirun -np NUM anmmpi ../data/hex_of_hex.blk -rtb
The -rtb flag indicates that the input file is a blockfile, not a PDB file. The program reads the block definitions and the PDB file(s), calculates the ANM Hessian in terms of the rigid blocks, and prints it to hex_of_hex.blockhessian.
The Hessian matrix must then be decomposed. This can be done with the provided blzdecomp_free program:
$ blzdecomp ../data/hex_of_hex.blockhessian 50
The files hex_of_hex.val and hex_of_hex.vec contain the first 50 eigenvalues and eigenvectors of the block Hessian. The block eigenvectors are projected back into the space of all residues using the block2full program provided. This program needs to know the relationship between the rigid blocks and the individual nodes of the molecule, and it gets this information from a projection matrix that maps the block space to the all-residue space. The projection matrix hex_of_hex.prj is generated with the anmmpi program with the command:
$ mpirun -np NUM anmmpi ../data/hex_of_hex.blk -rtb -p
Now the block eigenvectors can be projected into the space of all residues:
$ block2full ../data/hex_of_hex.prj ../data/hex_of_hex.vec >../data/hex_of_hex_full.vec
The eigenvectors in hex_of_hex_full.vec contain 29106 components, corresponding to x-, y- and z-components for each of the 9702 residues.