Skip to content

zimmerzam/biocpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BioCpp

This is a simple template library for basic operations on proteins.

System requirements

  • Operating system: GNU/Linux
  • C++ compiler: gcc4.6 (or newer) or equivalent
  • Eigen3 (required)
  • boost, cgal (optional)

BioCpp is C++0x standard.

Installation and setup

External libraries

BioCpp uses Eigen3 for atom coordinates, geometrical transformations and this kind of stuffs. So you need to download it from here.

Eigen3 needs no installation: simply download the source code and extract it. The only thing to keep in mind is that the compiler must be able to find the Eigen header files. Simply add the path to the extracted folder to your CPLUS_INCLUDE_PATH. In order to achieve this you can export the path at login by adding

export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/path-to-header-files/

to your .bashrc and/or .bash_profile file if you are using bash or sh shell or, alternatively,

if ( $?CPLUS_INCLUDE_PATH ) then
  setenv CPLUS_INCLUDE_PATH {$CPLUS_INCLUDE_PATH}:/path-to-header-files/
else
  setenv CPLUS_INCLUDE_PATH /path-to-header-files/
endif

to your .cshrc file if you are using tcsh or csh.

Some optional functionalities require other external libraries:

  • topology is based on boost graph library. You can download boost from here. Please notice that in the near future boost will be used extensively in BioCpp

  • morphology uses cgal for protein surface reconstruction.

How to compile the examples

BioCpp now uses cmake as building system. A typical usage is

cd /path-to-biocpp/build/debug/
cmake ../..
make all

You can adapt the compilation to your setup by passing flags to the compiler. For examples

CXX=g++46 cmake ../../ -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} 
-Wl,-rpath,/usr/local/gcc46/lib64" -DCMAKE_BUILD_TYPE=Debug

Usage

In order to use BioCpp in your project simply:

  • add the path containing the source code to your CPLUS_INCLUDE_PATH. In order to do this you can pass the path /path-to/biocpp/src/ to cmake. Alternatively you can export /path-to/biocpp/src/ by following the previous instructions.

  • import BioCpp header file

#include <BioCpp.h>

Preprocessor directives

Including the whole library in your project is usually not necessary. This is why BioCpp.h provides only few basic features. If your project requires more features, add them by using one (or more) of the following directives:

Directive Description
BIOCPP_INCLUDE_ID Add standard identifiers for amino acids, atoms, elements, ...
BIOCPP_INCLUDE_DPSS Add definitions of secondary stuctures according to dssp
BIOCPP_INCLUDE_MORPHOLOGY Compute solvent-accessible surface area
BIOCPP_INCLUDE_RECONSTRUCTION Compute position of missing atoms
BIOCPP_INCLUDE_PDB Read and write pdb files
BIOCPP_INCLUDE_FASTA_ALIGN Sequence alignment using NeedlemanWunsch algorithm
BIOCPP_INCLUDE_FASTA_SUBST_MATRIX_PAM30 Use PAM30 substitution matrix
BIOCPP_INCLUDE_FASTA_SUBST_MATRIX_PAM70 Use PAM70 substitution matrix
BIOCPP_INCLUDE_FASTA_SUBST_MATRIX_BLOSUM45 Use BLOSUM45 substitution matrix
BIOCPP_INCLUDE_FASTA_SUBST_MATRIX_BLOSUM62 Use BLOSUM62 substitution matrix
BIOCPP_INCLUDE_FASTA_SUBST_MATRIX_BLOSUM80 Use BLOSUM80 substitution matrix
BIOCPP_INCLUDE_FASTA_SUBST_MATRIX_ZIMM1 Use a strict version of BLOSUM62
BIOCPP_INCLUDE_FASTA_SUBST_MATRIX_MATRIX Use all the substitution matrices
BIOCPP_INCLUDE_STANDARD Add standard definitions of residue, chain, complex and moiety
BIOCPP_INCLUDE_SUBST_MATRIX_ALL Add all the features provided by BioCpp

By default, if no directives are defined, only base_container and iterators are included (see Documentation and examples).

In order to add directives you can both

#define DIRECTIVE_NAME

before including BioCpp.h, or pass the directive name to your compiler. If you use g++, simply

g++ -D DIRECTIVE_NAME ...

(see CMakeLists.txt provided in the examples folder).

Warning

This is a developing code. Newer versions of BioCpp may not be compatible with older ones.
For this reason, if you distribute code based on BioCpp, please also provide the version of BioCpp on which it is based.

Documentation

Documentation is available in both html and pdf format.
Documentation is not updated!!