Module 7: Hands-On Somatic Pipeline Execution: FastQC, BWA-MEM & Picard Deduplication
1. The Galaxy Open-Source Computing Platform
While bioinformaticians frequently deploy custom Nextflow or Snakemake pipelines on HPC clusters, clinical molecular pathologists and geneticists require verifiable, reproducible, and accessible interfaces. Galaxy is a leading open-source scientific computing framework that enables researchers to run production-grade command-line tools without writing code, guaranteeing complete parameter reproducibility and data provenance.
2. Step 1: Quality Trimming with fastp
Raw paired-end FASTQ reads (R1.fastq.gz and R2.fastq.gz) contain synthetic sequencing adapter sequences and low-quality base calls at the 3' ends. The tool fastp performs integrated adapter trimming, quality filtering, and poly-G tail removal in a single ultra-fast pass:
Galaxy Parameter Configuration for fastp:
- Input 1: Case1_Lung_R1.fastq.gz
- Input 2: Case1_Lung_R2.fastq.gz
- Quality filtering: Enabled (Cut front and tail by sliding window, mean Q >= 20)
- Length filtering: Drop reads shorter than 35 bp
- Output: Cleaned R1, Cleaned R2, and HTML Quality Report3. Step 2: Read Alignment with BWA-MEM
Cleaned reads must be mapped against the reference human genome (GRCh38). BWA-MEM uses the Burrows-Wheeler Transform (BWT) and Ferragina-Manzini (FM) index to align 150-bp reads with high sensitivity and split-read chimeric support:
Galaxy Parameter Configuration for Map with BWA-MEM:
- Reference Genome: Human Decoy GRCh38 (hg38)
- Paired-end reads: Cleaned fastp R1 and R2
- Read Group Configuration (CRITICAL for GATK):
- Read Group Identifier (ID): Case1_Tumor_RG
- Sample Name (SM): Case1_Tumor
- Sequencing Platform (PL): ILLUMINA
- Library ID (LB): Nextera_CGP_v2
- Output: Coordinate-Sorted BAM dataset4. Step 3: Optical & PCR Duplicate Marking with Picard MarkDuplicates
During library preparation, PCR amplification generates identical copies of original DNA fragments (PCR duplicates). Additionally, single clusters on Illumina patterned flowcells can optically split into adjacent wells (optical duplicates). If not removed, duplicate reads falsely inflate depth and skew VAF calculations:
Galaxy Parameter Configuration for Picard MarkDuplicates:
- Input BAM: BWA-MEM Sorted Alignment
- Remove Duplicates: False (Flag duplicates with SAM flag 1024, do not delete)
- Assume Sorted: True
- Output: Marked BAM + Duplication Metrics FileReview the generated Duplication Metrics table. Clinical FFPE libraries typically display duplicate rates between 10% and 25%. A duplicate rate > 50% indicates severe library under-complexity.
Common Pitfalls & Troubleshooting Checklist
- Java Heap Exhaustion (GATK / Picard): If processes terminate with
java.lang.OutOfMemoryError, set your environment variable explicitly:export _JAVA_OPTIONS="-Xmx16g -Djava.io.tmpdir=/tmp". - Index Timestamp Mismatch: If tools complain that a BAM index is missing or out of date, regenerate with
samtools index -@ 4 sample.bam. - Conda Channel Conflicts: Avoid ABI incompatibilities between bioconda and conda-forge by setting strict priority:
conda config --set channel_priority strict. - Chromosome Naming Contamination: Always verify whether reference FASTA headers use
chr1or1; divergent naming causes silent alignment drops.