Bulk ChIP-seq Workflow v2
Stepwise paired-end ChIP-seq alignment, deduplication, and coverage preparation
What it does
This workflow is a stepwise ChIP-seq alignment and processing guide adapted from Harvard Bioinformatics Core training materials. The committed README focuses on raw-read QC, trimming, Bowtie2 alignment, paired-read filtering, duplicate removal, alignment summaries, and BigWig generation for visualization.
When to use it
Use this workflow when you want a transparent, shell-oriented ChIP-seq preprocessing path instead of a Nextflow wrapper. It is most useful for paired-end ChIP-seq projects where you want to inspect each filtering step and produce clean BAM and BigWig files for downstream peak calling or visualization.
Prerequisites
- Source folder:
ChipSeq_general_workflow_v2 - Main documentation:
readme.md - Required tools:
FastQCTrimGalorebowtie2samtoolspicarddeeptools
- Expected inputs:
- paired-end FASTQ files arranged by sample
- a Bowtie2 reference index
Steps
Run initial FastQC, then trim adapters and recheck read quality
The workflow starts with FastQC on paired reads, then reruns QC after trimming adapters with TrimGalore.
read1=( *R1*.gz )
read2=( *R2*.gz )
core=[amount of cores to allocate for all steps]
fastqc -f fastq -o ${basename}_QC --threads $core $read1 $read2mkdir trimGalored
mkdir ${basename}.trim.fastQC
[directory containing TrimGalore]/TrimGalore-0.6.6/trim_galore \
--cores $core --paired --gzip -o trimGalored/ $read1 $read2 \
--fastqc_args "-f fastq -o ${basename}.trim.fastQC -t $core"The key idea in this opening stage is not just “trim reads,” but “compare QC before and after trimming” so adapter removal can be verified before alignment.
Align with Bowtie2 and restrict the data to properly paired reads
After trimming, the guide aligns with Bowtie2 in --very-sensitive mode, sorts/indexes the BAM, and then restricts downstream processing to properly paired reads.
tRead1=trimGalored/*R1*.gz
tRead2=trimGalored/*R2*.gz
bowtie2 --very-sensitive -p $core -x $bt2ref_mm10 -1 $tRead1 -2 $tRead2 2> ${basename}_bt2Metrics.txt | samtools view -@ $core -bS - > ${basename}.bam
samtools sort -@ $core -o ${basename}.s.bam ${basename}.bam
samtools index -@ $core ${basename}.s.bamsamtools view -@ $core -bh -f 3 ${basename}.s.bam > ${basename}.filt.bam
samtools sort -@ $core -o ${basename}.s.filt.bam ${basename}.filt.bam
samtools index -@ $core ${basename}.s.filt.bamRemove duplicates and capture alignment summaries before and after filtering
The next stage uses Picard to remove duplicates, then captures alignment summaries with samtools flagstat before producing coverage tracks.
java -jar $PICARD MarkDuplicates \
INPUT=${basename}.s.filt.bam \
OUTPUT=${basename}.rms.filt.bam \
METRICS_FILE=${basename}.PicardMetrics.txt \
REMOVE_DUPLICATES=truesamtools flagstat -@ $core ${basename}.s.bam > ${basename}_INI_mapped_count.txt
samtools flagstat -@ $core ${basename}.s.rms.filt.bam > ${basename}_FIN_mapped_count.txtThose paired flagstat outputs are the main checkpoint for understanding how much data survived the filtering and duplicate-removal stages.
Generate BigWig files for downstream visualization or peak review
The README ends with bamCoverage from deepTools to create normalized BigWig tracks for IGV or browser-style inspection.
bamCoverage -b ${basename}.s.rms.filt.bam -o ${basename}.bw --normalizeUsing RPKM -p maxThis branch is lighter than the nf-core ChIP-seq page because it focuses on preprocessing and visualization-ready files, not on consensus peaks or motif analysis.
Use MultiQC only after all samples finish the preprocessing chain
The README notes that multiqc becomes useful once multiple samples have completed the pipeline, so that alignment and processing statistics can be summarized across the whole batch rather than one sample at a time.
Gotchas / notes
- The committed guide is optimized for paired-end data; single-end use would need small changes.
- Peak calling itself is not the focus of this v2 page; the workflow is mainly about clean alignment, filtering, and coverage generation.
- The README assumes local variables like
$bt2ref_mm10and$basenameare already defined by the user. - Like several bulk branches, this folder is README-only and does not include committed figures or rendered notebook outputs.
- The guide assumes the required modules, conda environment, and reference variables are already prepared before the commands shown here are run.