A comprehensive, production-ready RNA-seq analysis pipeline featuring STAR alignment, RSEM quantification, and automated result merging. Designed for high-throughput processing with enhanced quality control and beautiful output formatting.
- π High-Performance Alignment: STAR aligner with optimized parameters
- 𧬠Dual Quantification: Both RSEM and featureCounts for comprehensive analysis
- π Quality Control: Extensive QC metrics and reporting
- π Batch Processing: Automated processing of multiple samples
- π Result Merging: Beautiful CSV outputs ready for downstream analysis
- π― Deduplication Support: Optional PCR duplicate removal
- π‘οΈ Error Handling: Robust error checking and recovery
- π± Progress Tracking: Real-time progress bars and status updates
graph LR
A[π₯ FASTQ Files] --> B[βοΈ Install Dependencies]
B --> C[π Index Genome]
C --> D[𧬠STAR Alignment]
D --> E[π RSEM Quantification]
E --> F[π Result Merging]
F --> G[π Final CSV Reports]
style A fill:#e1f5fe
style B fill:#fff3e0
style C fill:#f3e5f5
style D fill:#e8f5e8
style E fill:#fff9c4
style F fill:#fce4ec
style G fill:#e0f2f1
- OS: Linux or Windows Subsystem for Linux (WSL)
- RAM: Minimum 16GB (32GB+ recommended for large genomes)
- Storage: ~50GB for mouse genome indices, ~100GB for human
- CPU: Multi-core processor (8+ cores recommended)
- Conda/Miniconda: Package manager
- STAR: RNA-seq aligner
- RSEM: RNA-seq quantification
- Samtools: BAM file processing
- Python 3.9+: For result merging scripts
git clone https://github.com/arvinhm/RNAseqPipline.git
cd RNAseqPipline
chmod +x *.sh./install.shWhat this does:
- Creates conda environment
rnaseq - Installs STAR, RSEM, samtools, and QC tools
- Verifies all installations
# Example for mouse genome (GRCm39)
mkdir -p /path/to/genome
cd /path/to/genome
# Download genome FASTA
wget http://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_mouse/release_M37/GRCm39.genome.fa.gz
gunzip GRCm39.genome.fa.gz
# Download GTF annotation
wget http://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_mouse/release_M37/gencode.vM37.chr_patch_hapl_scaff.annotation.gtf.gz
gunzip gencode.vM37.chr_patch_hapl_scaff.annotation.gtf.gz# Edit paths in index_genome.sh first!
nano index_genome.sh # Update GENOME_DIR, GENOME_FASTA, GTF_FILE paths
# Run indexing (takes 30-60 minutes)
./index_genome.shOrganize your FASTQ files:
input_directory/
βββ sample1_R1_001.fastq.gz
βββ sample1_R2_001.fastq.gz
βββ sample2_R1_001.fastq.gz
βββ sample2_R2_001.fastq.gz
βββ ...
# Edit paths in run.sh first!
nano run.sh # Update input/output directories and index paths
# Activate conda environment
conda activate rnaseq
# Run the pipeline
./run.sh# Edit paths in results.py first!
nano results.py # Update results directory and GTF file paths
# Run result merger
python results.pyrnaseq-pipeline/
βββ π README.md # This file
βββ βοΈ install.sh # Install dependencies
βββ π index.sh # Create genome indices
βββ 𧬠run.sh # Main alignment pipeline
βββ π results.py # Merge results into CSV files
index_genome.sh:
GENOME_DIR="/path/to/your/genome"
GENOME_FASTA="$GENOME_DIR/genome.fa"
GTF_FILE="$GENOME_DIR/annotation.gtf"run.sh:
INPUT_DIR="/path/to/fastq/files"
OUTPUT_DIR="/path/to/results"
STAR_INDEX_DIR="/path/to/STAR_index"
RSEM_INDEX_PREFIX="/path/to/RSEM_index/prefix"results.py:
results_dir = "/path/to/results"
gtf_file_path = "/path/to/annotation.gtf"
output_dir = "/path/to/merged_results"sample_Aligned.sortedByCoord.out.bam- Aligned readssample_rsem.genes.results- Gene-level quantificationsample_rsem.isoforms.results- Isoform-level quantificationsample_featureCounts.txt- Alternative gene countssample_Log.final.out- Alignment statistics
1_merged_star_gene_counts.csv- π STAR gene counts matrix2_merged_rsem_gene_expected_counts.csv- 𧬠RSEM gene counts3_merged_rsem_isoform_expected_counts.csv- 𧬠RSEM isoform counts4_merged_rsem_isoform_percentages.csv- π Isoform percentage usage5_merged_rsem_gene_fpkm.csv- π Gene FPKM values6_merged_rsem_gene_tpm.csv- π Gene TPM valuesdiagnostic_sample_completeness.csv- π Quality diagnostic report
The pipeline supports PCR duplicate removal:
# During run.sh execution, choose option 1 when prompted:
# "Do you want to perform deduplication? (1/2): 1"Adjust thread counts in run.sh:
STAR_THREADS=24 # STAR alignment threads
RSEM_THREADS=24 # RSEM quantification threads
BAM_SORT_RAM=64 # RAM for BAM sorting (GB)Configure strand-specific protocols:
STRAND_SPECIFICITY="unstranded" # Options: unstranded, forward, reverse- Alignment Statistics: Mapping rates, multi-mappers, unmapped reads
- Quantification Metrics: Gene detection rates, isoform diversity
- Sample Completeness: Cross-sample data quality assessment
- Deduplication Reports: PCR duplicate rates (if enabled)
qc_reports/
βββ sample1/
β βββ sample1_star.log
β βββ sample1_rsem.log
β βββ sample1_flagstat.txt
β βββ sample1_bamstats.txt
βββ ...
"No samples found" Error:
# Ensure FASTQ files follow naming convention:
*_R1_001.fastq.gz and *_R2_001.fastq.gzMemory Issues:
# Reduce memory usage in index_genome.sh:
MAX_RAM=8000000000 # 8GB instead of 15GBPermission Denied:
# Make scripts executable:
chmod +x *.shConda Environment Issues:
# Reset environment:
conda remove -n rnaseq --all
./install.sh| Genome | Samples | Time | RAM Usage | Storage |
|---|---|---|---|---|
| Mouse (GRCm39) | 10 | ~4 hours | 32GB | ~200GB |
| Human (GRCh38) | 10 | ~8 hours | 64GB | ~400GB |
| Arabidopsis | 10 | ~1 hour | 16GB | ~50GB |
Benchmarks on 24-core system with NVMe storage
- STAR: Alexander Dobin et al. - RNA-STAR aligner
- RSEM: Bo Li and Colin Dewey - RSEM quantification
- GENCODE: Genome annotation consortium
- Community: RNA-seq analysis community for best practices
- nf-core/rnaseq - Nextflow RNA-seq pipeline
- STAR - Original STAR aligner
- RSEM - Original RSEM quantifier
β If this pipeline helped your research, please give it a star! β
Made with β€οΈ for the community