← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / OpenAI4S / skills / bioskills / bio-atac-seq-atac-peak-calling / references / usage-guide.md

ATAC-seq Peak Calling - Usage Guide

Overview

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.

Prerequisites

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.

Quick Start

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"

Example Prompts

ENCODE 4 Pipeline

"Run the ENCODE 4 ATAC-seq peak-calling pipeline: per-replicate MACS2 with -p 0.01, then pseudoreplicate split + IDR with --idr-threshold 0.10 for self-consistency, and IDR <= 0.05 for true replicates. Apply ENCODE Nself <= 2 rule to flag failing libraries."

Joint Replicate Calling with Genrich

"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)."

HMM-based Calling

"Run macs3 hmmratac on a 50M-read ATAC library to produce open / nucleosomal / background calls and verify fragment-size periodicity is strong enough first."

NFR-only for Footprinting

"Filter the BAM to fragments < 100 bp and call peaks with --shift -37 --extsize 75 to produce a footprinting-ready peak set."

Single-Sample (No Replicate)

"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."

Effective Genome Size

"Look up the deepTools effectiveGenomeSize for hg38 at our 100 bp read length and use that as -g instead of the MACS shorthand."

What the Agent Will Do

  1. Verify upstream BAM is deduplicated, MAPQ-filtered, and chrM-stripped
  2. Choose caller based on depth, replicate count, and downstream use (footprinting vs differential vs domain-level)
  3. Pick -f BAM (with --shift/--extsize) for ENCODE-style or -f BAMPE (no shift) for fragment-aware mode
  4. Set effective genome size from deepTools table, not the legacy -g hs/mm shorthand
  5. Per-replicate, pooled, and pseudoreplicate peak calls if running ENCODE pipeline
  6. Run IDR on true replicates (threshold 0.05) and pseudoreplicates (threshold 0.10)
  7. Apply ENCODE Nt/Nself <= 2 self-consistency rule
  8. Filter ENCODE blacklist and optionally a sample-derived greylist
  9. Produce narrowPeak + bigWig signal track outputs

Caller Decision Quick Reference

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

Effective Genome Size Quick Reference

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.

ENCODE Self-Consistency Rule

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.

Tips