Skip to content

nf-core Pipelines for RNA-seq

nf-core is a community effort to build curated, peer-reviewed bioinformatics pipelines using Nextflow. Each pipeline follows strict standards for code quality, documentation, testing, and reproducibility.

nf-core pipelines run the same way on a laptop, an HPC cluster, or a cloud environment. They use containers to lock down every tool version. They support resuming from checkpoints, so if a run fails partway through, you do not have to start over.

For RNA-seq analysis, two nf-core pipelines cover the full workflow from raw reads to differential expression results.

The nf-core/rnaseq pipeline takes raw FASTQ files and produces aligned reads, gene counts, and comprehensive quality reports. It handles everything between receiving your sequencing data and starting statistical analysis.

The pipeline runs the following steps:

  1. Quality control with FastQC. Each sample is checked for read quality, adapter contamination, GC content bias, duplication rates, and other quality metrics.
  2. Adapter trimming with Trim Galore. Sequencing adapters and low-quality bases are removed from the ends of reads.
  3. Alignment with STAR. Reads are aligned to a reference genome using a splice-aware aligner that can handle reads spanning exon-exon junctions.
  4. Quantification with Salmon. Transcript-level abundance is estimated using a fast pseudo-alignment approach.
  5. Post-alignment QC including duplicate marking, gene body coverage analysis, and strand specificity checks.
  6. Summary report with MultiQC. All quality metrics from every step are compiled into a single interactive HTML report.

The pipeline supports multiple alignment and quantification strategies. The default mode uses STAR for alignment and Salmon for quantification. You can also run Salmon in standalone mode without genome alignment, or use other aligners like HISAT2.

Here is a minimal command to run the pipeline:

Terminal window
nextflow run nf-core/rnaseq \
-r 3.14.0 \
-profile docker \
--input samplesheet.csv \
--outdir results \
--genome GRCh38 \
--aligner star_salmon

The --input flag points to a CSV samplesheet that lists your FASTQ files and their associated sample names. The format is:

sample,fastq_1,fastq_2,strandedness
control_rep1,/data/ctrl1_R1.fastq.gz,/data/ctrl1_R2.fastq.gz,reverse
control_rep2,/data/ctrl2_R1.fastq.gz,/data/ctrl2_R2.fastq.gz,reverse
treated_rep1,/data/trt1_R1.fastq.gz,/data/trt1_R2.fastq.gz,reverse
treated_rep2,/data/trt2_R1.fastq.gz,/data/trt2_R2.fastq.gz,reverse

The -profile docker flag tells Nextflow to pull and run each tool inside its container. Replace docker with singularity on HPC clusters, or podman if using Podman. The --genome flag selects a pre-configured reference genome from the nf-core iGenomes collection.

nf-core/differentialabundance: from counts to results

Section titled “nf-core/differentialabundance: from counts to results”

The nf-core/differentialabundance pipeline takes a count matrix and sample metadata, then runs statistical tests to identify differentially expressed genes. It produces tables of results, diagnostic plots, and publication-ready figures.

The pipeline supports several statistical methods:

  • DESeq2 for differential expression testing using negative binomial models.
  • limma-voom as an alternative approach using linear models with precision weights.

It also generates standard QC visualizations including PCA plots, sample correlation heatmaps, volcano plots, and MA plots.

Terminal window
nextflow run nf-core/differentialabundance \
-r 1.5.0 \
-profile docker \
--input samplesheet.csv \
--matrix salmon.merged.gene_counts.tsv \
--outdir results_de \
--contrasts contrasts.csv

The --matrix flag points to the gene count matrix produced by the nf-core/rnaseq pipeline. The --contrasts file defines which comparisons to make:

id,variable,reference,target
treated_vs_control,condition,control,treated

This tells the pipeline to compare treated samples against control samples using the condition column from the samplesheet.

The output of nf-core/rnaseq feeds directly into nf-core/differentialabundance. The connection point is the count matrix.

When nf-core/rnaseq finishes, it writes Salmon quantification results to the output directory. The merged gene-level count matrix is typically found at:

results/star_salmon/salmon.merged.gene_counts.tsv

This file contains raw read counts for every gene across all samples. You pass this file to nf-core/differentialabundance as the --matrix input. You also provide a samplesheet that describes your experimental conditions, and a contrasts file that defines your comparisons.

The full workflow looks like this:

FASTQ files
nf-core/rnaseq
├── Aligned BAM files
├── Salmon counts ──────► nf-core/differentialabundance
└── MultiQC report │
├── DE results tables
├── Volcano plots
└── PCA plots

You could write your own bash scripts to run FastQC, Trim Galore, STAR, and Salmon individually. Many people do. But nf-core pipelines offer several concrete advantages.

Reproducibility. Every tool version is pinned in a container. Your analysis will produce the same results a year from now, on any machine. A bash script that calls star will use whatever version happens to be installed, which may change without notice.

Containers. Each process runs inside its own container. You do not need to install any bioinformatics tools on your system. The pipeline handles all dependencies automatically.

Resume. Nextflow caches the results of every process. If your run fails at step 8 of 12, you fix the problem and re-run. Nextflow skips steps 1 through 7 and picks up where it left off. This saves hours on large datasets.

Parallelism. Nextflow automatically parallelizes independent tasks. If you have 30 samples, all 30 FastQC processes run simultaneously on available resources. You do not need to write parallel execution logic yourself.

Community support. nf-core pipelines are tested continuously, documented thoroughly, and maintained by active developers. Bug reports are tracked on GitHub. Updates are released regularly with new features and fixes.

Portability. The same pipeline command works on your laptop, your institution’s HPC cluster, and AWS Batch. You only change the Nextflow profile to switch environments.

Now that you understand how the nf-core pipelines process RNA-seq data, the next page explains STAR & Salmon in more detail.