niekwit/smallRNA-seq

Snakemake workflow for small RNA-seq analysis

Overview

Latest release: v0.7.0, Last update: 2026-10-30

Share link: https://snakemake.github.io/snakemake-workflow-catalog?wf=niekwit/smallRNA-seq

Quality control: linting: failed formatting: passed

Wrappers: bio/cutadapt/se

Deployment

Step 1: Install Snakemake and Snakedeploy

Snakemake and Snakedeploy are best installed via the Conda package manager. It is recommended to install conda via Miniforge. Run

conda create -c conda-forge -c bioconda -c nodefaults --name snakemake snakemake snakedeploy

to install both Snakemake and Snakedeploy in an isolated environment. For all following commands ensure that this environment is activated via

conda activate snakemake

For other installation methods, refer to the Snakemake and Snakedeploy documentation.

Step 2: Deploy workflow

With Snakemake and Snakedeploy installed, the workflow can be deployed as follows. First, create an appropriate project working directory on your system and enter it:

mkdir -p path/to/project-workdir
cd path/to/project-workdir

In all following steps, we will assume that you are inside of that directory. Then run

snakedeploy deploy-workflow https://github.com/niekwit/smallRNA-seq . --tag v0.7.0

Snakedeploy will create two folders, workflow and config. The former contains the deployment of the chosen workflow as a Snakemake module, the latter contains configuration files which will be modified in the next step in order to configure the workflow to your needs.

Step 3: Configure workflow

To configure the workflow, adapt config/config.yml to your needs following the instructions below.

Step 4: Run workflow

The deployment method is controlled using the --software-deployment-method (short --sdm) argument.

To run the workflow using apptainer/singularity, use

snakemake --cores all --sdm apptainer

To run the workflow using a combination of conda and apptainer/singularity for software deployment, use

snakemake --cores all --sdm conda apptainer

To run the workflow with automatic deployment of all required software via conda/mamba, use

snakemake --cores all --sdm conda

Snakemake will automatically detect the main Snakefile in the workflow subfolder and execute the workflow module that has been defined by the deployment in step 2.

For further options such as cluster and cloud execution, see the docs.

Step 5: Generate report

After finalizing your data analysis, you can automatically generate an interactive visual HTML report for inspection of results together with parameters and code inside of the browser using

snakemake --report report.zip

Configuration

The following section is imported from the workflow’s config/README.md.

Workflow overview

This workflow analyses small RNA-seq data, with a focus on TE-derived piRNAs. It is built using snakemake and consists of the following steps:

  1. Trim 3’ adapters (cutadapt) and plot read length distributions

  2. Annotate small RNAs and count TE/miRNA reads (TEsmall)

  3. Differential expression analysis, PCA and volcano plots (DESeq2)

  4. Collapse reads (fastx_collapser) and remove rRNA (Ensembl ncRNA) and miRNA (miRBase hairpin) reads (bowtie)

  5. Align the remaining reads to the TE consensus sequences (bowtie)

  6. Ping-pong analysis (5’ overlap distances between sense/antisense reads) and piRNA 1U/10A sequence bias

  7. Strand-split TE coverage bigWigs (deepTools) and TE track plots (pyGenomeTracks)

See the main README for the expected directory layout, the full list of output files and a detailed explanation of the bigWig normalisation options.

Running the workflow

Input data

Gzipped single-end FASTQ files, one per sample, at reads/{sample}/{sample}.fastq.gz. Sample names and their conditions are set in config/config.yaml under samples.

A FASTA file with the TE consensus sequences of interest (pingpong.fasta) is needed for the ping-pong analysis and the TE coverage tracks.

Parameters

This table lists all parameters that can be used to run the workflow.

parameter

type

details

example

genome

str

reference genome, hg38 or mm39

mm39

release

int

Ensembl release used for reference data downloads

115

samples

map

sample: condition pairs

KO_1: KO

reference_condition

str

baseline condition for differential analysis and plot ordering

Control

cutadapt

adapter

str

3’ adapter sequence to trim

AGATCGGAAGAGCACACGTCT

extra

str

additional cutadapt arguments

"-m 16 --trimmed-only -q 20"

tesmall

dbfolder

str

path to the TEsmall database directory (built on the first run if absent)

/path/to/te_small_db

minlen

int

minimum read length

16

maxlen

int

maximum read length

36

maxaln

int

maximum number of alignments per read

100

mismatch

int

number of mismatches allowed

0

extra_args

str

additional TEsmall arguments

""

te_classes

str or list

TE classes for the top-families plot: All or a list (DNA, LINE, LTR, RC, Retroposon, Satellite, SINE, Unknown, Unspecified)

[LINE, LTR]

length_distribution

apply_mirna_correction

bool

normalise to miRNA reads; False normalises to total counts

False

mirna_correction_method

str

length (reads within the miRNA length window) or align (reads aligned to miRNA hairpins)

length

mirna_min

int

minimum length of the miRNA window (length method only)

19

mirna_max

int

maximum length of the miRNA window (length method only)

25

bigwig

bin_size

int

bamCoverage bin size (bp)

