Installation

Ubuntu/Debian/Mint

# Installation of main system dependencies
sudo apt install ncbi-blast+ git libglpk-dev r-base-core exonerate bedtools barrnap bc parallel curl libcurl4-openssl-dev libssl-dev libsbml5-dev bc

# installation of required R-packages
R -e 'install.packages(c("data.table", "stringr", "getopt", "doParallel", "foreach", "R.utils", "stringi", "glpkAPI", "CHNOSZ", "jsonlite", "httr"))'
R -e 'if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager"); BiocManager::install("Biostrings")'
wget https://cran.r-project.org/src/contrib/Archive/sybil/sybil_2.2.0.tar.gz
wget https://cran.r-project.org/src/contrib/Archive/sybilSBML/sybilSBML_3.1.2.tar.gz
R CMD INSTALL sybil_2.2.0.tar.gz
R CMD INSTALL sybilSBML_3.1.2.tar.gz
rm sybil_2.2.0.tar.gz
rm sybilSBML_3.1.2.tar.gz

# Download latest gapseq version from github
git clone https://github.com/jotech/gapseq && cd gapseq

# Download latest reference sequence database
bash ./src/update_sequences.sh

Test your installation with:

./gapseq test

Centos/Fedora/RHEL

# Installation of main system dependencies
sudo yum install ncbi-blast+ git glpk-devel BEDTools exonerate hmmer bc parallel libcurl-devel curl openssl-devel libsbml-devel bc
git clone https://github.com/tseemann/barrnap.git
export PATH=$PATH:barrnap/bin/barrnap # needs to be permanent => .bashrc ?

# installation of required R-packages
R -e 'install.packages(c("data.table", "stringr", "getopt", "doParallel", "foreach", "R.utils", "stringi", "glpkAPI", "CHNOSZ", "jsonlite", "httr"))'
R -e 'if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager"); BiocManager::install("Biostrings")'
wget https://cran.r-project.org/src/contrib/Archive/sybil/sybil_2.2.0.tar.gz
wget https://cran.r-project.org/src/contrib/Archive/sybilSBML/sybilSBML_3.1.2.tar.gz
R CMD INSTALL sybil_2.2.0.tar.gz
R CMD INSTALL sybilSBML_3.1.2.tar.gz
rm sybil_2.2.0.tar.gz
rm sybilSBML_3.1.2.tar.gz

# Download latest gapseq version from github
git clone https://github.com/jotech/gapseq && cd gapseq

# Download latest reference sequence database
bash ./src/update_sequences.sh

Test your installation with:

./gapseq test

MacOS

Using homebrew. Please note: Some Mac-Users reported difficulties to install gapseq on MacOS using the following commands. The issues are mainly due to some Mac-specific functioning of central programs such as sed, awk, and grep. If you are experiencing issues, we recommend to try to install gapseq in an own conda environment using the steps described below.

# Installation of main system dependencies
brew install coreutils binutils git glpk blast bedtools r brewsci/bio/barrnap grep bc gzip parallel curl bc

# installation of required R-packages
R -e 'install.packages(c("data.table", "stringr", "getopt", "doParallel", "foreach", "R.utils", "stringi", "glpkAPI", "CHNOSZ", "jsonlite", "httr"))'
R -e 'if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager"); BiocManager::install("Biostrings")'
curl -O https://cran.r-project.org/src/contrib/Archive/sybil/sybil_2.2.0.tar.gz
R CMD INSTALL sybil_2.2.0.tar.gz
rm sybil_2.2.0.tar.gz

# Download latest gapseq version from github
git clone https://github.com/jotech/gapseq && cd gapseq

# Download latest reference sequence database
bash ./src/update_sequences.sh

Test your installation with:

./gapseq test

Some additional discussion and and trouble shooting can be found here: 1, 2, 3.

conda

There is no conda gapseq package available yet but all dependencies can be installed from conda channels without super user rights using the following steps:

1. Install Mini-/Anaconda

Follow the instructions provided by conda to Install Anaconda/Miniconda.

2. Create conda environment for gapseq and adding package sources

# Cloning the development version of gapseq
git clone https://github.com/jotech/gapseq
cd gapseq

# Create and activate a conda environment "gapseq-dev"
conda env create -n gapseq-dev --file gapseq_env.yml
conda activate gapseq-dev

