Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
Installation Guide

Tutorial guiding the installation of the library.

Introduction

The SBL consists of several software tiers:

  • Compiled executables and scripts, Python modules
  • Plugins for VMD, PyMOL, and web servers
  • Documentation
  • C++ include files for developers


Executables, scripts, python modules. The installation procedures described below mainly focus on installing the compiled executables and scripts, as well as the plugins for VMD, PyMOL, and web servers.


Documentation. The SBL documentation is accessible in two ways:

cd scripts
./sbl-doc-manager.py --doxygen /path/to/doxygen -w /path/to/sblrepo -d /path/to/output/doc

Note: Doxygen version 1.14.0 is required.

There are three main options to use the SBL:

  • Singularity image file (Linux 64)
  • Via compilation and installation (Linux 64, OSX 64, OSX ARM64, WINDOWS - advanced)

C++ include files. Developers should git clone the sbl to reuse the C++ packages provides.

Installing the SBL with Pixi (Linux 64, OSX 64, OSX ARM64)

We deploy two packages, sbl and sbl-doc, to the Anaconda sbl channel. Using Pixi, you can install them easily. The sbl package contains the compiled executables and scripts, Python modules, plugins for VMD, PyMOL and the Web dashboard, and the header and CMake files needed by developers. The sbl-doc package contains the documentation source files, figures, examples and demos only.

Prerequisites

Install Pixi if you haven't already. Follow the official installation instructions, which provide one-line commands for macOS/Linux:

curl -fsSL https://pixi.sh/install.sh | sh

After installation, restart your terminal to ensure Pixi is available in your PATH.

Installing the latest stable SBL in a dedicated Pixi environment

Initial setup

Create a fresh Pixi workspace dedicated to SBL, for example:

mkdir -p ~/envs
cd ~/envs
pixi init sbl-pixi
cd sbl-pixi

Add the SBL package

The order of the channels matters and differs by platform:

OSX (macOS):

pixi workspace channel add bioconda
pixi workspace channel add sbl
pixi add sbl
pixi add sbl-doc # Optional: install the documentation package

Linux 64:

pixi workspace channel add sbl
pixi workspace channel add bioconda
pixi add sbl
pixi add sbl-doc # Optional: install the documentation package

Install and configure SBL

pixi install
pixi shell
sbl-install-plugins

The last command installs the SBL plugins into the VMD Extensions menu and the PyMOL command line, and sets up a launcher for the Web plugins. It also updates your shell configuration files (e.g., .bashrc, .zshrc) to export the necessary environment variables so that SBL tools are available in future shell sessions.

Restart your terminal to apply these changes.

To launch the Web plugins dashboard, run:

sbl-web-plugins-launcher

