Compute the seven canonical ATAC-seq QC metrics (depth, alignment rate, mitochondrial fraction, library complexity, fragment-size periodicity, TSS enrichment, FRiP) and grade each against ENCODE 4 acceptance thresholds. Diagnose specific failure modes (over-transposition, library bottlenecking, chromatin degradation, batch effects) and decide which replicates to drop before peak calling.
conda install -c bioconda samtools picard deeptools multiqc bedtools
pip install pysam pyBigWig numpy pandas matplotlib
BiocManager::install(c('ATACseqQC', 'TxDb.Hsapiens.UCSC.hg38.knownGene', 'BSgenome.Hsapiens.UCSC.hg38'))
ENCODE blacklist (Amemiya 2019), GENCODE TSS BED (matched to genome build) required for TSS enrichment.
Tell your AI agent what you want to do: - "Score every ENCODE 4 ATAC QC metric and flag PASS/WARN/FAIL" - "Compute TSS enrichment using the ENCODE pyTSSe formula, not ATACseqQC's" - "Diagnose why fragment-size distribution is flat -- over-transposition vs degraded chromatin" - "Calculate NRF, PBC1, and PBC2 from the raw mapped BAM (pre-dedup)" - "Run plotFingerprint and compare fingerprint QC metrics across replicates (the plain JS distance column needs a --JSDsample reference)"
"Run a full ENCODE 4 ATAC-seq QC audit on three replicates: nuclear read depth, alignment rate, mt fraction, NRF/PBC1/PBC2, TSS enrichment (ENCODE method), FRiP using MACS peaks, and fragment-size periodicity. Flag any metric that fails ENCODE thresholds and recommend drop/keep per replicate."
"My ATACseqQC TSSEscore is 21 but my collaborator says ENCODE wants >= 7. Compute the ENCODE pyTSSe-style score so we can compare apples to apples."
"Insert-size distribution shows one broad peak with no nucleosome periodicity. Diagnose the likely cause (over-transposition, degraded chromatin, MNase contamination) and tell me whether the library is salvageable."
"NRF is 0.65 and PBC2 is 0.8. Confirm bottlenecking vs legitimate ATAC duplicates at hyperaccessible sites by checking pile-up coverage at top peaks."
"Pearson correlation between rep2 and rep3 is 0.78 (others are 0.94). Run PCA on peak counts and check whether rep2 and rep3 cluster together by batch -- if so, plan to add batch as a covariate downstream."
"Compare my TSS enrichment to a published study; we both used hg38 but different TSS sources. Recompute on the same GENCODE v29 protein-coding TSS file for parity."
samtools flagstat and samtools idxstats for alignment summary and chrM countmultiBamSummary| Metric | Ideal | Acceptable | Reject |
|---|---|---|---|
| Nuclear reads (post-dedup, no chrM) | >= 50M | 25-50M | < 25M |
| Alignment rate | >= 95% | 80-95% | < 80% |
| Mt fraction (Omni-ATAC) | < 5% | < 20% | > 50% |
| NRF | >= 0.9 | 0.7-0.9 | < 0.7 |
| PBC1 | >= 0.9 | 0.7-0.9 | < 0.7 |
| PBC2 | >= 3.0 | 1.0-3.0 | < 1.0 |
| TSS enrichment (ENCODE) | >= 7 | 5-7 | < 5 |
| FRiP | >= 0.3 | 0.2-0.3 | < 0.2 |
| Pattern | Diagnosis |
|---|---|
| NFR + mono + di + tri visible | Excellent |
| NFR + mono only, di faint | Acceptable (Omni-ATAC) |
| Single broad peak, no NFR | Over-transposition; reject |
| Mono >> NFR | Under-transposition; caution |
| Sharp 147 bp spike, no flanks | MNase-like; reject |
| 10.4 bp helical sub-peaks visible | High-quality structural resolution |
--skipZeros is mandatory for ATAC; otherwise empty regions dominate the correlation.