A shell-driven RNA-seq analysis pipeline for transcriptome analysis and downstream visualization.
RNAseqFlow is a shell- and R-based workflow for paired-end bulk RNA-seq data. It covers upstream read alignment and transcript quantification, followed by downstream differential expression analysis, enrichment analysis, PCA, optional batch correction, volcano plots, and heatmap visualization.
The current example configuration is designed for zebrafish transcriptome data, but the workflow can be adapted to other organisms by updating the reference genome, annotation files, enrichment mapping files, and configuration parameters.
The full workflow is controlled by:
scripts/Shell/run.sh
The pipeline contains three main parts:
-
Upstream processing
HISAT2 index building, read alignment, BAM processing, RSeQC gene body coverage assessment, StringTie quantification, and count matrix generation usingprepDE.py3. -
Counts-based downstream analysis
Differential expression analysis, volcano plot generation, GO/KEGG enrichment analysis, and GO/KEGG result visualization. -
FPKM-based downstream analysis
FPKM matrix preprocessing, optional ComBat batch correction, PCA analysis, and heatmap visualization.
Workflow diagram:
- End-to-end paired-end RNA-seq workflow from FASTQ files to downstream plots.
- Modular shell scripts for alignment, quantification, and downstream analysis.
- R-based DEG analysis, enrichment analysis, PCA, volcano plots, and heatmaps.
- Centralized configuration for paths, thresholds, contrasts, and plotting options.
Required command-line tools:
- Bash
- HISAT2
- Samtools
- RSeQC
- StringTie
- Python 3
- R
Required R packages include DESeq2, sva, clusterProfiler, org.Dr.eg.db,
org.Hs.eg.db, ggplot2, ggrepel, pheatmap, ggnewscale, tidytext,
data.table, readr, readxl, dplyr, tibble, and related dependencies.
Please check the library() calls in each script under scripts/R/ and install any missing packages before running the workflow.
git clone https://github.com/your_name/rnaseq_pipeline.git
cd rnaseq_pipelinePrepare paired-end FASTQ files and update the sample sheet:
rawdata/samples.tsv
Prepare sample metadata:
rawdata/metadata.csv
The sample IDs in samples.tsv must match the run_id column in metadata.csv.
All major paths and parameters are defined in:
config/configuration.txt
Before running the workflow, update the raw data paths, reference genome files, annotation files, DEG contrasts, enrichment settings, and plotting options.
For detailed parameter descriptions, see:
config/README.md
Run the full workflow from the repository root:
bash scripts/Shell/run.shThe three workflow modules can also be run separately or in combination:
# Upstream alignment, quantification, counts, and merged FPKM generation
bash scripts/Shell/run.sh upstream
# DESeq2, volcano plots, and GO/KEGG analysis
bash scripts/Shell/run.sh counts
# FPKM preprocessing, ComBat, PCA, and heatmaps
bash scripts/Shell/run.sh fpkm
# Run selected downstream modules together
bash scripts/Shell/run.sh counts fpkmThe main output directories include:
bam/
log/
geneBody_QC/
stringtie/
counts/
fpkm_out/
samples.tsv should be tab-separated and contain three columns:
sample fq1 fq2
SRR001 /path/to/SRR001_1.fastq.gz /path/to/SRR001_2.fastq.gz
metadata.csv should contain run_id as the first column. The run_id values must match the sample column in samples.tsv.
The current workflow expects the following metadata fields:
| Column | Used by |
|---|---|
run_id |
Sample matching across all downstream modules |
SampleID |
RSeQC plot labels; run_id is used as a fallback |
Group |
Default DEG design and PCA color mapping |
Time |
DEG filtering in the example configuration and PCA shapes |
Treat |
Heatmap sample grouping |
Batch |
ComBat batch correction when DO_COMBAT=1 |
Any column referenced by a DEG_CONTRASTS filter or design must also exist in
metadata.csv.
Example:
run_id,SampleID,Group,Time,Treat,Batch,Health
SRR16972426,WT_3M_1,WT,3M,WT_3M,B01,healthy
Example input files are provided under:
rawdata/
At the current stage, this directory contains example metadata, sample sheet, gene module definitions, and annotation mapping files required by the workflow. Large raw FASTQ files and reference genome files are not included in this repository.
The example dataset is being prepared based on the publicly available RNA-seq dataset associated with the following study:
Differential roles of the fish chitinous membrane in gut barrier immunity and digestive compartments
BioProject: PRJNA798186
The example data are intended for pipeline validation and demonstration only, not for biological interpretation.
| Directory | Description |
|---|---|
bam/ |
Alignment files and processed BAM files |
log/ |
Log files from shell scripts and command-line tools |
geneBody_QC/ |
RSeQC gene body coverage results |
stringtie/ |
StringTie reference-guided transcript quantification outputs |
counts/ |
Count matrices, DEG results, volcano plots, and GO/KEGG enrichment results |
fpkm_out/ |
FPKM matrices, batch-corrected matrices, PCA plots, and heatmaps |
Typical downstream outputs include DEG tables, upregulated and downregulated gene lists, volcano plots, GO/KEGG enrichment tables, enrichment plots, PCA plots, and heatmaps.
If you use this pipeline in your work, please cite the software tools used by the workflow, including HISAT2, Samtools, RSeQC, StringTie, DESeq2, and related R packages.
If the example dataset is used, please also cite the original publication associated with BioProject PRJNA798186.
For questions, bug reports, or feature requests, please open an issue on GitHub.
Planned future improvements:
- Add a public example dataset and representative results
- Improve input/output directory organization
- Add automated report generation
- Support parallelized workflow execution
- Improve configuration validation before running the full workflow