10

read_length

int

read length used to select the effective genome size (50, 75, 100, 150 or 200)

50

normalize_using

str

RPKM, CPM, BPM, RPGC, None, totalReads or miRNAReads

CPM

extra

str

additional bamCoverage arguments

""

pingpong

bowtie_params

str

bowtie alignment arguments

"--best -k 1 -v 3"

fasta

str

FASTA file with TE consensus sequences

resources/TE.fa

min_len

int

minimum read length (inclusive) included in the ping-pong analysis and TE coverage tracks

23

max_len

int

maximum read length (inclusive) included in the ping-pong analysis and TE coverage tracks

32

window

int

maximum 5’ overlap distance (nt) recorded between sense/antisense read pairs

30

plot.type

str

line or bar

line

plot.bar_position

str

grouped (dodged bars) or overlap (overlaid, semi-transparent bars); bar only

grouped

ngs_tracker (optional)

enabled

bool

register the run with NGS Tracker on success/failure; see config.yaml for the other fields

false

Workflow parameters

The following table is automatically parsed from the workflow’s config.schema.y(a)ml file.

Parameter

Type

Description

Required

Default

genome

string

The reference genome to be used.

yes

release

integer

Ensembl release number for reference data downloads.

yes

samples

Mapping of sample names to their respective experimental conditions.

yes

reference_condition

string

The condition to be used as the baseline for differential analysis.

yes

cutadapt

yes

. adapter

string

3’ adapter sequence to be trimmed.

yes

. extra

string

Additional command line arguments for cutadapt.

tesmall

yes

. dbfolder

string

Path to the TEsmall database directory.

yes

. minlen

integer

yes

. maxlen

integer

yes

. maxaln

integer

yes

. mismatch

integer

yes

. extra_args

string

. te_classes

TE classes to display in the top-families plot. Use “All” to include every class present in the data, or supply a list of class names from: DNA, LINE, LTR, RC, Retroposon, Satellite, SINE, Unknown, Unspecified.

                                                                                                                 | yes      |         |

| length_distribution | | | yes | | | . apply_mirna_correction | boolean | Enable miRNA-based normalization for length distribution plots. | yes | | | . mirna_correction_method | string | Method for miRNA-based normalization. “length” uses reads within a defined length window as a proxy for miRNA counts. “align” uses the count of reads that aligned to miRNA hairpin sequences. | yes | | | . mirna_min | integer | Minimum read length defining the miRNA window (mirna_correction_method = length only). | | | | . mirna_max | integer | Maximum read length defining the miRNA window (mirna_correction_method = length only). | | | | bigwig | | | yes | | | . bin_size | integer | Bin size (bp) passed to bamCoverage –binSize. | yes | | | . read_length | integer | Read length used to select the effective genome size for bamCoverage. Must match one of the pre-computed values (50, 75, 100, 150, 200). | yes | | | . normalize_using | string | Normalisation method passed to bamCoverage –normalizeUsing. RPGC normalises to 1x genome coverage using the effective genome size; CPM and RPKM are read-count based; None disables normalisation. totalReads and miRNAReads are custom scale-factor methods (based on TEsmall count summaries) used for the strand-split TE bigWigs. | yes | | | . extra | string | Additional command line arguments passed to bamCoverage. | yes | | | pingpong | | | yes | | | . bowtie_params | string | Bowtie alignment arguments used for the ping-pong analysis. | yes | | | . fasta | string | Path to the consensus sequence FASTA file. | yes | | | . window | integer | Analysis window size for ping-pong overlap distances. | yes | | | . min_len | integer | Minimum read length (inclusive) included in the ping-pong analysis. | yes | | | . max_len | integer | Maximum read length (inclusive) included in the ping-pong analysis. | yes | | | . plot | | | yes | | | . . type | string | Plot type for ping-pong distance data. | yes | | | . . bar_position | string | Bar positioning when type is “bar”. grouped uses dodged bars; overlap uses identity positioning with transparency. | | |

Linting and formatting

Linting results
1/home/runner/work/snakemake-workflow-catalog/snakemake-workflow-catalog/.pixi/envs/default/lib/python3.13/site-packages/google/auth/transport/grpc.py:43: FutureWarning: grpcio < 1.83.0 does not support Post-Quantum Cryptography (PQC). Support for non-PQC environments is deprecated. In April 2027, google-auth will raise its minimum requirements to enforce grpcio >= 1.83.0. For more details on Google Cloud's post-quantum security migration, visit: https://cloud.google.com/security/resources/post-quantum-cryptography
2  warnings.warn(
3AssertionError in file "/tmp/tmp0vq9dxy2/niekwit-smallRNA-seq-4dd961a/workflow/rules/common.smk", line 17:
4No FASTQ files found in reads/ directory!
5  File "/tmp/tmp0vq9dxy2/niekwit-smallRNA-seq-4dd961a/workflow/Snakefile", line 31, in <module>
6  File "/tmp/tmp0vq9dxy2/niekwit-smallRNA-seq-4dd961a/workflow/rules/common.smk", line 17, in samples
Formatting results
All tests passed!