Skip to main content

A set of tools to help building or using Sequana pipelines

Project description Documentation Status JOSS (journal of open source software) DOI

A set of tools to help building or using Sequana pipelines




Please fill a report on github

Python version:

Python 3.8, 3.9, 3.10, 3.11


Cokelaer et al, (2017), ‘Sequana’: a Set of Snakemake NGS pipelines, Journal of Open Source Software, 2(16), 352, JOSS DOI doi:10.21105/joss.00352

What is sequana_pipetools ?

sequana_pipetools is a collection of tools that assists with the management of Sequana pipelines, which includes next-generation sequencing (NGS) pipelines like RNA-seq, variant calling, ChIP-seq, and others.

The aim of this package is to simplify the deployment of Sequana pipelines by creating a pure Python library that includes commonly used tools for different pipelines.

Previously, the Sequana framework incorporated alll bioinformatics, Snakemake rules, pipelines, and pipeline management tools into a single library (Sequana) as illustrated in Fig 1 below.

Figure 1 Old Sequana framework will all pipelines and Sequana library in the same place including pipetools (this library).

Whenever changes were made to the Sequana library, a thorough check of the entire library was necessary, despite having 80% test coverage. Adding new pipelines also necessitated the addition of new dependencies, and the process was becoming increasingly complex. To mitigate this issue, we initially made all pipelines independent, as illustrated in Fig. 2. This way, pipeline changes could be made without updating Sequana and vice versa, which was a significant improvment.

Figure 2 v0.8 of Sequana moved the Snakemake pipelines in indepdendent repositories. A cookie cutter ease the creation of scuh pipelines

However, certain tools, such as those used for user interface and input data sanity checks, were required by all pipelines, as depicted by the pipetools box in the figure. As new pipelines were being added every month, we aimed to make the pipelines and Sequana more modular. Consequently, we created a pure Python library known as sequana_pipetools, as shown in Fig. 3, to make the pipelines even more autonomous.

Figure 3 New Sequana framework. The library contains the core and bioinformatics tools and is now distinct from the pipelines. Additionally, the sequana_pipetools library supplies common tools to assist in the creaton and management of all pipelines, such as shared parser for options.

Finally, we dropped the rules/ available in Sequana to build an independent package with a set of Snakemake wrappers. These wrappers are available on and have also the advantage of being tested through continuous integration.

Figure 3 New Sequana framework 2021. The library itself with the core, the bioinformatics tools is now fully independent of the pipelines.


from pypi website:

pip install sequana_pipetools

No dependencies for this package except Python itself. In practice, this package has no interest if not used with a Sequana pipeline. So, when using it, you will need to install the relevant Sequana pipelines that you wish to use. For example:

pip install sequana_rnaseq
pip install sequana_fastqc

This package is for Sequana developers. To get more help, go to the doc directory and build the local sphinx directory using:

make html
browse build/html/index.html

Quick tour

There are currently two standalone tools. The first one is for Linux users under bash to obtain completion of a sequana pipeline command line arguments:

sequana_completion --name fastqc

The second is used to introspect slurm files to get a summary of the SLURM log files:

sequana_slurm_status --directory .

Will print a short summary report with common errors (if any).

The library is intended to help Sequana developers to design their pipelines. See the Sequana organization repository for examples.

In addition to those standalones, sequana_pipetools goal is to provide utilities to help Sequana developers. We currently provide a set of Options classes that should be used to design the API of your pipelines. For example, the sequana_pipetools.options.SlurmOptions can be used as follows inside a standard Python module (the last two lines is where the magic happens):

import rich_click as click
from sequana_pipetools.options import *
from sequana_pipetools import SequanaManager