Then open the URL printed in the terminal (typically http://127.0.0.1:8700/) in your web browser.

Installing the latest dev version of SBL with Pixi

Initial setup

Create a dedicated Pixi workspace for the development build, for example:

mkdir -p ~/envs
cd ~/envs
pixi init sbl-pixi-dev
cd sbl-pixi-dev

Add the SBL dev package

As for the stable channel, the order of channels matters and differs by platform:

OSX (macOS):

pixi workspace channel add bioconda
pixi workspace channel add sbl
pixi workspace channel add https://conda.anaconda.org/sbl/label/dev/
pixi add "sbl/label/dev::sbl"
pixi add "sbl/label/dev::sbl-doc" # Optional: install the documentation package

Linux 64:

pixi workspace channel add sbl
pixi workspace channel add https://conda.anaconda.org/sbl/label/dev/
pixi workspace channel add bioconda
pixi add "sbl/label/dev::sbl"
pixi add "sbl/label/dev::sbl-doc" # Optional: install the documentation package

The remaining steps (installation, plugin setup, and web launcher usage) are identical to those described for the stable Pixi environment above.

Installing the SBL via a Singularity image file (all Linux OS)

Available upon request.

(Advanced) Compilation dependencies


The section presents the dependencies required to install and compile the SBL. The following are two important remarks:

  • Selected libraries termed mandatory in the sequel are used in almost all applications, while others are specific to one or two packages. Install those required, in particular if you plan to compile selected packages only. In this latter case, one may inspect the CMakeLists.txt of the pacakge, since it indicates the libs used. For example:
    set(SBL_USE_LIBS CGAL MPFR GMP Boost Eigen cifpp)
    
  • For libraries which are not fully templated, the installation actually requires two distinct installations, for the lib, and for the development files. For example on Fedora: MPFR requires mpfr.x86_64 and mpfr-devel.x86_64, MPFI requires mpfi.x86_64 and mpfi-devel.x86_64, etc.

(Mandatory) General dependencies

GMP and MPFR

These libraries provide classes implementing number types and the accompanying operations, allowing the development of algorithms with specific arithmetic requirements:

  • GMP is a library for arbitrary precision arithmetic,
  • MPFR is a library for multiple-precision floating-point computations with correct rounding,

Note that GMP and MPFR are mandatory to use CGAL . For each library, if one of them is installed in a non standard location, the <LIBRARY_NAME>_DIR environment variable needs to point to the root directory of that library.

MPFI

In the SBL, interval arithmetics is managed using the Boost library. However, in order to use multi-precision interval arithmetic, the library MPFI has to be installed. It is used in particular to compute the volume of unions of balls in SBL. When MPFI is used for the compilation of a program, the C++ macro SBL_WITH_MPFI is automatically defined, enforcing the use of MPFI rather than Boost for managing multi-precision interval arithmetic. If MPFI is installed in a non standard location, the MPFI_DIR environment variable needs to point to the root directory of the library.

Boost

The reference C++ Boost libraries provide various tools used throughout the library — see Boost home page for more details.

While the generic components of Boost are directly integrated in Core, the following non generic Boost packages are used in the applications:

  • Boost Serialization : provides tools for serializing data structures, i.e to store them in an archive such that it is possible to reconstruct them from this archive. In Applications, an archive is a XML file, allowing to use PALSE for analyzing the output data of an application (see PALSE).
  • Boost Program Options : provides tools to handle (generating and parse) the command line options of applications. (Note that program options are used together with the workflows and the Modules, allowing one to assign the options to the modules used to define the workflow of an application.)
  • Boost Regex : provides tools to manipulate regular expressions.
  • Boost Thread : provides classes and functions to manage multiple threads.
  • Boost System : provides simple and light-weight tools to manage errors.

If Boost is installed in a non standard location, the BOOST_ROOT environment variable needs to point to the root directory of Boost .

CGAL

The Computational Geometry Algorithms Library (CGAL) provides various core geometric constructions. In particular, CGAL is used in large number of packages in Core. A number of libraries are provided with the CGAL library, as the GMP and MPFR libraries. A detailed explanation on how to install the CGAL library is provided on the CGAL installation guide.

Note that if the CGAL library is installed in a non standard location, the CGAL_DIR environment variable must point to the root directory of CGAL.

Starting with version 4.10, CGAL needs specific tags. Parsing the cgal version and setting these tags is taken care of by cmake/Modules/SBL_UseCGAL.cmake.


libcifpp

libcifpp provides the tools to parse PDB and mmCIF files.

Eigen

The Eigen library is used for linear algebra, in particular to represent matrices and compute eigenvalues.

If the Eigen is installed in a non standard location, the EIGEN_DIR environment variable needs to point to the root directory of the Eigen library.

(Specific) Optimization

Ipopt

Ipopt (Interior Point OPTimizer; a.k.a. coin-or-Ipopt) is a library for non-linear optimization. It is used in the package Real_value_function_minimizer for finding local minima of real value functions. If the library is installed in a non-standard location, the IPOPT_ROOT environment variable needs to point to the root directory of the library.

The package Real_value_function_minimizer requires at least one of the two libraries Ipopt or LBFGS++ .


LBFGS++

LBFGS++ (Limited-memory BFGS) is a header-only C++ library that implements the eponym algorithm–see the Download or clone page. It is used in the package Real_value_function_minimizer for finding local minima of real value functions. Since it is header-only, it is easy to install and to use, making an easy alternative to the Ipopt library. If the library is installed in a non-standard location, the LBFGSPP_DIR environment variable needs to point to the include directory of the library.

The package Real_value_function_minimizer requires at least one of the two libraries Ipopt or LBFGS++ .


LP solve

The binary program lp_solve is used to solve the linear programs arising when comparing energy landscapes. The environment variable LP_SOLVE must be set to indicate the location of the binary.

(Specific) Biological sequence analysis

Seqan

Seqan is a C++ header-only library providing a collection of sequence alignment algorithms. It is used in the package Alignment_engines. If the library is installed in a non-standard location, the SEQAN_DIR environment variable needs to point to the include directory of the library.

The package Alignment_engines relies on Seqan for sequence alignments only.


Muscle

  • Muscle : a multiple sequence alignment program; used in FunChaT

Clustal Omega

HMMER

  • HMMER: a biosequence analysis tool using profile hidden Markov models; used in FunChaT

Phobius

  • Phobius: a combined transmembrane topology and signal peptide predictor; used in FunChaT

(Specific) Misc

FLANN

FLANN (Fast Library for Approximate Nearest Neighbors) is a library offering a collection of approximate nearest neighbor algorithms and methods for peaking the best algorithm to use ependening on the input dataset. It is wrapped in the class SBL::GT::T_ANN_FLANN_wrapper of the package Spatial_search for comparing / replacing the other algorithms implemented in the package. If the library is installed in a non-standard location, the FLANN_DIR environment variable needs to point to the root directory of the library.

The packages Spatial_search and MolecularGeometryLoader can be used without this dependency, which is optional.


Gromacs

Gromacs is used for loading trajectories of conformations from XTC files in the package MolecularGeometryLoader. If the library is installed in a non-standard location, the GROMACS_DIR environment variable needs to point to the root directory of the library.

rapidxml

rapidxml is a header only C++ XML parser used in the SBL for loading force field parameters from XML files in the package Molecular_potential_energy . If the library is installed in a non-standard location, the RAPIDXML_DIR environment variable needs to point to the root directory of the library.

The package Molecular_potential_energy relies heavily on rapidxml and cannot be used without it.


OpenMP

OpenMP is used to parallelize loops in the SBL. It is particularly used for parallelizing the run of collections of modules within workflows – see Modules when using workflows. When OpenMP is used for the compilation of a program, the C++ macro SBL_WITH_OPENMP is automatically defined, enforcing the use of OpenMP for parallelizing the for loops.

(Advanced) Using the SBL via compilation and installation

Getting the source code

The source code is available from the following tarball.

It may also be obtained by cloning the read-only git repository as follows:

git clone https://sbl.inria.fr/git/sbl.git

In the sequel, we assume that the environment variable SBL_DIR points to the directory containing the source code.

Compiling the library from the source code via Pixi

We provide a Pixi configuration file to compile and install the SBL library from the source code:

  • 1) Install Pixi if needed (see pixi install docs), then navigate to the SBL source code directory.
  • 2) Run the below command to compile and install the library (it will install the executables, scripts, includes, Python modules, and plugins):
    pixi install
    pixi run build # on Linux, pixi run build 1 to use a single core to avoid crashes
    pixi run install
    pixi run setup-plugins
    This will create a build directory, compile the library and install it in .pixi/envs/default. The last command adds the necessary exports to shell configuration files. This also installs the GUI plugins into the user home directories and registers them in the molecular visualization software (VMD and PyMOL).

