Skip to main content
https://badge.fury.io/py/sequana-downsampling.svg https://github.com/sequana/downsampling/actions/workflows/main.yml/badge.svg Python 3.10 | 3.11 | 3.12 JOSS (journal of open source software) DOI

This is the downsampling pipeline from the Sequana project.

Overview:

Downsample NGS data sets (FastQ or FastA).

Input:

A set of FastQ or FastA files (single or paired-end).

Output:

Downsampled FastQ or FastA files.

Status:

Production

Citation:

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

Installation

pip install sequana_downsampling --upgrade

You will also need pigz available on your PATH.

Quick Start

1. Set up the pipeline:

sequana_downsampling --input-directory DATAPATH

2. Run the pipeline:

cd downsampling
bash downsampling.sh

Usage

sequana_downsampling --help

Key pipeline-specific options:

--downsampling-input-format

Input format: fastq (default), fasta, or sam.

--downsampling-method

random (default, keeps a fixed number of reads) or random_pct (keeps a percentage of reads).

--downsampling-max-entries

Number of reads to keep when using random (default: 1000).

--downsampling-percent

Percentage of reads to keep when using random_pct (default: 10).

--downsampling-threads

Number of threads used by pigz to compress output (default: 4).

Examples:

sequana_downsampling --input-directory DATAPATH \
    --downsampling-method random --downsampling-max-entries 100

sequana_downsampling --input-directory DATAPATH \
    --downsampling-method random_pct --downsampling-percent 10 \
    --downsampling-input-format fasta --input-pattern "*.fasta"

Run on a SLURM cluster:

cd downsampling
sbatch downsampling.sh

Or drive Snakemake directly:

snakemake -s downsampling.rules --cores 4 --stats stats.txt

Requirements

The following tools must be available (install via conda/bioconda):

mamba env create -f environment.yml
  • sequana — FastQ/FastA selection (Python API)

  • pigz — parallel gzip compression of outputs

Pipeline overview

The pipeline randomly selects reads from the input files (single or paired). If the inputs are paired, the one-to-one mapping between R1 and R2 is preserved. FastQ inputs can be gzipped; outputs are gzipped with pigz. FastA inputs and outputs are uncompressed.

Configuration

Here is the latest documented configuration file. Key sections:

  • downsampling — method (random / random_pct), max_entries, percent, threads, and input_format (fastq / fasta)

Changelog

Version

Description

0.10.0

  • Migrate to Poetry / pyproject.toml packaging

  • Simplify __init__.py using importlib.metadata

  • Rewrite CLI with rich_click (replaces argparse)

  • Update CI to use setup-micromamba with generate-run-shell

  • Add localrules: pipeline

  • Add tools.txt and environment.yml

  • Refresh README badges and usage examples

0.9.0

  • Maintenance release

0.8.5

  • Cope with R1/R2 paired data properly. Improved make file

0.8.4

  • Add missing MANIFEST to include missing requirements.txt

0.8.3

  • Comply with new API from sequana_pipetools 0.2.4

0.8.2

  • Add a –run option to execute the pipeline directly

0.8.1

  • Fix input and N in the random selection

0.8.0

First release.

Contribute & Code of Conduct

To contribute to this project, please take a look at the Contributing Guidelines first. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

Metadata

Release files for sequana-downsampling 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sequana-downsampling 0.10.0
File Size Uploaded
sequana_downsampling-0.10.0.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sequana-downsampling 0.10.0
File Interpreter ABI Platform
sequana_downsampling-0.10.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.5 kB

Release files / sequana_downsampling-0.10.0.tar.gz

Download URL sequana_downsampling-0.10.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1ded10d42878ec9254c49203be0640189d1551f4ee704cdfbe1c72075028e74b
BLAKE2b-256 checksum
How to use checksums
f8605ae81e3b161570bf99dbd98b4320590e2306021ce29094a8d8a39ff4b7ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / sequana_downsampling-0.10.0-py3-none-any.whl

Download URL sequana_downsampling-0.10.0-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
feeff188fb18944785910a155fbe9c98f4652cb2974952b8e9a5f27c0c35b6b9
BLAKE2b-256 checksum
How to use checksums
451e17865758af4de87224749fc23f89dbe5702f03746b06692e66b6fc79b4b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.10.0 This release

2 release files

0.9.0

1 release file

0.8.4

1 release file

0.8.3

1 release file

0.8.2

1 release file

0.8.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page