baerlachlan/smk-rnaseq-counts

Snakemake workflow for estimating read counts from RNA-seq data

Overview

Latest release: v1.3.7, Last update: 2026-07-09

Share link: https://snakemake.github.io/snakemake-workflow-catalog?wf=baerlachlan/smk-rnaseq-counts

Quality control: linting: failed formatting: failed

Wrappers: bio/bedtools/genomecov bio/fastp bio/fastqc bio/gffread bio/reference/ensembl-annotation bio/reference/ensembl-sequence bio/rseqc/read_distribution bio/salmon/decoys bio/salmon/index bio/salmon/quant bio/samtools/faidx bio/samtools/index bio/samtools/sort bio/star/align bio/star/index bio/subread/featurecounts bio/ucsc/genePredToBed bio/ucsc/gtfToGenePred

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/baerlachlan/smk-rnaseq-counts . --tag v1.3.7

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 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.

Configuration

This directory contains the user-editable configuration files for the workflow.

Most projects require editing:

config/config.yaml
config/samples.tsv
config/units.tsv

config.yaml

config.yaml controls workflow inputs, references, tool settings, and optional modules.

Section

Purpose

samples

Path to the sample table. Defaults to config/samples.tsv.

units

Path to the sequencing unit table. Defaults to config/units.tsv.

data_dir

Directory containing FASTQ files listed in units.tsv.

ref

Ensembl reference species, release, build, and optional custom sequence merging.

read_length

Raw read length, used for STAR splice junction index settings.

fastqc

FastQC activation and options.

trim

fastp trimming options and UMI trimming defaults.

align

STAR genome alignment options.

featureCounts

Gene-level counting options.

salmon

Salmon indexing and quantification options.

junctions

Optional regtools junction extraction.

deduplicate

Optional UMI-tools deduplication.

read_distribution

Optional RSeQC read distribution.

inner_distance

Optional RSeQC inner distance.

rrna

Optional rRNA/rDNA alignment.

coverage

Optional genome/exon/intron/intergenic coverage summaries.

The comments in config.yaml describe the main options in place. Always review paired-end/single-end-specific tool options before running a new dataset.

samples.tsv

The sample table lists the biological or analysis-level samples to process.

Required columns:

Column

Description

sample

Unique sample identifier.

Example:

sample
WT_1
WT_2
KO_1
KO_2

Sample names should be unique and should not contain whitespace. Biological replicates should be listed as separate samples. Technical sequencing units for the same sample should be represented in units.tsv, not as separate samples.

units.tsv

The unit table links samples to FASTQ files. Each row corresponds to one sequencing unit, such as one lane or one sequencing run for a sample.

Required columns:

Column

Description

sample

Sample identifier matching a row in samples.tsv.

unit

Sequencing unit identifier, unique within each sample.

fq1

FASTQ file for read 1, or the only FASTQ file for single-end data.

fq2

FASTQ file for read 2. Leave blank for single-end data.

Optional UMI override columns:

Column

Description

umi_trim

Override whether fastp UMI processing is used for this unit.

umi_loc

Override UMI location for this unit.

umi_len

Override UMI length for this unit.

umi_skip

Override number of bases skipped before the UMI for this unit.

Per-unit umi_len and umi_skip values should be written as integers.

FASTQ paths in fq1 and fq2 are resolved relative to data_dir in config.yaml.

For example, with:

data_dir: "../raw_data"

this unit entry:

sample	unit	fq1	fq2
WT_1	1	WT_1_R1.fastq.gz	WT_1_R2.fastq.gz

refers to:

../raw_data/WT_1_R1.fastq.gz
../raw_data/WT_1_R2.fastq.gz

Paired-End Example

One sequencing unit per sample:

sample	unit	fq1	fq2
WT_1	1	WT_1_R1.fastq.gz	WT_1_R2.fastq.gz
WT_2	1	WT_2_R1.fastq.gz	WT_2_R2.fastq.gz
KO_1	1	KO_1_R1.fastq.gz	KO_1_R2.fastq.gz
KO_2	1	KO_2_R1.fastq.gz	KO_2_R2.fastq.gz

Multiple sequencing units for the same sample:

sample	unit	fq1	fq2
WT_1	L001	WT_1_L001_R1.fastq.gz	WT_1_L001_R2.fastq.gz
WT_1	L002	WT_1_L002_R1.fastq.gz	WT_1_L002_R2.fastq.gz
WT_2	L001	WT_2_L001_R1.fastq.gz	WT_2_L001_R2.fastq.gz
WT_2	L002	WT_2_L002_R1.fastq.gz	WT_2_L002_R2.fastq.gz