Note: If you encounter the following error when running an SBL executable:

error while loading shared libraries: libboost_program_options.so.1.86.0: cannot open shared object file: No such file or directory

This occurs because the dynamic linker cannot locate the Boost shared libraries installed in the Pixi environment. To fix this, add the following line to the end of your shell configuration file (~/.bashrc or ~/.zshrc):

export LD_LIBRARY_PATH="$PIXI_ENV_DIR/lib:${LD_LIBRARY_PATH}"

Then restart your terminal or run source ~/.bashrc (or ~/.zshrc) to apply the changes.

Compiling the library from the source code via cmake

To compile and install the library from this source code, CMake is used. The version 3.16 or later of CMake is recommended. Note that the following installation requires root privileges to install in a system related directory. If you do not have them, refer to section Non standard installation directory.

The installation runs through four steps:

  • 1) Configure in a separate build directory. From the directory containing the source code:
cmake -S . -B build_sbl -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/PATH/TO/INSTALL/SBL

By default, SBL executables, scripts, includes, Python modules, and plugins are enabled.

  • 2) Optional: restrict the build. You can compile only a subset by setting SBL_APPLICATIONS to one of: Core, SFM (Space Filling Models), CA (Conformational Analysis), or DM (Data Management):
cmake -S . -B build_sbl -DSBL_APPLICATIONS=<Core|SFM|CA|DM> -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/PATH/TO/INSTALL/SBL
  • 3) Build, then install (note the build may take some time):
cmake --build build_sbl --parallel
cmake --install build_sbl

Note: On Linux machines, avoid using –parallel without a value, as this will use all available CPU cores; instead, pass an explicit limit such as –parallel 1.

Note: On Linux machines, avoid using –parallel without a value, as this will use all available CPU cores; instead, pass an explicit limit such as –parallel 4.

