1.1. Quick installation¶
There are three ways to install sequana but we strongly recommend the conda way.
1.1.1. From conda¶
Sequana is on bioconda. You can follow these instructions or type:
conda install sequana
You would need these special channels:
conda config --add channels r default conda-forges bioconda
And possibly install those dependencies required for the Sequana pipelines:
conda install --file https://raw.githubusercontent.com/sequana/sequana/master/requirements_pipelines.txt
1.1.2. From Pypi website¶
If you do not want to use conda, we provide releases on the Python Package Index website (pip tool):
pip install sequana pip install PyQt5
See below for dependencies.
1.1.3. From Source¶
Finally, if you are a developer, you can install sequana from source:
git clone email@example.com:sequana/sequana.git cd sequana python setup.py install
See below for dependencies.
With the methods above, you should have a working libary of Sequana and its standalones (e.g. Sequanix). However, if you wish to use all the pipelines, additional tools and libraries are required. Some are available on PyPi (Python software) but others will be available only on BioConda.
1.3. Installation using Conda¶
If you have not installed Sequana, be aware that it relies on many dependencies that needs to be compiled (i.e., it is time consumming and requires proper C compilator). For example, we use Matplotlib that requires compilation. Besides, many pipelines rely on third-party software such as BWA or samtools that are not Python libraries. Yet, using conda, this process is simplified.
1.3.1. Install conda executable¶
In practice, we do use Anaconda . We recommend to install conda executable via the manual installer (download). You may have the choice between Python 2 and 3. We recommend to choose a Python version 3.
1.3.2. Add conda channels¶
When you want to install a new package, you have to use this type of syntax:
conda install ipython
where ipython is the package you wish to install. Note that by default, conda looks on the official Anaconda website (channel). However, there are many channels available. We will use the bioconda channel. To use it, type these commands (once for all):
conda config --add channels r conda config --add channels defaults conda config --add channels conda-forge conda config --add channels bioconda
it is important to add them in this order, as mentionned on bioconda webpage (https://bioconda.github.io/).
1.3.3. Create an environment¶
Once conda is installed, open a new shell. Although this is not required strictly speaking, we would recommend to create an environment dedicated to Sequana. This environment can later be removed without affecting your system or conda installation. A conda environment is nothing else than a directory and can be created as follows:
conda create --name sequana_env python=3.5
Then, since you may have several environments, you must activate the sequana environment itself:
source activate sequana_env
1.3.4. Install sequana via conda (bioconda)¶
Finally, just type:
conda install sequana
This should install most of the required dependencies. However, you may need to install more packages depending on the pipeline used. To install all required packages, you may use this command:
conda install --file https://raw.githubusercontent.com/sequana/sequana/master/requirements.txt conda install --file https://raw.githubusercontent.com/sequana/sequana/master/requirements_pipelines.txt
Developers, can also install pytest and sphinx:
conda install --file https://raw.githubusercontent.com/sequana/sequana/master/requirements_dev.txt
We would also recommend those tools:
conda install ipython jupyter
atropos is an alternative to cutadapt with additional options but same type of functionalties and arguments. We use version 1.0.23 and above though.
the denovo_assembly pipelines uses Quast tool, which we ported to python 3.5 and was pulled on Quast official github page. This is not yet in bioconda but one can get it from the quast github (sept 2016). This is required for the de-novo pipeline. The denovo pipeline also requires GATK, to be installed manually by users (due to licensing restrictions)
For GATK (variant caller), please go to https://software.broadinstitute.org/gatk/download/auth?package=GATK and download the file GenomeAnalysisTK-3.7.tar.bz2 ; then type:
1.4. Docker containers for Sequana¶
We used to build our own docker containers but thanks to development in bioconda, we will now use biocontainers.
1.4.1. Example: sequana_coverage¶
To pull a Sequana container (here version 0.4.1), use this type of command:
docker pull quay.io/biocontainers/sequana:0.4.1--py35_0
Checkout the quay.io website. After pulling the image above, you can use it as follows:
docker run -v $PWD:/home/default -it quay.io/biocontainers/sequana:0.4.1--py35_0
once in the docker shell, go to /home/default. Here, this directory is linked to your real directory where you type “docker run…” so what you modify here is directly reflected in your directory !
Assuming you have a BED file JB409847 in your directory, otherwise uncomment the commented line here below:
cd /home/default export MPLBACKEND="agg" # wget https://tinyurl.com/y9j69t3k -O JB409847.bed sequana_coverage --input JB409847.bed exit
Back on your local directory, you should now see a ./report directory with the results of the analysis.
1.5. Docker containers in details (obsolet)¶
this is mostly obsolet since we now use biocontainer but this section may be useful for developers.
Docker containers wrap a piece of software in a complete filesystem that contains everything needed to run the software.
In order to allow anyone to use Sequana without needs for complex installation, we provide Docker images, which are synchronized on the master branch of the source code.
We assume that:
- You have installed Docker on your system (see Docker otherwise).
- You have an account on Hub Docker .
1.5.1. Quick start¶
With your hub.docker account, first login:
Then download (pull) a Sequana image (all library, pipelines and standalones) as follows (2Gb image in total):
docker pull sequana/sequana
Now, you should be ready to try it. To start an interactive session, type:
cd <Directory_with_data> docker run -v $PWD:/home/sequana/data -it sequana/sequana
The primary goal of the docker is to make it possible to quickly test the standalones. For now, we expose only one docker. Please see specific documentation following the links here below:
- sequana_coverage: (https://github.com/sequana/sequana/tree/master/docker/sequana_coverage)
- sequana_taxonomy: (https://github.com/sequana/sequana/tree/master/docker/sequana_taxonomy)
1.5.3. More advanced Usage¶
Here below, we provide a quick tutorial that will guide you on using Sequana thanks to the docker. To do so, we will focus on one standalone application called sequana_coverage. In brief, the standalone takes as input a BED file that contains the genome coverage of a set of mapped DNA reads onto a reference genome. Then, the standalone creates a report with relevant information about the coverage (See Sequana documentation for more information).
1.5.4. Use the sequana Docker image¶
Once you downloaded the sequana image, you can then enter into the image as follows:
docker run -it sequana/sequana
This opens an interactive shell with latest sequana library pre-installed. For instance, you can start an IPython shell:
and import the library:
Or within the unix shell, you can use standalones. For instance there is a test BED file that can be analysed as follows to get a coverage report:
sequana_coverage --input virus.bed
This should print information and create a report/ directory. This is not very practical if you have your own files or want to open the HTML page stored in ./report. So, let us quit the docker:
and do it the proper way. Go to a working directory (or your computer )and start the docker image again as follows:
docker run -v $PWD:/home/sequana/data -it sequana/sequana
This should start the docker image again but you should now have a ./data directory. Be aware that if you modify data here (in the image), you will also modify the data in your local data file.
Now, you can run sequana_coverage in this directory:
cd data sequana_coverage --input yourfile.bed
This analyses the data and creates a report/ directory. The container has no display but you can now go back to your computer in /home/user/mydatapath and browse the HTML page that was created.
Each time, we entered in the image but you can also use the images as executables (see standalone section above).
1.5.5. For developers:¶
Build the image:
git clone https://github.com/sequana/sequana cd sequana/docker/sequana_core sudo docker build -t="sequana/sequana_core" .
Run the image:
sudo docker run -it sequana/sequana_core
Here are the layers made available on hub.docker.com/u/sequana organizations. Each layer is built on top of the previous one
- sequana_core (only ubuntu + some packages)
- sequana_conda_core (sequana_core + conda + common scientific packages)
- sequana_conda_ngs (sequana_conda_core + NGS conda packages)
- sequana (sequana_conda_ngs + sequana specific version)
- Standalone Layers:
- sequana_coverage (sequana + sequana_coverage standalone)
To avoid using sudo, check out various forum. See for example: http://askubuntu.com/questions/477551/how-can-i-use-docker-without-sudo