Multiple units for the same sample are trimmed separately and then merged before alignment and Salmon quantification.

Single-End Example

For single-end data, keep the fq2 column but leave it blank:

sample	unit	fq1	fq2
WT_1	1	WT_1.fastq.gz	
WT_2	1	WT_2.fastq.gz	
KO_1	1	KO_1.fastq.gz	
KO_2	1	KO_2.fastq.gz	

All samples in one run must be either paired-end or single-end. Do not mix paired-end and single-end samples in the same config.

References

Reference files are configured under ref in config.yaml.

Example:

ref:
  species: homo_sapiens
  release: 112
  build: GRCh38

The workflow downloads the matching Ensembl genome FASTA, transcriptome FASTA, and GTF annotation, then builds STAR and Salmon indices as needed.

To merge custom or spike-in sequences into the reference, activate ref.merge_with and provide matching FASTA and GTF files:

ref:
  merge_with:
    activate: True
    fasta: "resources/genome_to_merge.fa"
    gtf: "resources/annotation_to_merge.gtf"

The FASTA and GTF should describe the same additional sequences.

Trimming And UMIs

Global fastp options are configured under trim.extra.

UMI trimming defaults are configured under trim.umi:

trim:
  umi:
    activate: False
    umi_loc: "per_read"
    umi_len: "5"
    umi_skip: "2"

These defaults can be overridden for individual rows in units.tsv with the optional UMI columns described above.

If UMI deduplication is required after alignment, also activate the deduplicate module.

featureCounts Strandedness

featureCounts strandedness is configured as a list:

featureCounts:
  strandedness: [0, 1, 2]

Values are:

Value

Meaning

Output directory

0

Unstranded

results/featureCounts/unstranded/

1

Stranded

results/featureCounts/stranded/

2

Reverse-stranded

results/featureCounts/reverse/

Using all three values can help infer library strandedness from featureCounts summary statistics. If strandedness is known, provide only the relevant value.

For example:

featureCounts:
  strandedness: [2]

Optional Modules

Optional modules are disabled by default unless otherwise specified in config.yaml.

UMI Deduplication

deduplicate:
  activate: True

Deduplicates aligned BAM files using UMI-tools. When active, supported downstream modules use deduplicated BAM files.

Splice Junctions

junctions:
  activate: True

Extracts splice junctions from aligned BAM files using regtools and writes adjusted BED files under results/junctions/.

RSeQC

read_distribution:
  activate: True

inner_distance:
  activate: True

Runs selected RSeQC summaries using annotation-derived BED files.

rRNA Alignment

rrna:
  activate: True

Aligns reads to the bundled rDNA/rRNA reference with STAR and writes sorted, indexed BAM files under results/rrna/bam/.

Coverage

coverage:
  activate: True

Computes coverage summaries across genome, exon, intron, and intergenic regions. Intergenic regions are defined as the complement of annotated gene intervals. Intronic regions are defined as gene regions outside merged exons.

Common Checks Before Running

  • Confirm every sample in units.tsv appears in samples.tsv.

  • Confirm each (sample, unit) pair is unique.

  • Confirm all FASTQ paths resolve correctly relative to data_dir.

  • Confirm the whole dataset is either paired-end or single-end.

  • Review trim.extra, featureCounts.extra, and deduplicate.extra for paired-end/single-end compatibility.

  • Run a dry-run with snakemake -n before submitting a full workflow.

Linting and formatting

Linting results
 1Using workflow specific profile workflow/profiles/default for setting default command line arguments.
 2Lints for rule genome_merge (line 15, /tmp/tmp1bhmd4tq/baerlachlan-smk-rnaseq-counts-f6091fb/workflow/rules/refs.smk):
 3    * Specify a conda environment or container for each rule.:
 4      This way, the used software for each specific step is documented, and the
 5      workflow can be executed on any machine without prerequisites.
 6      Also see:
 7      https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#integrated-package-management
 8      https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#running-jobs-in-containers
 9
