End-to-end ChIP-seq workflow from FASTQ to annotated peaks. Covers QC, alignment with Bowtie2, deduplication, peak calling with MACS3, ENCODE QC metrics (FRiP, NSC, RSC, library complexity), IDR or naive overlap for replicate concordance, and peak annotation with ChIPseeker. Handles both narrow peaks (transcription factors and sharp histone marks like H3K4me3) and broad peaks (H3K27me3, H3K9me3, H3K36me3). For CUT&RUN/CUT&Tag protocols use chip-seq/cut-and-run-tag instead. For experiments with expected global signal shifts (HDACi, BETi, EZH2i) add spike-in normalization per chip-seq/spike-in-normalization.
# CLI tools
conda install -c bioconda fastp bowtie2 samtools macs3 deeptools bedtools \
phantompeakqualtools idr
# R packages
BiocManager::install(c('ChIPseeker', 'TxDb.Hsapiens.UCSC.hg38.knownGene',
'org.Hs.eg.db', 'DiffBind', 'ChIPQC'))
Tell your AI agent what you want to do: - "Run the ChIP-seq pipeline on my IP and Input samples" - "Call narrow peaks for H3K4me3 from FASTQ with ENCODE QC" - "Call broad peaks for H3K27me3 with naive overlap across 3 replicates" - "Process my transcription factor ChIP-seq with IDR on biological replicates" - "Run the pipeline and apply Drosophila spike-in normalization for cross-condition comparison" - "Annotate peaks against ENCODE cCREs (PLS, pELS, dELS, CTCF-only)"
"I have ChIP-seq FASTQ files for 2 IP replicates and 2 input controls. Run fastp, Bowtie2, MarkDuplicates, then MACS3 narrow peaks with
-q 0.01, then ChIPseeker annotation.""Call broad peaks for my H3K27me3 ChIP-seq with
--broad --broad-cutoff 0.1and use naive overlap (>=40% reciprocal) across 3 replicates.""Run ChIP-seq analysis with mouse genome (mm10) and the deepTools effective genome size for 100bp reads."
"Run the full ENCODE QC battery (FRiP, NSC, RSC, NRF, PBC1, PBC2, plotFingerprint) and grade against thresholds before peak calling."
"Apply the ENCODE Nself/Nt consistency rule across true replicates and pseudoreplicates."
"Check for hyper-ChIPable artifacts by intersecting peaks against top-1% input signal regions."
"Annotate my peaks with nearby genes using ChIPseeker host-gene convention (overlap='all')."
"Cross-reference my peaks against ENCODE cCRE atlas via SCREEN BED and report cCRE class distribution."
"Compare peaks between treatment and control with DiffBind background-bin normalization."
"Which ENCODE blacklist do I use and when in the pipeline do I subtract it?"
"Why are my NRF/PBC values all ~1.0 - when should complexity be computed?"
"I ran a spike-in (ChIP-Rx) experiment - how do I make tracks without erasing the global shift?"
"Should I call peaks per replicate or pooled, and how does that affect IDR?"
| Input | Format | Description |
|---|---|---|
| IP FASTQ | .fastq.gz | ChIP samples (immunoprecipitated chromatin) |
| Input FASTQ | .fastq.gz | Input control (sonicated chromatin, same library prep batch) |
| Reference | FASTA + Bowtie2 index | Reference genome |
| Annotation | GTF | Custom annotation OR pre-built TxDb |
| Blacklist | BED | ENCODE blacklist v2 (Amemiya 2019) |
samtools view -F 1804 -q 30 filter for uniquely-mapped non-duplicate non-secondary reads-f BAMPE for paired-end, -g from deepTools effective-genome-size table, --keep-dup all since dedup applied upstream| Target | Mode | Why |
|---|---|---|
| Transcription factors (CTCF, p53, GATA1) | Narrow (default) | Sharp motif binding |
| H3K4me3, H3K27ac (at promoters/enhancers) | Narrow | Localized at regulatory elements |
| H3K4me1, H3K9ac | Narrow or broad depending on cell type | Variable; check published data |
| H3K27me3, H3K9me3, H3K36me3, H4K20me3 | --broad --broad-cutoff 0.1 |
Broad domains spanning 10-100 kb |
| RNA Pol II elongation | Broad option | Gene body coverage |
ENCODE-style replicate concordance differs by mark type. Use the matching method:
| Mark type | Method | Threshold |
|---|---|---|
| Transcription factors | IDR (Li 2011) | True reps IDR <= 0.05; pseudoreps IDR <= 0.10 |
| Sharp histone (H3K4me3, H3K27ac) | IDR or naive overlap | Same as TF or >=40% reciprocal |
| Broad histone (H3K27me3, H3K36me3) | Naive overlap | >=40% reciprocal, present in >=2 of N replicates |
Apply the ENCODE IDR consistency rules: the rescue ratio max(Np, Nt) / min(Np, Nt) (pooled-pseudoreplicate vs true-replicate peak counts) and the self-consistency ratio max(N1, N2) / min(N1, N2) must both be <= 2.
Standard reads-in-peaks normalization (DiffBind default) assumes most peaks are unchanged between conditions. For experiments where this assumption is violated, spike-in is required:
| Experimental design | Spike-in required? |
|---|---|
| HDAC inhibitor (global H3K27ac increase) | Yes; Drosophila ChIP-Rx |
| BET inhibitor (global BRD4 / H3K27ac decrease) | Yes |
| EZH2 inhibitor (global H3K27me3 loss) | Yes |
| Target factor knockdown / degron | Yes (or matched-input subtraction) |
| Standard TF perturbation, local rebinding | No |
For spike-in workflow, see chip-seq/spike-in-normalization.
samtools view -F 1804 -q 30 for uniquely-mapped non-duplicate non-secondary; do this AFTER MarkDuplicates and AFTER NRF/PBC computation.-g hs/mm shorthand: read-length-matched values are more accurate.-q only if other metrics are good-q too loose--shift not set with -f BAM; or aligner pre-applied shift (chromap)