NAME = "fastqc"
help = init_click(NAME, groups={
    "Pipeline Specific": [
        "--method", "--skip-multiqc"],

@include_options_from(ClickSnakemakeOptions, working_directory=NAME)
@include_options_from(ClickInputOptions, add_input_readtag=False)
@click.option("--method", default="fastqc", type=click.Choice(["fastqc", "falco"]), help="your msg")
def main(**options):

    # the real stuff is here
    manager = SequanaManager(options, NAME)
    options = manager.options


    # Fill the config file with data and specific options
    cfg = manager.config.config
    cfg.input_pattern = options.input_pattern
    cfg.input_directory = os.path.abspath(options.input_directory)
    cfg.general.method_choice = options.method


    # finalise the command and save it; copy the snakemake. update the config
    # file and save it.

if __name__ == "__main__":

Developers should look at e.g. module sequana_pipetools.options for the API reference and one of the official sequana pipeline (e.g., to get help from examples.

The Options classes provided can be used and combined to design pipelines.

How to create skeleton of a Sequana pipeline with cookiecutter

You can start a Sequana pipeline skeleton as follows:

pip install cookiecuter
cookiecutter -o . --overwrite-if-exists

and then follow the instructions. You will be asked some questions such as the name of your pipeline (eg. variant), a description, keywords and the project_slug (just press enter).

How to use sequana pipetools within your Pipeline

For FastQ files (paired ot not), The config file should look like:

sequana_wrappers: "v0.15.1"

input_directory: '.'
input_readtag: "_R[12]_"
input_pattern: '*fastq.gz'

    fastqc: ""

    key1: value1
    key2: value2

And your pipeline could make use of this as follows:

configfile: "config.yaml"

from sequana_pipetools import PipelineManager
manager = PipelineManager("fastqc", config)

# you can then figure out wheter it is paired or not:

# get the wrapper version to be used within a rule:

# the raw data (with a wild card) for the first rule

# add a Makefile to clean things at the end

Setting up and Running Sequana pipelines

When you execute a sequana pipeline, e.g.:

sequana_fastqc --input-directory data

a working directory is created (with the name of the pipeline; here fastqc). Moreover, the working directory contains a shell script that will hide the snakemake command. This snakemake command with make use of the sequana wrappers and will use the official sequana github repository by default ( This may be overwritten. For instance, you may use a local clone. To do so, you will need to create an environment variable:

export SEQUANA_WRAPPERS="git+file:///home/user/github/sequana-wrappers

If you decide to use singularity/apptainer, one common error on a cluster is that non-standard paths are not found. You can bind them using the -B option but a more general set up is to create thos environment variable:

export SINGULARITY_BINDPATH="  /path_to_bind"

for Singularity setup, or

export APPTAINER_BINDPATH=" /path_to_bind"

for Apptainer setup.

What is Sequana ?

Sequana is a versatile tool that provides

  1. A Python library dedicated to NGS analysis (e.g., tools to visualise standard NGS formats).

  2. A set of Pipelines dedicated to NGS in the form of Snakefiles (Makefile-like with Python syntax based on snakemake framework) with more than 80 re-usable rules.

  3. Standalone applications.

See the sequana home page for details.

To join the project, please let us know on github.





  • Fix/rename error_report into onerror to be included in the Snakemake onerror section. added ‘slurm’ in slurm output log file in the profile


  • scripts now use click instead of argparse

  • All Options classes have now an equivalent using click. For example GeneralOptions has a class ClickGeneralOptions. The GeneralOptions is kept for now for back compatibility

  • –run-mode removed and replaced by –profile options. Profiles are used and stored withub .sequana/profiles

  • Remove –slurm-cores-per-job redundant with resources from snakemake

  • Way a is coded fully refactored and simplified as described in the README

  • cluster_config are now deprecated in favor of profile

  • sequana_slurm_status removed. Use manager.error_report in pipelines instead


  • remove useless code (readme, description) related to old rules

  • requirements.txt renamed in tools.txt to store the required tools to run a pipeline.

  • remove copy_requirements, not used in any pipelines (replaced by code in of the pipelines)

  • a utility function called getmetadata that returns dictionary with name, version, wrappers version)


  • remove a print statement


  • Module now returns the list of requirements. SequanaManager creates a txt file with all standalones from the requirements.


  • switch to pyproject and fixes #64


  • automatically populater ‘wrappers’ in PipelineManager’ based on the config entry ‘sequana_wrappers’.


  • handles sequana pipeline with underscores (e.g. pacbio_qc)


  • fixes singularity-args in profile


  • Fix the singularity arguments by (i) adding -e and (ii) bind the /home. Indeed, snakemake sets –home to the current directory. Somehow the /home is lost. Removed deprecated function


  • fix regression bug


  • factorise hash function to have url2hash easily accessible

  • Use pth file to retrieve data dir in editable mode

  • remove harcoded bind path for apptainer. Uses env variable instead

  • Fixes singularity-prefix path in shell script if not absolute


  • fix regression, add codacy badge, applied black, remove init_pipeline deprecated function.


  • More robust code to check pip executable.



  • any python module can implement a Sequana pipeline.


  • incorporate the sequana_start_template from sequana and refactorise the scripts into scripts/


  • hotfix on apptainer to be back compatible if no apptainers section is found in the config file.


  • replaced singularity word by apptainer (–use-aptainer instead of –use-singularity)


  • If timeout occurs while singularity is downloaded, catch the error remove truncated file.


  • hotfix missing import when checking sequana version

  • add config2schema utility function for developers


  • Udate asynchronous downloads to use aiohttp


  • Ability to download automatically singularity images (as URLs) if set in the pipelines (container field). add the –use-singularity option in all pipelines (and –singualrity-prefix)


  • MAJOR update/Aug 2022

  • new mechanism to handle profile for Snakemake that will replace the cluster_config.yaml files

  • Major cleanup of PipelineManager (PipelineManagerGeneric was removed). The way input files are handled was also cleanup. Fixes and also files starting with common prefixes


  • Better schema validation


  • removed ‘required_binaries’ attribute in (not used)

  • removed ‘copy_requirements’ in sequana_config and fixed the one in the sequana_manager

  • switch from distutils to packaging

  • More tests reaching >90%


  • simplify the setup() method in pipeline manager


  • can set a SEQUANA_WRAPPERS env variable to use local wrappers


  • switch biomics to biomicspole for the slurm queue (internal change)


  • add schema pipeline manager directory & fix attrdict error with yaml


  • allows pipeline and rules to have the same name


  • Fix the –from-project option


  • Set the –wrapper-prefix to point to the sequana-wrappers github


  • Fix SequanaConfig file


  • Fix script creation to include wrapper and take new snakemake syntax into account


  • update schema handling


  • Move all modules related to pipelines rom sequana into sequana_pipetools; This release should now be the entry point for all Sequana pipelines (no need to import sequana itself).


  • feature removed in sequana to deal with adapter removal and changes updated in the package (removed the ‘design’ option from the cutadapt rules and needed)

  • Improve TrimmingOptions to provide specific list of tools and a default trimming tool


  • add TrimmingOptions class intended at replacing CutadaptOptions

  • to avoid extra spaces, add ‘-o nospace’ in all completion files


  • fix typo


  • add new module called error to be added in onerror sections of all pipelines. Usual test update. Pin to stable version


  • add MANIFEST to include missing requirements.txt


  • add FeatureCounts options


  • add slurm status utility (sequana_slurm_status)


  • stable version


  • comment the prin_newest_version, which is too slow


  • stable release


  • previous new feature led to overhead of a few seconds with –help in this version, we include it only when using –version


  • include newest_version feature


  • completion can now handle multiple directories/files properly

  • better doc and more tests


  • fix completion to avoir 2 scripts to overwrite each other


  • add a deprecated warning + before_pipeline function


  • add –from-project option to import existing config file

  • remove –paired-data option


add content from sequana.pipeline_common to handle all kind of options in the argparse of all pipelines. This is independent of sequana to speed up the –version and –help calls


add version of the pipeline in the output completion file


release bug fix


creation of the package

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sequana_pipetools-0.16.1.tar.gz (53.2 kB view hashes)

Uploaded source

Built Distribution

sequana_pipetools-0.16.1-py3-none-any.whl (58.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page