# install one additional R-package
R -e 'install.packages("CHNOSZ", repos="http://cran.us.r-project.org")'

# Download & Install R-package 'sybilSBML'
wget https://cran.r-project.org/src/contrib/Archive/sybilSBML/sybilSBML_3.1.2.tar.gz
R CMD INSTALL --configure-args=" \
--with-sbml-include=$CONDA_PREFIX/include \
--with-sbml-lib=$CONDA_PREFIX/lib" sybilSBML_3.1.2.tar.gz
rm sybilSBML_3.1.2.tar.gz

# Download reference sequence data
bash ./src/update_sequences.sh

3. Test the installation

./gapseq test

SBML support

The Systems Biology markup Language (SBML) can be used to exchange model files between gapseq and other programs.

The above installationn instructions for linux systems and using conda should already include the SBML support. If there were no errors during the installation, you are all set using gapseq with SBML format exports.

Occasionally, the installation can cause some issues that is why SBML is listed as optional dependency. There should be a libsbml package (version 5.18.0 or later) available for most linux distributions:

sudo apt install libsbml5-dev # debian/ubuntu
sudo yum install libsbml-devel # fedora/centos

For MacOS, libsbml is not part of homebrew but an installation file can be downloaded from here. An instruction to install libSBML on an M1 Mac system has been suggested by a gapseq user here.

Please make sure, that libsbml is installed together with its extensions “fbc” and “groups”.

Next, we need to install the R-package sybilSBML, version 3.1.2. Unfortunately, the package is currently not available anymore from the CRAN repository. However, the latest version can still be downloaded and installed from CRAN’s archives:

wget https://cran.r-project.org/src/contrib/Archive/sybilSBML/sybilSBML_3.1.2.tar.gz
R CMD INSTALL sybilSBML_3.1.2.tar.gz

A common problem ist that the library path could not be found during installation of sybilSBML. In this case, it may be necessary to specify the include and lib folder:

R CMD INSTALL --configure-args="--with-sbml-include=/path/to/libsbml-5.18.0/include/ --with-sbml-lib=/path/to/libsbml-5.18.0/lib/" sybilSBML_3.1.2.tar.gz

The sybilSBML archive is available at gitlab together with more detailed installation information also at gitlab. Also, you may find more information on troubleshooting sybilSBML installation at this gist-discussion.

cplex solver support

We recommend using cplex as LP-solver as it is usually faster than glpk. The cplex solver is included in the IBM ILOG CPLEX Optimization Studio, which might be at no charge to students and academics through the IBM Academic Initiative programm (see here). Please follow the installation instructions for cplex provided by IBM. The R-package for the interface between R and the cplex solver can be obtained from github (SysBioChalmers/cplexAPI). For cplexAPI installation please refer to instructions here. Please note, that the R-package cplexAPI is not available from the CRAN repository anymore. We are currently working on a new CPLEX support solution that does not depend on cplexAPI.

Troubleshooting

  • NCBI blast version 2.2.30 (10/2014) or newer is needed. If your disribution only contains an older version, try to download a binary directly from ncbi

    • Older blast version could cause the Error: Unknown argument: "qcov_hsp_perc"

  • If you are getting the installation error 'lib = "../R/library"' is not writable while installing the R packages, then try this command beforehand:

Rscript -e 'if( file.access(Sys.getenv("R_LIBS_USER"), mode=2) == -1 ) dir.create(path = Sys.getenv("R_LIBS_USER"), showWarnings = FALSE, recursive = TRUE)'
  • glpkAPI install error checking for library containing glp_create_prob... no although libglpk has been installed, try:

wget https://cran.r-project.org/src/contrib/glpkAPI_1.3.2.tar.gz
R CMD INSTALL --configure-args="--enable-gmp=no" glpkAPI_1.3.2.tar.gz
  • SBML-Export: In order to export valid SBML files, it is required to have the R-Package sybilSBML with version 3.1.2 or higher. In addtion libSBML-core-plus-packages (>= 5.16) with ‘groups’ and ‘fbc’ extensions are required. See also “SBML Support”.


*source: https://community.ibm.com/community/user/datascience/blogs/xavier-nodet1/2020/07/09/cplex-free-for-students