This last step compiles programs and copies files into standard locations under the chosen prefix (or into the directory pointed at by CMAKE_INSTALL_PREFIX; see below):

  • the include directory of each package is copied in the /PATH/TO/INSTALL/SBL/include/SBL directory,
  • the Python source code of Python modules is copied into /PATH/TO/INSTALL/SBL/lib/python3.X/site-packages/SBL,
  • the compiled programs and python scripts are copied into /PATH/TO/INSTALL/SBL/bin,
  • the cmake files of the library are copied into into /PATH/TO/INSTALL/SBL/share/SBL/cmake,
  • the plugins source files are copied into /PATH/TO/INSTALL/SBL/share/SBL/Applications... or /PATH/TO/INSTALL/SBL/share/SBL/Core...

Note that if a new version of the library is available, the installation must be carried out again upon updating the git repository.

The variable CMAKE_INSTALL_PREFIX calls for one comment. This variable should contain the name of the directory containing all subdirectories to be installed, namely include, doc, bin. Phrased differently, if one set CMAKE_INSTALL_PREFIX to /path/to/my/directory/bin, then, all sub-directories will be found below /bin, which is clearly an undesired ending.


To update one's version of the library, it is sufficient to update one's local git repository. However, note that the examples, tests and programs have to be compiled one by one. Therefore, using the library without installing it is only recommended for those willing to use the SBL library as a header-only library.


To uninstall the library, i.e. remove all installed files:
> cmake --build build_sbl --target uninstall


(Advanced) Additional compilation and installation options

In this section, we show the various options for compiling the different parts of the library, and installing it.

Non standard installation directory

When installing the SBL library, one may not have the root privileges, and/or may want to install the SBL into a local directory. Doing so merely requires setting the cmake variable CMAKE_INSTALL_PREFIX to your local install directory when running cmake:

> cmake -S \</path/to/sbl/directory\> -B build_sbl -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\</path/to/local/install/directory\>
> cmake --build build_sbl --parallel
> cmake --install build_sbl

Given this target directory, executables are installed in the bin sub-folder of the install prefix, while Python modules are installed in lib/pythonX.Y/site-packages/SBL under that prefix.

Note that executables and Python modules installed in a non standard location will not be directly usable except if the corresponding environment variables have been set :
  • PATH for executables,
  • PYTHONPATH for Python modules.
For example, unix users equipped with a zsh shell should set the environment variables to use to installed python modules:
> export PATH=$PATH:\</path/to/local/install/directory\>/bin
> export PYTHONPATH=$PYTHONPATH:\</path/to/local/install/directory\>/python
Similarly, developers may directly address the python modules available in the cloned directory as follows:
export PYTHONPATH=${PYTHONPATH}:${SBL_DIR}/python/SBL
export PYTHONPATH=${PYTHONPATH}:${SBL_DIR}/python


Integration and unit test compilation

Within a package from Core, integration tests can be viewed as short programs showing the basic functionalities provided in that package. To compile such programs, turn the SBL_INTEGRATION_TESTS to ON where running cmake.

In addition, unit tests can be used in such packages, by compiling and running short test programs checking various functionalities of the packages. For compiling all the tests of the SBL library, just turn ON the tags SBL_UNIT_TESTS when running cmake

> cmake -S \</path/to/sbl/directory\> -B build_sbl -DSBL_UNIT_TESTS=ON -DSBL_INTEGRATION_TESTS=ON
> cmake --build build_sbl --parallel

Then, to exectue all tests (UNIT and INTEGRATION) for all the packages from Core, just run the them with the following command:

> ctest --test-dir build_sbl --output-on-failure

Note that the previous step does not require any installation step since the examples and tests are only compiled locally and only the sources of the examples are installed for documentation (in /usr/share/doc).

Debug vs release

It is possible to compile the programs in Debug or in Release mode using the cmake variable CMAKE_BUILD_TYPE. However, since the SBL library is only made of headers and programs, we recommend the Debug mode only for the developers. For compiling in Debug mode, one can run the following command:

> cmake -S \</path/to/sbl/directory\> -B build_sbl -DCMAKE_BUILD_TYPE=Debug
> cmake --build build_sbl --parallel

Note that by default, the Release mode is used. Note also that to debug symbols from other libraries, if these are not header-only, compiling them in Debug mode is mandatory.

Static programs

It is possible to create static versions of the programs by setting to ON the cmake variable BUILD_STATIC_SBL:

