FreeContact: fast and free software for protein contact prediction from residue co-evolution
© Kaján et al.; licensee BioMed Central Ltd. 2014
Received: 30 September 2013
Accepted: 18 March 2014
Published: 26 March 2014
20 years of improved technology and growing sequences now renders residue-residue contact constraints in large protein families through correlated mutations accurate enough to drive de novo predictions of protein three-dimensional structure. The method EVfold broke new ground using mean-field Direct Coupling Analysis (EVfold-mfDCA); the method PSICOV applied a related concept by estimating a sparse inverse covariance matrix. Both methods (EVfold-mfDCA and PSICOV) are publicly available, but both require too much CPU time for interactive applications. On top, EVfold-mfDCA depends on proprietary software.
Here, we present FreeContact, a fast, open source implementation of EVfold-mfDCA and PSICOV. On a test set of 140 proteins, FreeContact was almost eight times faster than PSICOV without decreasing prediction performance. The EVfold-mfDCA implementation of FreeContact was over 220 times faster than PSICOV with negligible performance decrease. EVfold-mfDCA was unavailable for testing due to its dependency on proprietary software. FreeContact is implemented as the free C++ library “libfreecontact”, complete with command line tool “freecontact”, as well as Perl and Python modules. All components are available as Debian packages. FreeContact supports the BioXSD format for interoperability.
FreeContact provides the opportunity to compute reliable contact predictions in any environment (desktop or cloud).
KeywordsProtein structure prediction Protein sequence analysis Fast protein contact prediction 2D prediction Open-source software EVfold EVcouplings PSICOV mfDCA BioXSD Debian package
Experimental high-resolution three-dimensional (3D) structures are available for fewer than one percent of all known proteins of known sequence (March, 2014: 100 k protein structures in the PDB  vs. 52 M sequences in UniProt ), and this sequence-structure gap  continues to increase. Homology modeling  or comparative modeling  is the only bridge that allows reliable modeling of 3D structure for about 20-40% of the residues in all known proteins . This boost of experimental information constitutes an immense achievement of computational biology (with about $50 billion dollars investment for experimentally unraveling 0.1 M known structures, computational biology generates structural knowledge for another ~20 M for just a few million).
Over the last two years, methods have been introduced that for the first time enable reliable de novo prediction of 3D structure for large proteins, i.e. intrudes into realms unreachable by comparative modeling . EVfold [8, 9] has been succeeding in sustained and reliable predictions of two-dimensional (2D) inter-residue contacts, i.e. the prediction of which residue pairs are near each other in the native protein structure. The success and elegance of the contact prediction through mean-field direct-coupling analysis  of EVfold (EVfold-mfDCA) has revived the field (e.g. PSICOV , plmDCA , PconsC  and PhyCMAP [14–16], and EVfold_membrane ). Wider application of this new generation of contact prediction tools is enticing, but currently hampered by two problems.
The first problem relates to the amount of sequence information needed, e.g. EVfold tends to perform better with 50 k sequences in a family than with 10 k. To put this into perspective: a decade ago, only the 10% largest families had over 100 homologues , now we have a method for which 100 times this may no longer suffice. This is why, e.g. EVfold_membrane can predict structures for only tens of families . However, these families are so gigantic that they cover some 3-6% of all known sequences.
The second problem pertains to the speed of the new methods and their ease of availability. EVfold-mfDCA is publicly available, but its implementation requires proprietary interpreter software. PSICOV has recently been released under the GPLv2 (version 1.09 and later), but is not optimized for speed (as of version 1.10). Runtimes often exceed tens of minutes (using the optimal parameters published). This might be restrictive for large-scale data analysis and for public web service operations such as PredictProtein . Neither EVfold-mfDCA nor PSICOV are packaged for convenient installation and usage.
Here, we report the release of FreeContact, a freely available software that considerably reduces the runtime for EVfold-mfDCA and PSICOV and provides convenient Debian  packages freely, open-source available to all users.
FreeContact is an open-source EVfold-mfDCA implementation optimized for speed. FreeContact can also be parameterized to produce results according to the PSICOV algorithm, because these two methods share many computational steps. For optimization, we identified the following program components that contribute significantly to runtime: BLOSUM-style weighting  of protein sequences in the input alignment (shared by EVfold-mfDCA and PSICOV), counting pairwise residue frequencies (also shared), shrinking the covariance matrix (PSICOV), sparse inverse covariance estimation (PSICOV), and covariance matrix inversion (EVfold-mfDCA).
Sequence weights result from computing the percentage sequence identity between each protein pair in a family. Our implementation uses standard ×86-64 architecture streaming SIMD instructions (single instruction, multiple data) extensions 2 (SSE2). These instructions operate on 128-bit registers, allowing the simultaneous comparison of 16 residues (each represented in a byte). A generic implementation is provided for architectures without SSE2 instructions. Both implementations benefit from multiple cores using OpenMP  to parallelize loops. Parallelization of loops through OpenMP also accelerated the computation of pairwise amino acid frequencies. The usage of single-precision LAPACK  routines accelerated the shrinking of the covariance matrix. We used GLASSOFAST , a new, fast implementation of the GLASSO algorithm  for sparse inverse covariance matrix estimation, developed in part for its usefulness in protein contact prediction. GLASSOFAST was used with single-precision numbers and GNU Compiler Collection (GCC) auto-vectorization (“-ftree-vectorize”, implied by “–O3”). LAPACK routines (single precision) inverted the covariance matrix.
FreeContact command-line parameters
BLOSUM-style sequence clustering percentage [0–100]
when true, one amino acid is left out when forming the covariance matrix, making it non-overdetermined  [Boolean]
target precision matrix density [0–1]
perform inverse covariance matrix estimation instead of matrix inversion [Boolean]
exclude alignment columns with a weighted gap frequency greater than --gapth from the covariance matrix [Boolean]
weighted gap frequency threshold (0–1]
inverse covariance matrix estimation timeout in seconds [0-)
minimum sequence separation (j - i ≥ arg) for reporting contacts [1-)
pseudo-count for sequence weighting [0-)
pseudo-count weight for sequence weighting [0–1]
initial value of GLASSO regularization parameter [0-)
parameter profile selection [evfold|psicov|psicov-sd]
We provide the choice of parameter profiles through the “--parprof” command-line option to conveniently set FreeContact options to recommended parameterizations of EVfold-mfDCA and PSICOV: the “evfold” argument sets EVfold-mfDCA compatibility mode, while “psicov” sets PSICOV “improved results” compatibility mode, and “psicov-sd” sets PSICOV “sensible default” compatibility mode (as defined in the README file distributed with PSICOV). This allows FreeContact to function as an accelerated replacement for both EVfold-mfDCA and PSICOV.
One of the differences between the FreeContact and the original implementation of PSICOV is the interpretation of the BLOSUM-style clustering percentage for sequence weighting. The original implementation groups sequences with a similarity larger than (>) the given threshold, while FreeContact groups at larger-or-equal (≥) the threshold. This technical detail matters as it allows FreeContact to share this program component between its implementations of PSICOV and EVfold-mfDCA. The performance of PSICOV is affected minimally by this detail [see Additional file 1].
A novel addition is the optional time limit that FreeContact can impose on inverse covariance estimation. The rationale was the observation that this estimation can take exceedingly long. If the time limit is exceeded, the prediction aborts with a dedicated error code.
An important difference between the original EVfold-mfDCA and its FreeContact implementation is the way in which contact scores are computed. FreeContact returns improved “corrected norm” scores  instead of the original “direct information”. The reason for this is that “corrected norm” scores have been reported to be superior .
FreeContact was compiled with the GNU Compiler Collection (GCC, version 4.7.2, with the “–O3 -ffast-math -funroll-loops” flag), and it was linked with the threaded version of the linear algebra software ATLAS  (version 3.8.4, built on the host architecture). ATLAS provides a highly efficient machine-specific implementation of BLAS  and LAPACK ; it automatically adapts itself during the build process to the host architecture in order to optimize performance. FreeContact can be linked with other BLAS and LAPACK implementations. PSICOV was compiled with the recommended “-m64 –O3 -mfpmath = sse -msse3 -funroll-loops -ffast-math” options.
FreeContact is available under the GNU General Public License version 3 or later (GPLv3+, granting freedom to use the software, guaranteeing included source code, allowing modifications, and allowing free redistribution ). It is available as a C++ library (called “libfreecontact”), along with a command-line executable (called “freecontact”), and modules in Perl (“FreeContact”, packaged as “libfreecontact-perl”) and Python (“freecontact”, packaged as “python-freecontact”). The library, executable, modules, and documentation are available as official Debian packages for Debian and derivative operating systems  - such as Ubuntu, Bio-Linux  and CloudBioLinux  - from Debian Med [32, 33]. All packages can be easily installed with the common package management tools. TAR GZ downloads are available from the Rostlab FTP site .
Results and discussion
PSICOV has two notable run modes: “improved results” and “sensible default”. The first (improved results) has been reported to be slightly more accurate and 2–3 times slower than the second . We have tested the runtime of the FreeContact implementation (FC) of these modes (FC.psicov and FC.psicov-fast), and of EVfold-mfDCA (FC.evfold) on 140 proteins of the published test set of PSICOV [see Additional files 2 and 3]. We compared runtimes to PSICOV version 1.10. The original implementation of EVfold-mfDCA was unavailable for testing due to its dependency on proprietary software. Ten proteins of the complete PSICOV test set of 150 were excluded from the evaluation, because at least one of the methods failed to return results, due to either excessive run time, or insufficient total alignment weight. PSICOV was allowed to run for at least three hours. FreeContact was run with the default 30-minute time limit on the inverse covariance estimation step. All tests of FreeContact were carried out using the “FreeContact” Perl module, on a computer with 32 GB RAM and two 6-core AMD Opteron 2431 processors running at 2.4 GHz. FreeContact was run on a single thread unless indicated otherwise.
Our code, taking advantage of the optimized ATLAS implementation of single precision LAPACK routines, sped up the covariance matrix shrinking step over five-fold, compared to PSICOV (Figure 1, “shrink”). FC.psicov performed the inverse covariance matrix estimation step on average 8-times faster than PSICOV (Figure 1, “inv”), due to the optimized GLASSOFAST routine. Overall, FC.psicov, FC.psicov-fast, and FC.evfold were 7.9, 32, and 226-times faster than PSICOV on a single thread, respectively (Figure 1, “all”).
We measured the performance of FreeContact in the following way. Two residues were defined to be in contact when their Cβ-Cβ distance (Cα-Cα for glycine) was below 8 Å (0.8 nm). In this debatable threshold, we followed the procedure introduced by the Critical Assessment of protein Structure Prediction (CASP) . It was also used for the original PSICOV publication . Similarly, we monitored a score that had also been introduced by CASP, namely the precision in contact predictions for pre-defined thresholds in the number of contacts predicted. The thresholds were chosen as the top L/n (L: length of target protein) contacts, with n = (1, 2, 5, 10). We distinguished different regions of sequence separation (residues j and i separated by at least [j - i] > sep, with sep = (4, 8, 11, 23)). All of those choices followed the CASP procedure. Many readers might argue for problems with those choices. However, for our purpose the CASP-like evaluation of contact prediction sufficed to establish that the FreeContact implementation of PSICOV and EVfold-mfDCA did not come at the cost of performance.
Mean precision values [%]
[j - i] > 4
[j - i] > 8
[j - i] > 11
[j - i] > 23
We could not compare the performance of the original implementation of EVfold-mfDCA with ours (FC.evfold), due to the former’s dependency on proprietary software. We noted, however, that FC.evfold was the fastest of the four methods tested, and assessed on the PSICOV test set, the immense gain in speed appeared to come with good performance: FC.evfold outperformed the other three methods at certain top-L contact and sequence separation ranges (Table 2, italic values).
FreeContact is not limited to the command line or C/C++ programs. Its full speed and features are available to Perl and Python scripts as well, through extension modules distributed with the software. FreeContact supports BioXSD  – the proposed XML data-exchange format for sequences, alignments, and features – as an option for output formats. This facilitates its integration into workflows and incorporation into Web services. We plan to support BioXSD input as well, and release a FreeContact Web service in the near future.
FreeContact is a fast replacement for EVfold-mfDCA and PSICOV, offering significant acceleration on common hardware. The implementation takes full advantage of standard ×86-64 features such as SSE2 instructions and multiple cores. The speed increase is important for large-scale protein contact or protein-protein interaction prediction projects, as it leads to significant savings through shorter runtimes. We anticipate providing updates to FreeContact as the algorithms are developed.
Availability and requirements
Project name: FreeContact
Project home page: http://rostlab.org/owiki/index.php/FreeContact
Operating systems: UNIX-like (tested on Debian and Ubuntu)
Programming language: C++, Fortran
Other requirements: Autotools, Boost C++ Libraries, BLAS, LAPACK, Xerces C++, CodeSynthesis XSD (the latter two are required only for optional XML I/O)
License: GPLv3 or later
Any restrictions to use by non-academics: none
LK is a Debian Developer and an active member of the Debian Med  team.
Bundesministerium fuer Bildung und Forschung
Critical assessment of protein structure prediction
European bioinformatics institute
GNU compiler collection
GNU general public license version 3 or later
Protein data bank
Swiss institute of bioinformatics
Single instruction multiple data
Streaming SIMD extensions 2
Technical university of Munich, Germany.
We thank programmers who provide their work under a free license: our work stands upon their shoulders, and would not have been possible without them. We thank Timothy Karl (TUM) for invaluable help with hardware and software and Marlena Drabik (TUM) for administrative support. LK and BR were supported by a grant from the Alexander von Humboldt Foundation through the German Ministry for Research and Education (BMBF: Bundesministerium fuer Bildung und Forschung). MK was supported by a grant from the Research Council of Norway (208481, ELIXIR.NO, supporting the Norwegian Bioinformatics Platform). We thank Rolf Apweiler (UniProt, EBI, Hinxton), Amos Bairoch (CALIPHO, SIB, Geneva), Helen Berman (PDB, Rutgers University), Phil Bourne (PDB, San Diego University), Ioannis Xenarios (Swiss-Prot, SIB, Geneva), and their crews for maintaining excellent databases, and all experimentalists who enabled this work by making their data publicly available.
- Berman HM, Westbrook J, Feng Z, Gilliland G, Bhat TN, Weissig H, Shindyalov IN, Bourne PE: The protein data bank. Nucleic Acids Res. 2000, 28 (1): 235-242.View ArticlePubMed CentralPubMedGoogle Scholar
- Magrane M, Consortium U: UniProt knowledgebase: a hub of integrated protein data. Database: the journal of biological databases and curation. 2011, 2011: bar009-View ArticleGoogle Scholar
- Rost B, Sander C: Bridging the protein sequence-structure gap by structure predictions. Annual review of biophysics and biomolecular structure. 1996, 25: 113-136.View ArticlePubMedGoogle Scholar
- Kiefer F, Arnold K, Kunzli M, Bordoli L, Schwede T: The SWISS-MODEL repository and associated resources. Nucleic Acids Res. 2009, 37 (Database issue): D387-392.View ArticlePubMed CentralPubMedGoogle Scholar
- Pieper U, Webb BM, Barkan DT, Schneidman-Duhovny D, Schlessinger A, Braberg H, Yang Z, Meng EC, Pettersen EF, Huang CC, Datta RS, Sampathkumar P, Madhusudhan MS, Sjölander K, Ferrin TE, Burley SK, Sali A: ModBase, a database of annotated comparative protein structure models, and associated resources. Nucleic Acids Res. 2011, 39 (Database issue): D465-474.View ArticlePubMed CentralPubMedGoogle Scholar
- Liu J, Hegyi H, Acton TB, Montelione GT, Rost B: Automatic target selection for structural genomics on eukaryotes. Proteins. 2004, 56 (2): 188-200.View ArticlePubMedGoogle Scholar
- Hopf TA, Colwell LJ, Sheridan R, Rost B, Sander C, Marks DS: Three-dimensional structures of membrane proteins from genomic sequencing. Cell. 2012, 149 (7): 1607-1621.View ArticlePubMed CentralPubMedGoogle Scholar
- Marks DS, Colwell LJ, Sheridan R, Hopf TA, Pagnani A, Zecchina R, Sander C: Protein 3D structure computed from evolutionary sequence variation. PLoS ONE. 2011, 6 (12): e28766-View ArticlePubMed CentralPubMedGoogle Scholar
- EVcouplings and EVfold. http://evfold.org/evfold-web/evfold.do,
- Morcos F, Pagnani A, Lunt B, Bertolino A, Marks DS, Sander C, Zecchina R, Onuchic JN, Hwa T, Weigt M: Direct-coupling analysis of residue coevolution captures native contacts across many protein families. Proc Natl Acad Sci U S A. 2011, 108 (49): E1293-1301.View ArticlePubMed CentralPubMedGoogle Scholar
- Jones DT, Buchan DW, Cozzetto D, Pontil M: PSICOV: precise structural contact prediction using sparse inverse covariance estimation on large multiple sequence alignments. Bioinformatics. 2012, 28 (2): 184-190.View ArticlePubMedGoogle Scholar
- Ekeberg M, Lovkvist C, Lan Y, Weigt M, Aurell E: Improved contact prediction in proteins: using pseudolikelihoods to infer potts models. Physical review E, Statistical, nonlinear, and soft matter physics. 2013, 87 (1–1): 012707-View ArticlePubMedGoogle Scholar
- Skwark MJ, Abdel-Rehim A, Elofsson A: PconsC: combination of direct information methods and alignments improves contact prediction. Bioinformatics. 2013, 29 (14): 1815-1816.View ArticlePubMedGoogle Scholar
- Wang Z, Xu J: Predicting protein contact map using evolutionary and physical constraints by integer programming. Bioinformatics. 2013, 29 (13): i266-i273.View ArticlePubMed CentralPubMedGoogle Scholar
- Marks DS, Hopf TA, Sander C: Protein structure prediction from sequence variation. Nature biotechnology. 2012, 30 (11): 1072-1080.View ArticlePubMed CentralPubMedGoogle Scholar
- de Juan D, Pazos F, Valencia A: Emerging methods in protein co-evolution. Nature reviews Genetics. 2013, 14 (4): 249-261.View ArticlePubMedGoogle Scholar
- Przybylski D, Rost B: Alignments grow, secondary structure prediction improves. Proteins. 2002, 46 (2): 197-205.View ArticlePubMedGoogle Scholar
- Kaján L, Yachdav G, Vicedo E, Steinegger M, Mirdita M, Angermüller C, Böhm A, Domke S, Ertl J, Mertes C, Reisinger E, Staniewski C, Rost B: Cloud prediction of protein structure and function with predict protein for debian. BioMed Research International. 2013, 2013: 6-View ArticleGoogle Scholar
- Debian - the universal operating system. http://www.debian.org/,
- Henikoff S, Henikoff JG: Amino acid substitution matrices from protein blocks. Proc Natl Acad Sci U S A. 1992, 89 (22): 10915-10919.View ArticlePubMed CentralPubMedGoogle Scholar
- OpenMP ARB: OpenMP Application Program Interface V3.0. 2008, OpenMP Architecture Review BoardGoogle Scholar
- Anderson E, Bai Z, Bischof C, Blackford LS, Demmel J, Dongarra JJ, Croz JD, Hammarling S, Greenbaum A, McKenney A, Sorensen D: LAPACK Users’ guide. 1999, Siam, 9:View ArticleGoogle Scholar
- Mátyás A, Sustik BC: GLASSOFAST: an efficient GLASSO implementation. The University of Texas at Austin UTCS Technical Report. 2012, 1-3. TR-12-29Google Scholar
- Friedman J, Hastie T, Tibshirani R: Sparse inverse covariance estimation with the graphical lasso. Biostatistics. 2008, 9 (3): 432-441.View ArticlePubMed CentralPubMedGoogle Scholar
- Bash reference manual. http://www.gnu.org/software/bash/manual/bashref.html#Programmable-Completion,
- Clint Whaley R, Petitet A, Dongarra JJ: Automated empirical optimizations of software and the ATLAS project. Parallel Comput. 2001, 27 (1): 3-35.View ArticleGoogle Scholar
- Blackford LS, Demmel J, Dongarra J, Duff I, Hammarling S, Henry G, Heroux M, Kaufman L, Lumsdaine A, Petitet A, Pozo R, Remington K, Whaley RC: An updated set of basic linear algebra subprograms (BLAS). ACM Trans Math Softw. 2002, 28 (2): 135-151.View ArticleGoogle Scholar
- GNU General Public License. http://www.gnu.org/licenses/gpl-3.0.html,
- Debian derivatives. http://wiki.debian.org/Derivatives,
- Field D, Tiwari B, Booth T, Houten S, Swan D, Bertrand N, Thurston M: Open software for biologists: from famine to feast. Nature biotechnology. 2006, 24 (7): 801-803.View ArticlePubMedGoogle Scholar
- Krampis K, Booth T, Chapman B, Tiwari B, Bicak M, Field D, Nelson KE: Cloud BioLinux: pre-configured and on-demand bioinformatics computing for the genomics community. BMC Bioinforma. 2012, 13: 42-View ArticleGoogle Scholar
- Moller S, Krabbenhoft HN, Tille A, Paleino D, Williams A, Wolstencroft K, Goble C, Holland R, Belhachemi D, Plessy C: Community-driven computational biology with Debian Linux. BMC Bioinforma. 2010, 11 (12): S5-View ArticleGoogle Scholar
- Debian Med. http://www.debian.org/devel/debian-med/,
- FreeContact FTP download. ftp://rostlab.org/free/
- Grana O, Baker D, MacCallum RM, Meiler J, Punta M, Rost B, Tress ML, Valencia A: CASP6 assessment of contact prediction. Proteins. 2005, 61 (Suppl 7): 214-224.View ArticlePubMedGoogle Scholar
- Kalaš M, Puntervoll P, Joseph A, Bartaševičiūtė E, Töpfer A, Venkataraman P, Pettifer S, Bryne JC, Ison J, Blanchet C: BioXSD: the common data-exchange format for everyday bioinformatics web services. Bioinformatics. 2010, 26 (18): i540-i546.View ArticlePubMed CentralPubMedGoogle Scholar
This article is published under license to BioMed Central Ltd. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly credited. The Creative Commons Public Domain Dedication waiver (http://creativecommons.org/publicdomain/zero/1.0/) applies to the data made available in this article, unless otherwise stated.