Modular, scalable Nextflow DSL2 workflows orchestrating quality control, read trimming, splice-aware genomic alignment, transcript assembly, and pseudoalignment for paired-end bulk RNA sequencing cohorts of arbitrary size.
[ Paired-End FASTQ Reads ]
│
┌────────────────┴────────────────┐
▼ ▼
[ FastQC: Raw ] [ Trim Galore ]
│
┌─────────────────────────────────┴────────────────────────┐
▼ ▼
[ Track 1: Alignment-Based ] [ Track 2: Alignment-Free ]
│ │
▼ ▼
[ HISAT2: Alignment ] [ Kallisto: Quant ]
│ │
▼ ▼
[ Sorted, Indexed BAMs ] [ abundance.h5/tsv ]
│ │
▼ ▼
[ StringTie: Assembly ] [ tximport in R ]
│ │
└─────────────────────────────────┬────────────────────────┘
│
▼
[ Dual-Track Reconciliation ]
.
├── workflows/
│ ├── step1_fastqc.nf # Raw sequence QC with FastQC & MultiQC
│ ├── step2_trimgalore.nf # Automated adapter & quality trimming with TrimGalore
│ ├── step3_hisat2_pilot.nf # Small-cohort verification pilot alignment
│ ├── step3_hisat2_prod.nf # Full cohort splice-aware alignment (HISAT2 + Samtools)
│ ├── step3_hisat2_prod_fast.nf # High-throughput optimized alignment pipeline
│ ├── step4_stringtie.nf # Transcript quantification with StringTie (Track 1)
│ └── step5b_kallisto.nf # Pseudoalignment & quantification with Kallisto (Track 2)
├── configs/
│ ├── nextflow.config # Default container execution configuration
│ ├── pilot_nextflow.config # Resource allocation for pilot verification
│ ├── prod_nextflow.config # Standard production resource configuration
│ ├── prod_fast_nextflow.config # Performance-tuned multi-threaded configuration
│ ├── stringtie_nextflow.config # Container & CPU bindings for StringTie
│ └── kallisto_nextflow.config # Memory & thread allocation for Kallisto
├── runners/
│ ├── run_prod_cmd1.sh # Production HISAT2 alignment wrapper
│ ├── run_prod_fast_handoff.sh # Fast HISAT2 alignment wrapper
│ ├── run_step4_cmd1.sh # StringTie directory initialization
│ ├── run_step4_cmd2.sh # StringTie execution wrapper
│ ├── run_step4_rebuild_and_run.sh # StringTie container build and pipeline launch
│ ├── run_track2_cmd1.sh # Kallisto index generator & container build
│ └── run_track2_cmd2.sh # Kallisto pseudoalignment execution wrapper
└── samplesheets_templates/
├── samplesheet_fastq_template.csv # 4-sample synthetic FASTQ manifest template
└── samplesheet_bam_template.csv # 4-sample synthetic BAM manifest template
sample_id,cohort,condition,strandedness,fastq_1,fastq_2
SAMPLE_01,Cohort_A,Case,RF,./data/trimmed/SAMPLE_01_R1.fq.gz,./data/trimmed/SAMPLE_01_R2.fq.gz
SAMPLE_02,Cohort_A,Control,RF,./data/trimmed/SAMPLE_02_R1.fq.gz,./data/trimmed/SAMPLE_02_R2.fq.gz
SAMPLE_03,Cohort_B,Case,unstranded,./data/trimmed/SAMPLE_03_R1.fq.gz,./data/trimmed/SAMPLE_03_R2.fq.gz
SAMPLE_04,Cohort_B,Control,unstranded,./data/trimmed/SAMPLE_04_R1.fq.gz,./data/trimmed/SAMPLE_04_R2.fq.gzsample_id,cohort,condition,strandedness,bam,bai
SAMPLE_01,Cohort_A,Case,RF,./results/alignment/SAMPLE_01.sorted.bam,./results/alignment/SAMPLE_01.sorted.bam.bai
SAMPLE_02,Cohort_A,Control,RF,./results/alignment/SAMPLE_02.sorted.bam,./results/alignment/SAMPLE_02.sorted.bam.bai
SAMPLE_03,Cohort_B,Case,unstranded,./results/alignment/SAMPLE_03.sorted.bam,./results/alignment/SAMPLE_03.sorted.bam.bai
SAMPLE_04,Cohort_B,Control,unstranded,./results/alignment/SAMPLE_04.sorted.bam,./results/alignment/SAMPLE_04.sorted.bam.bainextflow run workflows/step1_fastqc.nf \
-c configs/nextflow.config \
--samplesheet "samplesheets_templates/samplesheet_fastq_template.csv" \
--outdir "./results/01_fastqc"nextflow run workflows/step2_trimgalore.nf \
-c configs/nextflow.config \
--samplesheet "samplesheets_templates/samplesheet_fastq_template.csv" \
--outdir "./results/02_trimmed"nextflow run workflows/step3_hisat2_prod.nf \
-c configs/prod_nextflow.config \
--samplesheet "samplesheets_templates/samplesheet_fastq_template.csv" \
--hisat2_index "/path/to/hisat2_index/genome_tran" \
--outdir "./results/03_alignment"nextflow run workflows/step4_stringtie.nf \
-c configs/stringtie_nextflow.config \
--samplesheet "samplesheets_templates/samplesheet_bam_template.csv" \
--gtf "/path/to/annotation.gtf" \
--outdir "./results/04_stringtie"nextflow run workflows/step5b_kallisto.nf \
-c configs/kallisto_nextflow.config \
--samplesheet "samplesheets_templates/samplesheet_fastq_template.csv" \
--index "/path/to/kallisto.idx" \
--outdir "./results/05_kallisto"