Getting Started
This starting guide is made for use on a standard Linux machine (BASH shell). Examples are detailed below.
Prerequisite
ESBTL uses the Boost C++ library. You may get it from the
Boost website or by installing the corresponding package file (
.deb or
.rpm) called
libboost-all-dev or
libboost-dev.
Download
Get the archive file from
here.
Extract the archive :
tar xvfj ESBTL-alpha-0.0.tar.bz2
Install
ESBTL is an include-only library, it does not need to be installed per se.
To use it the ESBTL
include directory should be added to the
CPLUS_INCLUDE_DIR by typing:
export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_DIR}:/<path to the extracted archive directory>/ESBTL-alpha-0.0/include/
To have the library permanently added to the
CPLUS_INCLUDE_DIR, add the line above to the
.bashrc file in your home directory.
Test
To test whether the library is working, get in the test example directory:
cd examples/Simple
Generate the
makefile by typing:
cmake .
Try to compile the example:
make
If everything goes well (i.e. all the required libraries are there), you should see:
Scanning dependencies of target generic_select
[ 16%] Building CXX object CMakeFiles/generic_select.dir/generic_select.o
Linking CXX executable generic_select
[ 16%] Built target generic_select
Scanning dependencies of target read_models
[ 33%] Building CXX object CMakeFiles/read_models.dir/read_models.o
Linking CXX executable read_models
[ 33%] Built target read_models
Scanning dependencies of target select_in_reader
[ 50%] Building CXX object CMakeFiles/select_in_reader.dir/select_in_reader.o
Linking CXX executable select_in_reader
[ 50%] Built target select_in_reader
Scanning dependencies of target select_in_system
[ 66%] Building CXX object CMakeFiles/select_in_system.dir/select_in_system.o
Linking CXX executable select_in_system
[ 66%] Built target select_in_system
Scanning dependencies of target to_xyzr
[ 83%] Building CXX object CMakeFiles/to_xyzr.dir/to_xyzr.o
Linking CXX executable to_xyzr
[ 83%] Built target to_xyzr
Scanning dependencies of target write_selection
[100%] Building CXX object CMakeFiles/write_selection.dir/write_selection.o
Linking CXX executable write_selection
[100%] Built target write_selection
At this point you should have six newly created executable files in the directory:
generic_select,
read_models,
select_in_reader,
select_in_system,
to_xyzr and
write_selection corresponding to the
.cpp examples provided by the archive.
You can try them out using the provided
2cfa.pdb pdb test file by typing:
./to_xyzr ../2cfa.pdb
And you'll obtain the coordinates and radii of the atoms in the pdb file (see the Examples section below section for more information).
Congratulations! ESBTL is working fine. To get started with your own code, check the examples below or the
FAQ.
Compiling you own code
Once you have you own
.cpp file, a
CMakeLists.txt file is needed. To compile the
my.cpp source file, the
CMakeLists.txt file should contain:
project( my_project )
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5)
include_directories(<path to the extracted archive directory>/ESBTL-alpha-0.0/include/)
add_executable(myfile myfile.cpp)
To compile your code, type:
cmake .
make
Optional: Using ESBTL with CGAL
To use ESBTL with CGAL, the installation of CGAL is required. You can get CGAL from the
CGAL website or by installed the precompiled
libcgal-dev linux package (
.deb or
.rpm) for your distribution.
Once CGAL installed, try to compile the examples in the
Using_CGAL directory.
Optional: xtc file interface using the xtc library
For ESBTL to access and read
xtc files (see the advanced section in the examples directory), the
xtc library (xdrfile) should be installed. It is available from the
Gromacs website or as a package for your linux distribution
xdrfile (
.deb or
.rpm).
Help
If you have a problem when starting with ESBTL, you may also want to check the
FAQ.
You can also request help from the
ESBTL users mailing list.
Examples
They are located in the
examples directory of the distributed package.
Three types of examples are provided depending on the application purpose. For simple computations on PDB files or to develop an application the non-CGAL simple version may be used. To perform geometry computations (triangulation, Voronoi construction), CGAL is required.
These files are provided to be simple examples. For certain applications, they may certainly not be the best solution but good starting points.
Each file contains comment to illustrate how they work. Other snippets are available in the
FAQ.
Each directory contains a
CMakeLists.txt file to compile the whole set of examples. See the above for details on how to compile the examples.
Simple Use
- toxyzr.cpp
Read a PDB file and write a coordinate x, y, z, radius format. Radii are taken from Tsai J, Taylor R, Chothia C, Gerstein M. J Mol Biol. 1999 Jul 2;290(1):253-66.
- read_models.cpp
This file shows how to read and work on pdb files containing multiple models.
- generic_select.cpp
This example shows how to perform simple selections on a system (structure).
- select_in_reader.cpp
ESBTL can perform a selection at the reading stage to avoid loading the whole structure file to be read. This is shown in this example file.
- select_in_system.cpp
This example shows how to restrict a analysis to a part of the structure, once it has been loaded into a system.
- write_selection.cpp
This short code shows how to write not the whole structure but a chain selection in a pdb file.
Using CGAL
- triangulation.cpp
This example builds a triangulation from atoms contained in a pdb file.
- coarse_grain_triang.cpp
This code uses the ESBTL coarse-grained model to build a triangulation from a coarse-grained model.
Reference Manual
The reference manual is available as a
Doxygen documentation.