10Lints for rule genome_chrom_sizes (line 42, /tmp/tmp1bhmd4tq/baerlachlan-smk-rnaseq-counts-f6091fb/workflow/rules/refs.smk):
11    * Specify a conda environment or container for each rule.:
12      This way, the used software for each specific step is documented, and the
13      workflow can be executed on any machine without prerequisites.
14      Also see:
15      https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#integrated-package-management
16      https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#running-jobs-in-containers
17
18Lints for rule transcriptome_merge (line 84, /tmp/tmp1bhmd4tq/baerlachlan-smk-rnaseq-counts-f6091fb/workflow/rules/refs.smk):
19    * Specify a conda environment or container for each rule.:
20      This way, the used software for each specific step is documented, and the
21      workflow can be executed on any machine without prerequisites.
22      Also see:
23      https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#integrated-package-management
24      https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#running-jobs-in-containers
25
26Lints for rule annotation_merge (line 112, /tmp/tmp1bhmd4tq/baerlachlan-smk-rnaseq-counts-f6091fb/workflow/rules/refs.smk):
27    * Specify a conda environment or container for each rule.:
28      This way, the used software for each specific step is documented, and the
29      workflow can be executed on any machine without prerequisites.
30      Also see:
31      https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#integrated-package-management
32      https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#running-jobs-in-containers
33
34Lints for rule annotation_sort (line 126, /tmp/tmp1bhmd4tq/baerlachlan-smk-rnaseq-counts-f6091fb/workflow/rules/refs.smk):
35    * Specify a conda environment or container for each rule.:
36      This way, the used software for each specific step is documented, and the
37      workflow can be executed on any machine without prerequisites.
38      Also see:
39      https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#integrated-package-management
40      https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#running-jobs-in-containers
41
42Lints for rule merge (line 1, /tmp/tmp1bhmd4tq/baerlachlan-smk-rnaseq-counts-f6091fb/workflow/rules/merge.smk):
43    * Specify a conda environment or container for each rule.:
44      This way, the used software for each specific step is documented, and the
45      workflow can be executed on any machine without prerequisites.
46      Also see:
47      https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#integrated-package-management
48      https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#running-jobs-in-containers
49
50Lints for rule junctions_adjust (line 23, /tmp/tmp1bhmd4tq/baerlachlan-smk-rnaseq-counts-f6091fb/workflow/rules/junctions.smk):
51    * Specify a conda environment or container for each rule.:
52      This way, the used software for each specific step is documented, and the
53      workflow can be executed on any machine without prerequisites.
54      Also see:
55      https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#integrated-package-management
56      https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#running-jobs-in-containers
57
58Lints for rule rrna_get (line 1, /tmp/tmp1bhmd4tq/baerlachlan-smk-rnaseq-counts-f6091fb/workflow/rules/rrna.smk):
59    * Specify a conda environment or container for each rule.:
60      This way, the used software for each specific step is documented, and the
61      workflow can be executed on any machine without prerequisites.
62      Also see:
63      https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#integrated-package-management
64      https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html#running-jobs-in-containers
Formatting results
 1[DEBUG] 
 2[DEBUG] 
 3[DEBUG] 
 4[DEBUG] 
 5[DEBUG] In file "/tmp/tmp1bhmd4tq/baerlachlan-smk-rnaseq-counts-f6091fb/workflow/rules/common.smk":  Formatted content is different from original
 6[DEBUG] 
 7[DEBUG] In file "/tmp/tmp1bhmd4tq/baerlachlan-smk-rnaseq-counts-f6091fb/workflow/rules/coverage.smk":  Formatted content is different from original
 8[DEBUG] 
 9[DEBUG] In file "/tmp/tmp1bhmd4tq/baerlachlan-smk-rnaseq-counts-f6091fb/workflow/rules/junctions.smk":  Formatted content is different from original
10[DEBUG] 
11[DEBUG] In file "/tmp/tmp1bhmd4tq/baerlachlan-smk-rnaseq-counts-f6091fb/workflow/rules/align.smk":  Formatted content is different from original
12[DEBUG] 
13[DEBUG] In file "/tmp/tmp1bhmd4tq/baerlachlan-smk-rnaseq-counts-f6091fb/workflow/rules/rrna.smk":  Formatted content is different from original
14[DEBUG] 
15[DEBUG] 
16[DEBUG] In file "/tmp/tmp1bhmd4tq/baerlachlan-smk-rnaseq-counts-f6091fb/workflow/rules/deduplicate.smk":  Formatted content is different from original
17[DEBUG] 
18[DEBUG] In file "/tmp/tmp1bhmd4tq/baerlachlan-smk-rnaseq-counts-f6091fb/workflow/rules/rseqc.smk":  Formatted content is different from original
19[DEBUG] 
20[DEBUG] 
21[DEBUG] In file "/tmp/tmp1bhmd4tq/baerlachlan-smk-rnaseq-counts-f6091fb/workflow/Snakefile":  Formatted content is different from original
22[DEBUG] 
23[DEBUG] In file "/tmp/tmp1bhmd4tq/baerlachlan-smk-rnaseq-counts-f6091fb/workflow/rules/refs.smk":  Formatted content is different from original
24[INFO] 9 file(s) would be changed 😬
25[INFO] 5 file(s) would be left unchanged 🎉
26
27snakefmt version: 0.11.5