1 Introduction

This page explains how to install the core package of the Regulatory Sequence Analysis Tools (rsat-core) via the conda package manager.

The rsat-core package contains the RSAT command line tools, but no web server or web services.


2 Requirements

2.1 Availability

The conda package rsat-core is available on the anaconda server, in the bioconda channel:

2.2 Operating systems

  • The package has been compiled for Linux and Mac OS X.

  • It is not directly available as a conda package for Windows, but it could easily be included in a Docker or Singularity container.

2.3 Miniconda

This tutorial assumes that the conda package manager is installed on your operating system.

If it is not the case, you can easily install miniconda3. Note that for this it is not necessary to have admin rights.

For Mac OS X conda can now be installed with the standard Mac OS X package installer.


3 Conda environment

It may be convenient to create a specific conda environment rather than in the default environment.

Advantage: RSAT and all its dependencies are isolated from the other packages installed on your operating system. This may avoid conflicts between incompatible versions of languages or libraries required by other conda packages.

Inconvenient: the installation may take more space on your storage device since all the dependencies have to be installed in the rsat-specific environment folder.

If you prefer to install rsat-core in the basic conda environment, just skip this section.

3.1 Creating a conda environment

conda create -n rsat

Check that the environment has well been created

conda env list
conda env list | grep rsat

3.2 Activating the rsat environment

We will now activate the newly created conda environemnt rsat and check its package content.

conda activate rsat

The name of the current conda environment should appear at the beginning of your prompt, for example:

(rsat) %

In principle, at this stage, the environment should contain no package since we just created it. We can check this by listing the packages.

conda list ## List the packages in the environment

4 Installing rsat-core

conda install -c bioconda rsat-core

You may or may not encounter an error in which RSAT could not be installed because r-jpeg cannot be installed due to conda strict policy at solving dependencies. This error is related to how conda manages channels in case some package is available in several of them. If that is your case, config conda to use the flexible approach using this command:

conda config --set channel_priority flexible

Then proceed with the installation again


4.1 Temporary patches

In the 2020.01.04 release, some Perl libraries are still missing from conda.

We will soon package them for conda. In the meantime, it is easy to install them manually using cpan (especially if you created a conda environment for rsat, in which case you don’t need admin rights to install Perl modules in the environment).

First, if not done yet, you need to activate the conda environment where rsat-core has been installed.

## Activate the conda environment 
## 
## Choose either base or rsat depending on your configuration
conda activate
conda activate rsat

We can now install the Perl modules with cpan. At the first usage, cpan might ask you which install mode you prefer between local::lib, sudo or manual. Simply type the enter key to choose the default (local::lib), in order to install the modules in the same environment as your rsat-core package.

## Statistics::Distributions exists in conda but for some reason it is not working
cpan install Statistics::Distributions

## Email::Sender::Simple is required for the Web server + some particular scripts
cpan install Email::Sender::Simple

## Required for matrix-clustering
cpan install Parallel::ForkManager
cpan install MCE::Shared

## For SOAP::WSDL Web services
cpan install SOAP::WSDL 
cpan install XML::Compile::SOAP11   
cpan install XML::Compile::WSDL11   
# cpan install XML::Compile::Transport::SOAPHTTP

5 Testing the rsat-core environment

We can perform a quick test of the rsat-core package.

5.1 Locating the rsat command

We will first locate the rsat command.

which rsat

5.2 Listing rsat subcommands

The rsat command enables to run all the RSAT tools as sub-commands. We can list them with the option --list, or get a short description with the option --help.

rsat --list ## List the names of RSAT subcommands
rsat --list | wc -l ## count the number of supported RSAT subcommands
rsat --help ## Get a short description of the RSAT subcommands

5.3 Getting help for an rsat subcommand

The help page of an RSAT command can be obtained by running

rsat [subcommand] -h

For example:

rsat random-seq -h

5.4 Testing some RSAT commands

Generate 3 random sequences of length 100.

rsat random-seq -l 100 -n 3

Generate random sequences and send them as input to oligo-analysis to count the dinucleotide occurrences. Note that the result of an RSAT command can be directly used as input by another command with the pipe symbol |.

rsat random-seq -l 100 -n 3 \
  | rsat oligo-analysis -v 1 -l 2 -1str -return occ,freq

5.5 Locating the RSAT components

The path of the RSAT components depends on your local configuration of conda.

You can find them as subfolders of the conda path, which may itself be generic (base environment) or specific to rsat (rsat environment).

echo $CONDA_PREFIX

The rsat command is found in the bin directory, together with some RSAT compiled programs (e.g. count-words, matrix-scan-quick, variation-scan). All the programs found in this bin directory are automatically in your path as soon as you activate conda.

The two following commands should in principle return the same path.

echo $CONDA_PREFIX/bin/rsat
which rsat

Additional files of the RSAT suite are found in the folder share/rsat of the conda directory.

ls -l $CONDA_PREFIX/share/rsat

This includes Perl, python, R scripts, makefiles, as well as RSAT configuration files.

5.6 A battery of tests for rsat subcommands

RSAT includes a set of tests for different commands, which can be run individually via a makefile.

export RSAT=$CONDA_PREFIX/share/rsat
make -f $RSAT/makefiles/subcommand_tests.mk

This displays the list of make targets, which can be called individually by appending them to the previous command. For example, we can run the target randseq in order to test the RSAT program random-seq.

make -f $RSAT/makefiles/subcommand_tests.mk randseq

This will generate a random sequence, store it in a local file, and display the path on the result. The same can be done for each other target. The full RSAT command is systematically displayed, which indicates the parameters used for some typical analyses.

The target all runs all the test commands (this can take some time, because it includes downloading the yeast genome, running the peak-motifs workflow, …).

5.7 Optional: direct access to each tool

## Before: the individual RSAT Perl and python scripts are not in the path
which random-seq    ## a Perl script
which random-motif  ## a python script

## Load the bashrc file with RSAT environment variables
cd $CONDA_PREFIX/share/rsat
source RSAT_config.bashrc

## After: the Perl and python scripts are now in the path
which random-seq    ## a Perl script
which random-motif  ## a python script

After having loaded RSAT_config.bashrc, the commands are avaiable in the path, and can thus be invoked directly (e.g. running random-seq -l 100 would do the same as rsat random-seq -l 100).


6 Uninstalling rsat-core

To uninstall rsat-core, you should simply remove the package from conda. The way to proceed depends on whether you installed rsat-core in a specific conda environment (rsat) or in the base environment.

6.1 Uninstalling rsat-core from the base environment

conda activate  ## Activate the base environment
conda remove rsat-core

6.2 Uninstalling the rsat conda environment (and all its packages)

conda deactivate ## make sure you are not in the rsat environment
conda remove -n rsat --all