> cmake -S \</path/to/sbl/directory\> -B build_sbl -DBUILD_STATIC_SBL=ON
> cmake --build build_sbl --parallel
In order to enjoy purely static programs, all the dependencies must also be available in static mode :
  • mandatory dependencies :
    • Eigen are header-only libraries; so is CGAL from the version 4.10 onward.
    • GMP and Boost are generally provided by Unix systems with static versions.
    • MPFR (and CGAL before the version 4.10) require a local static compilation if not provided by the OS.
    • libcifpp requires a manual static build as it is provided as shared in the sbl conda channel
  • specific dependencies :
    • Seqan, LBFGS++ and rapidxml are header-only libraries.
    • FLANN is generally provided by Unix systems with a static version.
    • Ipopt and Gromacs require a local static compilation if not provided by the OS.


Note also that only the programs are compiled in static mode since the examples and tests are not installed. If one wants to compile static examples or static tests, such compilations should be done locally.

Installing VMD plugins

The SBL library provides VMD plugins for visualizing the output of the programs (details in section VMD (Visual Molecular Dynamics)).

It should be recalled that VMD plugins involve three ingredients:

  • The executables from the SBL, which are called by the plugins. In the sequel, we assume that these have been installed in a directory referenced in one's PATH, as explained above.
  • A folder containing the tcl code for the plugins. For the SBL, this folder is called sblvmdplugins, and we create/update it in one's home directory – that is $HOME/sblvmdplugins.
  • The so-called .vmdrc file, located in one's home directory, which parameterizes one's VMD. For SBL plugins, it indicates where the plugins are installed.

To automatically install the VMD plugins, i.e. create or update the sblvmdplugins directory and create or update the .vmdrc file, proceed as follows with cmake:

> cmake -S \</path/to/sbl/directory\> -B build_sbl -DSBL_VMD_PLUGINS=ON
> cmake --build build_sbl --parallel
> cmake --install build_sbl
Note that the VMD plugins do not require any compilation. That is, the aforementioned install merely installs .tcl files. These plugins call executables from the SBL, found from one's PATH environment variable.


Installing PyMOL plugins

The installation of PyMOL's plugins requires the executables of the SBL to be available via on'e PATH environment variable – see above.

For PyMOL, plugins can be installed in two ways.


Installation with cmake. The SBL library provides also PyMOL plugins (details in section PyMOL (Python Based Molecular Visualization System)). The installation works as for the VMD plugins, but using instead the cmake variable SBL_PYMOL_PLUGINS :

> cmake -S \</path/to/sbl/directory\> -B build_sbl -DSBL_PYMOL_PLUGINS=ON
> cmake --build build_sbl --parallel
> cmake --install build_sbl

The previous command looks for a folder .pymol in one's home directory, creates it if necessary, and installs the plugins. It manages the directory architecture used by PyMOL and creates or updates initialization files if necessary.

Note that the PyMOL plugins do not require any compilation. That is, the aforementioned install merely installs .py files. These plugins call executables from the SBL, found from one's PATH environment variable.


Note that the PyMOL is required to built with PyQt6 support for the SBL PyMOL plugins to work correctly. PyMOL with PyQt5 is not supported.



Installation using PyMOL's plugin manager. The graphical user interface of PyMOL provides a Plugin Manager enabling the addition, removal, and inspection of installed plugins. This plugin manager is available from the tab Plugin/Plugin Manager in the horizontal menu. The option Install New Plugin offers three installation options:

  • local file: the file implementing the plugin.
  • from a directory : requires the files implementing the plugin, including the init.py file starting point for the plugin execution.
  • PyMOLWiki or any URL: file or files, as above.
It is the responsibility of the user to provide/install all modules required by the plugin, modify proper system variables (PYTHONPATH variable) in the system, thus the plugin could be executed.


Documentation compilation

The documentation is written in Doxygen format, and can be compiled as follows using the script sbl-doc-manager.py from the scripts directory at the root of the project. This script produces the documentation and prints out the path to the index.html file, to be opened with a web browser:

> sbl-doc-manager.py -w <path/to/sbl/directory> -d <path/to/output/directory>

Note that the option -w can be omitted if the environment variable $SBL_DIR is set.

Doxygen version 1.14.0 is required.

The documentation being written in Doxygen, it can be directly compiled as follows:
> cd
\</path/to/installed/sbl/directory\>/share/doc/SBL; doxygen;
In doing so, the files are generated in the current directory. The benefits of using the aforementioned script is that it also performs a number of house-keeping tasks (moving pictures, creating symbolic links, etc).


Note that some optional post-processing are done internally on the documentation, in particular for adding logos on the short description of the packages. This is done using an internal python script, see the ref sbl-devel-for-sbl-tutorial .