A Nextflow pipeline for bioinformatic workflow for RNASeq analysis on human or mouse transcriptomic data. It performs quality control, ribodepletion, alignment on reference genome, and transcript-level quantification.
This repository includes a custom bioinformatic workflow for our lab (LPM IKEM, Prague, Czechia), all parameters are set to work properly on specific data from our lab. Before any usage, please check if it fits your data as well
- 🧬 Overview
- 🚀 Quick Usage
- 📦 Requirements
- 🛠️ Installation
- 🔬 Pipeline Description
- 📥 Inputs
- 📤 Outputs
- 📚 References
The pipeline takes paired-end FASTQ files and a samplesheet as input and produces:
- Quality-controlled and trimmed reads
- Genome-coordinate alignments
- Transcriptome-coordinate alignments
- Transcript-level quantifications
nextflow run main.nf \
--input samplesheet.csv \
--outdir results/ User needs conda environment with Nextflow (>=23.04.0) & Singularity installed. Everything else needed for the pipeline execution can be prepared with the setup_pipeline.sh script.
| Tool | Version | Purpose |
|---|---|---|
| Nextflow | ≥ 23.04 | Workflow manager |
| FastQC | any | Read quality assessment |
| fastp | any | Read trimming and filtering |
| SORTMERNA | 4.3.7 | Ribodepletion |
| STAR | 2.7.11b | Spliced Transcripts Alignment to a Reference |
| SAMTOOLS | 1.23.1 | Sorting & indexing BAM files |
| QUALIMAP | 2.2.2 | Alignment evaluation |
| SALMON | 2.3.4 | Transcript-level quantification |
| MultiQC | any | QC report aggregation |
| File | Used by |
|---|---|
SortMeRNA db (smr_v4.3_default_db.fasta.gz) |
SORTMERNA |
Homo sapiens genome (GRCh38) (Homo_sapiens.GRCh38.dna_sm.primary_assembly.fa) |
STAR |
Homo sapiens transcripts (GRCh38) (Homo_sapiens.GRCh38.transcripts.fa) |
SALMON |
Homo sapiens annotation (GRCh38) (Homo_sapiens.GRCh38.116.gtf) |
STAR, SALMON |
Mus musculus genome (GRCm39) (Mus_musculus.GRCm39.dna_sm.primary_assembly.fa) |
STAR |
Mus musculus transcripts (GRCm39) (Mus_musculus.GRCm39.transcripts.fa) |
SALMON |
Mus musculus annotation (GRCm39) (Mus_musculus.GRCm39.116.gtf) |
STAR, SALMON |
1. Clone the repository
git clone https://github.com/xpolak37/RNAseq_workflow.git
cd RNAseq_workflow2. Install Nextflow & Singularity
conda create --prefix </path/to/your/new/nf-env/> bioconda::nextflow
conda activate </path/to/your/new/nf-env/>
conda install conda-forge::singularity3. Install pipeline dependencies
Via setup_pipeline.sh script:
bash setup_pipeline.shflowchart TB
A["Input samplesheet"] --> B["FastQC on raw reads"]
A --> C["Fastp quality trimming"]
C --> D["SortMeRNA"]
D --> E["STAR alignment"]
E --> F["Samtools sorting & indexing"]
F --> G["Qualimap BAMQC & RNASEQ"]
E --> H["Salmon quantification"]
C --> Z["MultiQC"]
B --> Z["MultiQC"]
E --> Z["MultiQC"]
G --> Z["MultiQC"]
H --> Z["MultiQC"]
Quality control (FastQC + fastp)
Raw reads are assessed with FastQC before and after trimming. fastp handles adapter removal, quality-based filtering, polyG/X trimming.
SortMeRNA
Filters out ribosomal RNA reads so quantification focuses on mRNA.
STAR alignment
Splice-aware mapping of reads to the genome; also emits a transcriptome BAM for Salmon.
Samtools sorting & indexing
Coordinate-sorts and indexes the genome BAM so downstream tools can read it efficiently.
Qualimap BAMQC & RNASEQ
Post-alignment QC: mapping quality, coverage, and gene-body / read-distribution metrics.
Salmon quantification
Estimates transcript-level abundances (quant.sf) from the transcriptome BAM, with GC/sequence-bias correction.
MultiQC
Aggregates all QC outputs (FastQC, Fastp, STAR, Qualimap, Salmon) into one interactive report.
A CSV file with three columns — no spaces, no extra headers:
sample,read1,read2
SampleID1,/data/SampleID1_R1.fastq.gz,/data/SampleID1_R2.fastq.gz
SampleID2,/data/SampleID2_R1.fastq.gz,/data/SampleID2_R2.fastq.gz| Column | Description |
|---|---|
sample |
Unique sample identifier |
read1 |
Absolute path to forward reads (gzipped FASTQ) |
read2 |
Absolute path to reverse reads (gzipped FASTQ) |
| Parameter | Default | Description |
|---|---|---|
--input |
required | Path to samplesheet CSV (sample,fastq_1,fastq_2) |
--outdir |
${projectDir}/results |
Output directory |
--host |
human |
Reference genome name (human / mouse) |
--star_index |
./host_genomes/ |
Path to the pre-built STAR genome index directory (generated with setup_pipeline.sh) |
--smr_refs |
./smr_v4.3_default_db.fasta |
SortMeRNA rRNA reference FASTA for ribodepletion (downloaded with setup_pipeline.sh) |
--fastp_length_required |
35 |
Minimum read length kept after Fastp trimming |
--star_sjdb_overhang |
150 |
STAR splice-junction overhang (read length − 1) |
--singularity_cache_dir |
./singularity_cache |
Directory for cached Singularity container images |
--multiqc_title |
RNASEQ workflow |
Title shown in the MultiQC report |
--publish_dir_mode |
copy |
How results are published to outdir (copy / symlink / …) |
--help |
false |
Print help message and exit |
results/
├── fastqc_raw/ # FastQC quality reports on raw reads
├── fastp/ # Trimmed reads + fastp JSON/HTML reports
├── sortmerna/ # rRNA-depleted reads + SortMeRNA logs
├── star/ # Genome & transcriptome BAMs + STAR alignment logs
├── salmon/ # Transcript quantifications (quant.sf) per sample
└── multiqc/ # Aggregated MultiQC report
- FastQC: Andrews S. (2010). FastQC: A Quality Control Tool for High Throughput Sequence Data. https://www.bioinformatics.babraham.ac.uk/projects/fastqc/
- fastp: Chen S et al. (2018). fastp: an ultra-fast all-in-one FASTQ preprocessor. Bioinformatics, 34(17):i884–i890. https://doi.org/10.1093/bioinformatics/bty560
- SortMeRNA: Kopylova E, Noé L, Touzet H. (2012). SortMeRNA: fast and accurate filtering of ribosomal RNAs in metatranscriptomic data. Bioinformatics, 28(24):3211–3217. https://doi.org/10.1093/bioinformatics/bts611
- SILVA: Quast C et al. (2013). The SILVA ribosomal RNA gene database project: improved data processing and web-based tools. Nucleic Acids Research, 41(D1):D590–D596. https://doi.org/10.1093/nar/gks1219
- STAR: Dobin A et al. (2013). STAR: ultrafast universal RNA-seq aligner. Bioinformatics, 29(1):15–21. https://doi.org/10.1093/bioinformatics/bts635
- Salmon: Patro R et al. (2017). Salmon provides fast and bias-aware quantification of transcript expression. Nature Methods, 14:417–419. https://doi.org/10.1038/nmeth.4197
- SAMtools: Danecek P et al. (2021). Twelve years of SAMtools and BCFtools. GigaScience, 10(2):giab008. https://doi.org/10.1093/gigascience/giab008
- Qualimap 2: Okonechnikov K, Conesa A, García-Alcalde F. (2016). Qualimap 2: advanced multi-sample quality control for high-throughput sequencing data. Bioinformatics, 32(2):292–294. https://doi.org/10.1093/bioinformatics/btv566
- Ensembl: Harrison PW et al. (2024). Ensembl 2024. Nucleic Acids Research, 52(D1):D891–D899. https://doi.org/10.1093/nar/gkad1049
- MultiQC: Ewels P et al. (2016). MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics, 32(19):3047–3048. https://doi.org/10.1093/bioinformatics/btw354
- Nextflow: Di Tommaso P et al. (2017). Nextflow enables reproducible computational workflows. Nature Biotechnology, 35:316–319. https://doi.org/10.1038/nbt.3820