Call accessible chromatin regions from ATAC-seq BAM files. Covers MACS2/MACS3 (ENCODE default), Genrich (joint replicates), MACS3 hmmratac (HMM-based), and downstream IDR for reproducible peak sets. Adapts ENCODE 4 ATAC-seq pipeline conventions for shift-extend modeling, pseudoreplicate consistency, and blacklist/greylist filtering.
conda install -c bioconda macs3 macs2 genrich samtools bedtools idr
# HMMRATAC is now bundled in MACS3 as `macs3 hmmratac` (since MACS 3.0.0)
# Blacklist files
wget https://github.com/Boyle-Lab/Blacklist/raw/master/lists/hg38-blacklist.v2.bed.gz
gunzip hg38-blacklist.v2.bed.gz
Inputs assumed deduplicated and chrM-removed. See alignment-files/duplicate-handling and read-alignment/bowtie2-alignment for the upstream alignment + filtering steps.
Tell your AI agent what you want to do: - "Call ATAC-seq peaks following the ENCODE 4 pipeline with IDR across replicates" - "Use Genrich joint mode to call peaks across two replicates and exclude chrM" - "Run HMMRATAC on a deep ATAC library to get NFR + flanking nucleosome calls" - "Call peaks on nucleosome-free fragments only for footprinting input" - "Reproduce peaks from a published dataset using the same effective genome size as deepTools"
"Run the ENCODE 4 ATAC-seq peak-calling pipeline: per-replicate MACS2 with
-p 0.01, then pseudoreplicate split + IDR with--idr-threshold 0.10for self-consistency, and IDR<= 0.05for true replicates. Apply ENCODE Nself <= 2 rule to flag failing libraries."
"Call ATAC peaks jointly across three replicates with Genrich, removing chrM (
-e chrM), filtering ENCODE blacklist (-E hg38-blacklist.v2.bed), and removing PCR duplicates inside Genrich (-r)."
"Run
macs3 hmmratacon a 50M-read ATAC library to produce open / nucleosomal / background calls and verify fragment-size periodicity is strong enough first."
"Filter the BAM to fragments < 100 bp and call peaks with
--shift -37 --extsize 75to produce a footprinting-ready peak set."
"Call peaks on a single ATAC sample with
-q 0.05(tighter than ENCODE) since IDR is not applicable, then filter against the ENCODE blacklist."
"Look up the deepTools effectiveGenomeSize for hg38 at our 100 bp read length and use that as
-ginstead of the MACS shorthand."
-f BAM (with --shift/--extsize) for ENCODE-style or -f BAMPE (no shift) for fragment-aware mode-g hs/mm shorthand| Situation | Caller |
|---|---|
| 2-3 replicates, depth >= 25M | MACS2 ENCODE pipeline + IDR |
| 1 sample, no replicates | MACS3 callpeak -q 0.05 (no IDR) |
| Want NFR + flanking nucleosomes | MACS3 hmmratac |
| Joint multi-rep with built-in chrM/blacklist | Genrich -j -e chrM -E blacklist |
| Broad super-enhancer regions | MACS3 --broad --broad-cutoff 0.1 |
| FFPE / degraded chromatin | MACS3 callpeak (avoid HMM) |
| scATAC pseudobulk | MACS3 per cluster, see single-cell-atac |
| Plant / non-model | MACS3 with empirically computed -g |
| Genome | 50 bp reads | 75 bp reads | 100 bp reads |
|---|---|---|---|
| hg38 | 2.701e9 | 2.748e9 | 2.806e9 |
| hg19 | 2.686e9 | 2.736e9 | 2.777e9 |
| mm10 | 2.308e9 | 2.408e9 | 2.467e9 |
| mm39 | 2.310e9 | 2.410e9 | 2.468e9 |
Source: deepTools effectiveGenomeSize documentation. Effective size increases with read length because longer reads map uniquely to more of the genome.
Library passes if max(Nt, Nself) / min(Nt, Nself) <= 2 where:
- Nt = peaks passing IDR <= 0.05 on true replicate pair
- Nself = peaks passing IDR <= 0.10 on pseudoreplicate pair (single rep split in half)
Both ratios > 2 means the library is rejected per ENCODE 4 standards.
-p 0.01 (loose, for IDR), not -q 0.05. Tighten only if NOT running IDR.-f BAMPE silently ignores --shift/--extsize. To use shift modeling, use -f BAM and treat ends as single reads.--keep-dup all is mandatory for ATAC: Tn5 generates legitimate duplicate cuts at hyperaccessible sites.samtools view -h sample.bam | grep -v "chrM"); chrM accumulates ATAC reads at >50% of total in poor preps.--broad --broad-cutoff 0.1. But do not run IDR on broad peaks.--rank p.value (column 8 of narrowPeak); --rank signal.value is unreliable when MACS pileup scaling differs.-r is used; doing both is double-removing.