bio-atac-seq-differential-accessibility
Version Compatibility
Reference examples tested with: DiffBind 3.12+, DESeq2 1.42+, edgeR 4.0+, csaw 1.36+, limma 3.58+, GenomicRanges 1.54+, ChIPseeker 1.38+, Subread 2.0+ (featureCounts), sva 3.50+, RUVSeq 1.36+.
Before using code patterns, verify installed versions match:
- R:
packageVersion('<pkg>')then?function_nameto verify parameters
If code throws unexpected errors, introspect the installed package and adapt rather than retrying.
Differential Accessibility
"Find chromatin regions that change accessibility between my conditions" -> Build a sample-by-region count matrix, normalize for library size and chromatin compaction, fit a generalized linear model (negative-binomial), and extract regions with significant accessibility change.
- R (consensus-peak workflow):
DiffBind-> count -> normalize -> contrast -> analyze - R (window-based, no peak set):
csaw::windowCounts+filterWindowsGlobal+ edgeR QL F-test - R (existing peak-count matrix):
DESeq2oredgeRdirectly onfeatureCountsoutput
DiffBind is a wrapper around DESeq2 / edgeR with ATAC-aware defaults. csaw is the only peak-free option; it tests fixed-width sliding windows. The choice depends on whether peaks are stable across conditions (use DiffBind) or whether some condition has dramatically different peak structure (use csaw or rebuild consensus peaks).