Exercise: Motifs, motif enrichment and TF footprinting
Goal
After this exercise you will be able to:
- Compute the expected number of chance motif matches, and fill in and test a 2×2 motif enrichment table (odds ratio, Fisher / hypergeometric test), by hand and in R.
- Correct for testing hundreds of motifs (Bonferroni, Benjamini–Hochberg) and explain why the background and GC content matter.
- Find the motifs enriched in B-cell- and T-cell-specific ATAC-seq peaks with JASPAR 2024 and motifmatchr.
- Compute and read chromVAR deviation z-scores across 13 blood cell types with chromVAR.
- Align ATAC-seq reads, turn them into Tn5 insertion sites, and plot an aggregate CTCF footprint at bound and unbound motif sites.
Background
Motif matches. A position weight matrix (PWM, from Gene regulation) gives each window of DNA a log-odds score; a window is a match when its score would be reached by chance with probability below a threshold \(p\) (motifmatchr uses \(p < 5 \times 10^{-5}\)). A region of length \(L\) has about \(2L\) windows (both strands), so it contains on average \(2Lp\) chance matches.
Enrichment. For a target set of peaks (for example B-up) and a background set (here the ns peaks, which are not differential by the course thresholds):
| with match | without | |
|---|---|---|
| target | \(a\) | \(b\) |
| background | \(c\) | \(d\) |
Odds ratio \(\mathrm{OR} = ad / bc\). Under the null, the target is a random draw of \(a + b\) peaks from all \(N = a + b + c + d\) peaks, of which \(K = a + c\) have a match; the expected number in the target is \((a+b)K/N\). The one-sided p-value is the hypergeometric upper tail \(P(X \ge a)\), which equals the one-sided Fisher’s exact test.
Multiple testing. With \(m\) motifs, Bonferroni rejects when \(p < 0.05/m\). Benjamini–Hochberg (BH): sort the p-values, find the largest \(i\) with \(p_{(i)} \le 0.05\, i/m\), and reject the \(i\) smallest.
chromVAR computes, for each motif and sample, the fraction of reads in peaks with the motif, compares it with the expected fraction (all samples pooled), and standardises it against background peak sets matched for GC content and average accessibility: a deviation z-score. Variability is the standard deviation of a motif’s z-scores across samples.
Footprints. Each read end marks one Tn5 insertion: in BED coordinates, read start + 4 on the + strand and read end − 5 on the − strand. With 1-based closed R coordinates, use start + 4 and end − 4. Averaging insertions around many motif sites, oriented by motif strand, gives an aggregate footprint: a dip where the bound protein blocks Tn5, flanked by high insertion rates in the open DNA next to it.
Data
- Saved differential peaks:
~/epi/diffacc/differential_peaks.tsv, written in R11 of Differential accessibility. ItsB_up,T_upandnsclasses use adjusted \(p < 0.05\) and absolute apeglm-shrunken log2 fold change > 1. We reuse these classes and compare each differential group withns. - Corces et al. 2016 haematopoiesis ATAC-seq (GEO GSE74912): read counts in 590 650 fixed 500-bp peaks (hg19) for 132 samples. The 77 samples from healthy donors cover 13 cell types; the sample names encode donor and cell type (decoded below from the GEO sample table). The same file as in Differential accessibility, with the UCSC hg19 → hg38 chain file; these are used for chromVAR in R6. Motif enrichment in R1–R5 uses the saved differential-peak table.
- hg38 genome as a bgzip-compressed, indexed FASTA (
hg38.fa.bgz,.fai,.gzi), so R can read any region quickly. - GM12878 ATAC-seq, ENCODE ENCSR095QNB replicate 1, paired-end 2 × 101: the 6.1 million read pairs that ENCODE aligned to chr21 or chrM, as raw FASTQ, and a bowtie2 index of chr21 + chrM. Plus the ENCODE GM12878 ATAC peaks and CTCF ChIP-seq peaks (from Genomic intervals).
data/download.sh motifs-footprinting # about 2 GB, mostly the hg38 genome and the reads
D=/path/to/course/data # where download.sh put the files
mkdir -p ~/epi/motifs && cd ~/epi/motifs
# only if your data folder has hg38.fa.gz but not hg38.fa.bgz:
# zcat $D/hg38.fa.gz | bgzip -@ 4 > $D/hg38.fa.bgz && samtools faidx $D/hg38.fa.bgzShortcuts, said plainly. The footprint uses one chromosome (chr21) of one replicate: aggregate footprints work at this depth, single-site footprints do not. chromVAR uses the 100 000 most-read peaks rather than all 589 000, and sums technical replicates per donor. Motif enrichment is done in R with motifmatchr; HOMER and the MEME suite, the usual command-line tools, are shown in the lecture and under Where this leads but not installed in this course.
You need fastp, bowtie2 and samtools (≥ 1.10) on the command line, and the R packages listed in Install the software you need, including JASPAR2024, TFBSTools, motifmatchr, chromVAR and universalmotif. Total running time on a laptop with 4–8 cores: about 25 minutes, most of it alignment and motif matching. Complete Differential accessibility first and keep its saved table; we do not rerun DESeq2 here.
By hand
Do these on paper.
B1. Chance matches. You scan 300-bp peaks with a motif at threshold \(p = 10^{-4}\).
How many windows does one peak have (both strands, ignore the ends)? How many chance matches do you expect per peak?
In 50 000 peaks, how many chance matches do you expect in total?
Chance matches are rare events, so the number per peak is roughly Poisson. What fraction of peaks has at least one chance match? (\(P(\ge 1) = 1 - e^{-\lambda}\).)
A paper reports “a GATA motif in 25% of our peaks”. What do you need to know before this means anything?
B2. A 2×2 table. 400 target peaks, 120 with a match to motif M. 9600 background peaks, 1440 with a match.
Write the 2×2 table and the fraction with a match in each group.
Compute the odds ratio.
How many target peaks would you expect to have a match if the target were a random draw from all 10 000 peaks? Is the observation higher or lower?
In the real data, an EBF1 match is in 2728 of 19 404 B-up peaks and in 22 271 of 175 523 ns peaks; \(p \approx 4.5 \times 10^{-8}\). Compute the two fractions and the odds ratio. Is EBF1 “the TF that drives B-cell chromatin”? What else would you look at?
B3. Many motifs. You test 800 motifs. The eight smallest p-values are
\(1\times10^{-40}\), \(3\times10^{-12}\), \(2\times10^{-6}\), \(4\times10^{-5}\), \(9\times10^{-5}\), \(1.5\times10^{-4}\), \(2.5\times10^{-4}\), \(6\times10^{-4}\).
What is the Bonferroni threshold at 5%, and how many of these motifs pass?
Apply Benjamini–Hochberg at FDR 5%. How many pass?
If none of the 800 motifs were truly enriched, how many would you expect below \(p = 0.05\)?
The top 30 motifs include 12 ETS motifs (ELF1, ELF3, ETV1, GABPA, …). How many independent findings is that?
B4. Background and GC. Your target peaks are promoters (mean GC 0.62). You compare them with (i) random 500-bp windows of the genome (mean GC 0.41) and (ii) GC-matched peaks from the same cells.
With background (i), which kinds of motifs will look enriched only because of base composition? Give an example.
Why does the comparison with (ii) answer a more useful question?
In the real B-up peaks (mean GC 0.48, ns peaks 0.51), the SP1 motif has OR 0.58 against ns and 0.95 against GC-matched ns peaks. Which number would you report, and what do you conclude about SP1?
B5. One motif, many TFs. In B-up peaks the three most enriched motifs are SPIB (OR 2.95), SPI1 (PU.1, OR 2.64) and SPIC (OR 2.85).
Can you tell from these numbers which of the three TFs binds the B-cell peaks? Why not?
Name two kinds of data that would help.
In T-up peaks, ETS1 has OR 2.66 but SPI1 only 1.33. How can two ETS motifs behave so differently? (Hint: look at the logos in the lecture.)
B6. Read a chromVAR heatmap. Part of a deviation z-score table (mean over donors):
| motif | HSC | MEP | Mono | B | CD4 T |
|---|---|---|---|---|---|
| GATA1::TAL1 | 1 | 66 | −22 | −21 | −24 |
| SPI1 | 3 | −15 | 22 | 21 | −12 |
| CEBPA | −1 | −5 | 25 | −4 | −5 |
| TCF7 | −5 | −2 | −5 | 0 | 13 |
For each motif, name the cell types where peaks with the motif are more accessible than expected.
What does a z-score of −22 for GATA1::TAL1 in monocytes mean? Does it mean GATA1 represses those peaks in monocytes?
chromVAR reports a motif named “GATA3” with almost the same z-scores as GATA1::TAL1, highest in MEPs and erythroblasts, although GATA3 is a T-cell factor. Explain.
Why does chromVAR compare with background peaks of matched GC content and accessibility instead of just using the raw deviation?
B7. Read an aggregate footprint. Mean Tn5 insertions per site around 1000 CTCF motif sites inside CTCF ChIP peaks: about 0.70 at ±30–60 bp from the motif centre, 0.25 within ±10 bp of the centre, and 0.30 at ±100 bp.
Sketch the profile. Which features are the flanks and which is the footprint?
Compute the ratio centre/flank. What would it be for a motif without any protection?
For 5000 CTCF motif sites in closed chromatin the profile is flat at 0.01. Why flat, and why so low?
A colleague finds no footprint for the glucocorticoid receptor at its ChIP-seq peaks and concludes that it does not bind there. What is wrong with this conclusion?
An aggregate footprint of motif X shows a sharp 3-bp dip at the same position in cells with and without the TF. What is the likely explanation, and how would you correct for it?
B8. Judge the claim. “Peaks gained after stimulation are enriched for AP-1 motifs (p < 10⁻¹⁰⁰ against random genomic regions), so AP-1 opens these regions.” List three problems or missing controls.
On the command line
C1 — Trim and align the GM12878 ATAC-seq reads
This is the pipeline of ATAC-seq processing and peak calling, run on the chr21 + chrM subset. It keeps properly paired fragments with MAPQ ≥ 30 and removes duplicates.
fastp -i $D/gm12878_atac_rep1_R1.fastq.gz -I $D/gm12878_atac_rep1_R2.fastq.gz \
-o R1.trim.fq.gz -O R2.trim.fq.gz --detect_adapter_for_pe -w 4 -j fastp.json -h fastp.html
bowtie2 -p 4 -X 2000 --very-sensitive -x $D/bowtie2/hg38_chr21_chrM \
-1 R1.trim.fq.gz -2 R2.trim.fq.gz 2> bowtie2.log \
| samtools fixmate -m -u - - \
| samtools view -u -f 2 -q 30 - \
| samtools sort -u - \
| samtools markdup -r -s - gm12878_atac_rep1.bam 2> markdup.log
samtools index gm12878_atac_rep1.bam
tail -1 bowtie2.log
samtools idxstats gm12878_atac_rep1.bamWhat fraction of the read pairs aligned? How many reads are left on chr21 and on chrM after filtering?
What fraction of the filtered reads is on chrM? Why is it so high in ATAC-seq, and why does it not matter for footprinting on chr21?
markdup.logreports the duplicates removed. Why are duplicates a particular problem when you count insertions at single bases?
Explore: a 2×2 motif table, the threshold and the background
The demo simulates 1000 target peaks and 8000 other peaks of 300 bp (random bases at each peak’s GC content). A PU.1-like motif is planted in a fraction of the target peaks (and in 5% of the other peaks, because bound sites occur there too). A GC box (SP1-like) is planted nowhere. Both motifs are scanned on both strands; a peak has a match when its best window passes the threshold, given as a p-value per window (motifmatchr’s default is \(5 \times 10^{-5}\)). Target GC − background GC makes the target peaks GC-richer (or AT-richer) than the others. Background compares the target with all other peaks or with a GC-matched set (two other peaks from the same 1%-GC bin per target peak; R5 applies the same matching idea to ns peaks using 2%-GC bins). Panel (a) shows the two 2×2 tables with the odds ratio and the exact one-sided Fisher / hypergeometric p-value (computed on the log scale, as in R4), and whether it passes Bonferroni for 879 motifs. Panel (b) shows GC content, panel (c) the odds ratio against the threshold.
E1. At the defaults, read the PU.1 table. Compute the two fractions and the odds ratio by hand, and the number of target matches expected if the target were a random draw from all 9000 peaks. Compare with the demo.
E2. Move the threshold from \(10^{-3}\) to \(10^{-6}\) (watch the note under the controls and panel c). How do the number of PU.1 matches in the target, the odds ratio and the p-value change? Why is neither the most lenient nor the strictest threshold best?
E3. The GC box is not bound anywhere. What odds ratio and p-value does it get against all other peaks? Would it survive Bonferroni for 879 motifs? Switch to the GC-matched background: what happens to the GC box, and to PU.1? Then set the GC difference to 0 and to +0.12 (the data are re-simulated when you release the slider).
E4. Set target peaks with a PU.1 site to 0%. Why is the PU.1 odds ratio now below 1? Finally: a correction for multiple testing would not have stopped the GC box in E3. Why not, and what else in this demo is a hidden multiple-testing problem?
E1. \(a = 136\), \(b = 864\), \(c = 456\), \(d = 7544\): 13.6% of target peaks against 5.7% of the other peaks have a match. \(\mathrm{OR} = (136 \cdot 7544)/(864 \cdot 456) = 2.60\). Expected under the null: \(1000 \times (136 + 456)/9000 = 66\), observed 136, \(p = 9.3 \times 10^{-18}\). Note that the fraction of bound target peaks is 25%, but only 13.6% have a match: half of the planted sites score below the threshold, and some matches in the target are chance matches (about 3% of peaks have one at this threshold: 0.029 per peak).
E2. At \(10^{-3}\): 538 target matches (54% against 48%), OR 1.24, \(p \approx 10^{-3.2}\): almost every second peak has a chance match, and the real sites drown in them. At \(10^{-4}\): 177, OR 2.23, \(p \approx 10^{-15.8}\); at \(5 \times 10^{-5}\): 136, OR 2.60, \(p \approx 10^{-17.0}\); at \(10^{-5}\): 76, OR 3.88, \(p \approx 10^{-17.3}\); at \(10^{-6}\): 22, OR 3.2, \(p \approx 10^{-4.6}\). A stricter threshold removes chance matches faster than true sites, so the odds ratio rises, but it also loses true sites (weak matches), and with few counts the estimate becomes noisy and the p-value weak. The threshold trades counts (sensitivity) against specificity.
E3. Against all other peaks the GC box has OR 2.24 (4.1% vs 1.9%), \(p = 2.2 \times 10^{-5}\): it passes Bonferroni (\(p < 5.7 \times 10^{-5}\)). It is enriched only because the target peaks are GC-richer (mean GC 0.52 vs 0.44), and a GC-rich word matches more often by chance in GC-rich DNA. Against GC-matched peaks: OR 0.99, \(p = 0.56\). PU.1 hardly changes (OR 2.60 → 2.63), because its enrichment is real. With no GC difference the GC box gets OR 1.12 against all peaks; at +0.12 it gets OR 4.55, \(p \approx 4 \times 10^{-22}\), and 1.23 against GC-matched peaks. The background decides the question you ask; in the real data (lecture, R5) the same effect works in the other direction, because B-up peaks are AT-richer than the ns peaks.
E4. With no bound target peaks, PU.1 has OR 0.49 (2.9% vs 5.7%): the background still contains 5% of peaks with a bound site, so the target is depleted relative to it. “Depleted” means “less than in the background”, not “avoided”. Multiple-testing corrections control errors made by chance; the GC box is a bias that gets more significant with more data. Only a better background (or a GC-aware test) removes it. The hidden multiple testing: trying several thresholds or backgrounds and reporting the one that gives the best p-value.
In R
Start R in ~/epi/motifs (where the BAM file is) and load the packages:
suppressPackageStartupMessages({
library(SummarizedExperiment); library(rtracklayer); library(GenomicRanges); library(Rsamtools)
library(GenomicAlignments); library(Biostrings); library(Matrix)
library(JASPAR2024); library(TFBSTools); library(motifmatchr); library(chromVAR)
library(universalmotif); library(BiocParallel); library(ggplot2); library(pheatmap)
})
register(MulticoreParam(4)) # on Windows: register(SerialParam())
D <- "/path/to/course/data"
genome <- FaFile(file.path(D, "hg38.fa.bgz"))
set.seed(1)R1 — Reuse the saved differential peaks
Read the table written in R11 of Differential accessibility. Set diff_file to that file if you used another working folder. Coordinates are already GRCh38, 1-based closed: do not add 1 to the start. The saved class column preserves the paired DESeq2 analysis and its apeglm-shrunken fold-change threshold.
diff_file <- path.expand("~/epi/diffacc/differential_peaks.tsv")
tab <- read.delim(diff_file, check.names = FALSE)
stopifnot(!anyDuplicated(tab$peak_id), all(tab$class %in% c("B_up", "T_up", "ns")))
tested <- GRanges(tab$chr, IRanges(tab$start, tab$end))
names(tested) <- tab$peak_id
tested$lfc <- tab$log2FoldChange; tested$padj <- tab$padj
tested$class <- tab$class
stopifnot(all(width(tested) == 500))
b_up <- tested$class == "B_up"
t_up <- tested$class == "T_up"
ns <- tested$class == "ns"
c(tested = length(tested), B_up = sum(b_up), T_up = sum(t_up), ns = sum(ns))How many peaks were tested, and how many belong to each class? Check that the counts agree with the saved table from Differential accessibility.
Why reuse the
classcolumn instead of applying the cutoff to the unshrunk maximum-likelihood fold changes? Doesnsprove that a peak is unchanged?
R2 — JASPAR motifs
jdb <- RSQLite::dbConnect(RSQLite::SQLite(), db(JASPAR2024()))
pfms <- getMatrixSet(jdb, opts = list(collection = "CORE", tax_group = "vertebrates",
all_versions = FALSE))
names(pfms) <- paste(name(pfms), ID(pfms), sep = "_")
length(pfms)
fam <- sapply(pfms, function(p) paste(tags(p)$family, collapse = "; "))
head(sort(table(fam), decreasing = TRUE), 8)
TFBSTools::Matrix(pfms[["CTCF_MA0139.2"]])
view_motifs(convert_motifs(pfms[c("Spi1_MA0080.7", "SPIB_MA0081.3", "ETS1_MA0098.4")]))How many motifs are there? Which TF families have the most motifs?
The CTCF matrix is a table of counts. How many binding sites was it built from? (Sum a column.)
Look at the three ETS logos. What do they share, and where do they differ?
R3 — Motif matches in all tested peaks
system.time(hit <- motifMatches(matchMotifs(pfms, tested, genome = genome, p.cutoff = 5e-5)))
dim(hit)
summary(colMeans(hit))
sort(colMeans(hit), decreasing = TRUE)[1:5]What is the median fraction of peaks that match a motif? Compare with your answer to B1 for a 500-bp peak at \(p = 5 \times 10^{-5}\).
Which motifs match the most peaks? Why might short or low-information motifs match far more peaks than the median?
R4 — Enrichment in B-up and T-up peaks
Compare B-up with ns, and T-up with the same ns background. The opposite differential group is excluded from each comparison. First one motif with fisher.test, then all motifs at once with the hypergeometric distribution (identical to one-sided Fisher, but vectorised and on the log scale, so that p-values below \(10^{-308}\) do not become 0):
selected <- b_up | ns
tab <- table(B_up = b_up[selected], SPIB = hit[selected, "SPIB_MA0081.3"])
tab
fisher.test(tab, alternative = "greater")
enrich <- function(target, hit, bg) {
stopifnot(!any(target & bg))
a <- colSums(hit[target, , drop = FALSE]); b <- sum(target) - a
c <- colSums(hit[bg, , drop = FALSE]); d <- sum(bg) - c
lp <- phyper(a - 1, a + c, b + d, a + b, lower.tail = FALSE, log.p = TRUE) / log(10)
data.frame(tf = sub("_MA.*", "", colnames(hit)), family = fam[colnames(hit)],
frac_target = a / (a + b), frac_bg = c / (c + d), OR = (a * d) / (b * c),
log10p = lp, padj = p.adjust(10^lp, "BH"))
}
eB <- enrich(b_up, hit, bg = ns); eT <- enrich(t_up, hit, bg = ns)
head(eB[order(eB$log10p), -2], 15)
head(eT[order(eT$log10p), -2], 15)
c(B = sum(eB$padj < 0.05 & eB$OR > 1), T = sum(eT$padj < 0.05 & eT$OR > 1))
sel <- c("EBF1_MA0154.5", "PAX5_MA0014.4", "PAX2_MA0067.3", "POU2F2_MA0507.3", "Runx1_MA0002.3",
"TCF7_MA0769.3", "Gata3_MA0037.5", "ETS1_MA0098.4", "Spi1_MA0080.7", "CTCF_MA0139.2")
round(cbind(B = eB[sel, c("OR", "log10p")], T = eT[sel, c("OR", "log10p")]), 2)From
tab, compute the odds ratio by hand and compare withfisher.test. Why doesfisher.testreport \(p < 2.2 \times 10^{-16}\) whileenrich()gives \(10^{-966}\)?Which TF families dominate the top of each list? Do they match what you know about B and T cells?
How many motifs are significant at FDR 5%? Is that a useful number?
Look at EBF1, PAX5 and PAX2 in B-up peaks. What do you conclude about the B-cell master regulators EBF1 and PAX5, and about the PAX5 matrix?
CTCF has OR < 1 in both lists. Explain.
R5 — A GC-matched background
gc <- as.numeric(letterFrequency(getSeq(genome, tested), "GC") / 500)
tapply(gc, tested$class, mean)
bin <- cut(gc, seq(0, 1, 0.02), include.lowest = TRUE)
pool <- split(which(ns), bin[ns])
set.seed(1)
gcm <- unlist(lapply(split(which(b_up), bin[b_up]), function(i) {
p <- pool[[as.character(bin[i[1]])]]
n <- min(length(p), length(i))
if (n == 0) integer(0) else p[sample.int(length(p), n)]
}))
c(background_peaks = length(gcm), mean_gc = mean(gc[gcm]))
eB_gc <- enrich(b_up, hit, bg = seq_along(tested) %in% gcm)
sel2 <- c("SPIB_MA0081.3", "EBF1_MA0154.5", "SP1_MA0079.5", "KLF4_MA0039.5", "Nrf1_MA0506.3",
"CTCF_MA0139.2")
data.frame(OR_ns = eB[sel2, "OR"], OR_gc = eB_gc[sel2, "OR"], row.names = sel2)Are B-up peaks more or less GC-rich than the
nspeaks? How many background peaks were sampled?Which motifs change most when the background is GC-matched, and in which direction? Explain using (a). The matching samples without replacement from
nsin each 2%-GC bin. If a bin has too fewnspeaks, it contributes fewer partners, so the background may be smaller than the target. Why is it useful to report its size and GC distribution?
R6 — chromVAR across 13 cell types
chromVAR needs the count matrix across all healthy donors and cell types, rather than the differential-peak table alone. Load and lift that matrix here, preserving the same coordinate filters as Differential accessibility. This prepares counts for chromVAR without fitting another differential model.
cnt <- read.delim(file.path(D, "corces2016_atac_counts.txt.gz"), check.names = FALSE)
peaks19 <- GRanges(cnt$Chr, IRanges(cnt$Start + 1, cnt$End)) # BED-like 0-based starts
cnt <- as.matrix(cnt[, -(1:3)])
# sample names -> donor and cell type (codes from the GEO sample table, GSE74912)
code <- c("1" = "HSC", "2" = "MPP", "3" = "LMPP", "4" = "CMP", "5" = "GMP", "6" = "MEP",
"7" = "Mono", "9" = "CD4", "10" = "CD8", "11" = "NK", "13" = "B", "14" = "CLP",
"15" = "Ery")
nm <- colnames(cnt)
ok <- grepl("^(Donor)?[0-9]{4}-", nm) # healthy donors only
info <- data.frame(sample = nm[ok],
donor = sub("^(Donor)?([0-9]{4})-.*", "\\2", nm[ok]),
celltype = code[sub(".*-([0-9]{1,2})[A-C]?(-[0-9]{6})?$", "\\1", nm[ok])])
# lift to hg38; keep peaks that map in one piece of 500 bp
chain <- tempfile(fileext = ".chain")
writeLines(readLines(file.path(D, "hg19ToHg38.over.chain.gz")), chain)
lo <- liftOver(peaks19, import.chain(chain))
keep <- which(lengths(lo) == 1)
peaks <- unlist(lo[keep])
ok <- width(peaks) == 500 & as.character(seqnames(peaks)) == as.character(seqnames(peaks19)[keep])
keep <- keep[ok]; peaks <- peaks[ok]
cnt <- cnt[keep, info$sample]
table(info$celltype)
length(peaks)
grp <- paste(info$celltype, info$donor, sep = "_") # one column per donor x cell type
cm <- sapply(split(info$sample, grp), function(s) rowSums(cnt[, s, drop = FALSE]))
top <- order(rowSums(cm), decreasing = TRUE)[1:100000] # the 100 000 most-read peaks
se <- SummarizedExperiment(assays = list(counts = cm[top, ]), rowRanges = peaks[top],
colData = DataFrame(celltype = sub("_.*", "", colnames(cm))))
se <- addGCBias(se, genome = genome)
mm <- matchMotifs(pfms, se, genome = genome, p.cutoff = 5e-5)
bg <- getBackgroundPeaks(se, niterations = 50)
system.time(dev <- computeDeviations(se, annotations = mm, background_peaks = bg))
z <- deviationScores(dev)
dim(z)
v <- computeVariability(dev)
head(v[order(-v$variability), c("name", "variability")], 15)
show <- c("GATA1::TAL1_MA0140.3", "Gata3_MA0037.5", "KLF1_MA0493.3", "CEBPA_MA0102.5",
"Spi1_MA0080.7", "EBF1_MA0154.5", "TCF3_MA0522.4", "POU2F2_MA0507.3", "Runx1_MA0002.3",
"TCF7_MA0769.3", "TBX21_MA0690.3", "CTCF_MA0139.2")
ord <- c("HSC", "MPP", "LMPP", "CMP", "GMP", "MEP", "Ery", "Mono", "CLP", "B", "CD4", "CD8", "NK")
zm <- sapply(ord, function(ct) rowMeans(z[show, dev$celltype == ct, drop = FALSE]))
round(zm)
pheatmap(pmax(pmin(zm, 15), -15), cluster_cols = FALSE,
color = colorRampPalette(c("#2a6f97", "white", "#c0392b"))(101))How many healthy libraries, donor × cell-type samples and cell types are there? How many peaks pass the liftOver filters? Which motifs are the most variable?
Read the table
zm: in which cell types is each motif most accessible? Do they fit the known regulators of each lineage (GATA1 and KLF1 for erythroid cells, C/EBPα for myeloid cells, PU.1, EBF1 and E2A (TCF3) for B cells, RUNX, TCF7 and T-bet (TBX21) for T and NK cells)?Compare GATA1::TAL1 and Gata3. What does this tell you about naming a TF from a chromVAR result?
Some highly variable motifs have names like FIGLA, ASCL1 or TBR1, factors not expressed in blood. Look at their family in
famand suggest which blood TF they stand for.
R7 — Tn5 insertions and a CTCF footprint
The offsets below use 1-based closed coordinates, as in BRGenomics ATAC-seq import.
ga <- readGAlignments("gm12878_atac_rep1.bam",
param = ScanBamParam(which = GRanges("chr21", IRanges(1, 46709983))))
# GRanges is 1-based closed: the BED end - 5 base is end(ga) - 4 in R.
ins <- GRanges("chr21", IRanges(ifelse(strand(ga) == "+", start(ga) + 4, end(ga) - 4), width = 1),
seqinfo = Seqinfo("chr21", 46709983))
length(ins)
cov_ins <- coverage(ins)$chr21 # insertions per base along chr21 (an Rle)
ctcf_pk <- import(file.path(D, "gm12878_ctcf_peaks.bed.gz"), format = "narrowPeak")
atac_pk <- import(file.path(D, "gm12878_atac_peaks.bed.gz"), format = "narrowPeak")
chr21 <- GRanges("chr21", IRanges(1, 46709983))
sites <- matchMotifs(pfms[["CTCF_MA0139.2"]], chr21, genome = genome,
out = "positions", p.cutoff = 1e-4)[[1]]
sites <- sites[!overlapsAny(sites, import(file.path(D, "hg38_blacklist.bed.gz")))]
grp <- ifelse(overlapsAny(sites, ctcf_pk), "bound (ChIP peak)",
ifelse(overlapsAny(sites, atac_pk), "open, no ChIP peak", "closed, no ChIP peak"))
table(grp)
mean(overlapsAny(ctcf_pk[seqnames(ctcf_pk) == "chr21"], sites)) # ChIP peaks with a motif
profile <- function(s) { # mean insertions, motif-oriented
w <- promoters(resize(s, 1, fix = "center"), upstream = 100, downstream = 101)
x <- as.matrix(Views(cov_ins, ranges(w)))
minus <- as.logical(strand(w) == "-")
x[minus, ] <- x[minus, ncol(x):1]
colMeans(x)
}
fp <- data.frame(pos = rep(-100:100, 3), grp = rep(sort(unique(grp)), each = 201),
ins = unlist(lapply(sort(unique(grp)), function(g) profile(sites[grp == g]))))
ggplot(fp, aes(pos, ins, colour = grp)) + geom_line() +
labs(x = "bp from CTCF motif centre", y = "Tn5 insertions per site")
b <- fp[fp$grp == "bound (ChIP peak)", ]
c(flank = mean(b$ins[abs(b$pos) >= 30 & abs(b$pos) <= 60]),
centre = mean(b$ins[abs(b$pos) <= 10]), far = mean(b$ins[abs(b$pos) >= 90]))How many insertions are there on chr21? How many CTCF motif sites, and what fraction of them lies in a CTCF ChIP peak? What fraction of the chr21 ChIP peaks contains a motif site?
Describe the three profiles. Compute centre/flank for the bound sites (compare with B7).
Why are the “open, no ChIP peak” sites so much lower than the bound sites, although they are in ATAC peaks?
Replace
upstream = 100, downstream = 101by a window that is not strand-aware (resize(s, 201, fix = "center")and no flipping). What happens to the profile, and why?
R8 — Tn5 sequence preference
set.seed(2)
k <- sample(length(ga), 200000)
st <- as.character(strand(ga))[k]
pos <- ifelse(st == "+", start(ga)[k] + 4, end(ga)[k] - 4)
win <- GRanges("chr21", IRanges(pos - 10, pos + 10), strand = st)
freq <- consensusMatrix(getSeq(genome, win), as.prob = TRUE)[c("A", "C", "G", "T"), ]
colnames(freq) <- -10:10
round(freq, 2)chr21 is about 41% GC. At which positions near the insertion is the base composition clearly not random?
Why does this matter for footprints of a motif whose sequence is the same at every site?
Hints
Windows per peak ≈ \(2L\); expected matches \(\lambda = 2Lp\); \(P(\ge 1) = 1 - e^{-\lambda}\). Odds ratio \(ad/bc\); expected target matches \((a+b)(a+c)/N\). R: fisher.test, phyper with lower.tail = FALSE gives \(P(X > q)\), so use \(q = a - 1\) for \(P(X \ge a)\). matchMotifs returns a sparse peaks × motifs matrix via motifMatches().
Bonferroni: \(p < \alpha / m\). BH: compare \(p_{(i)}\) with \(\alpha\, i / m\) and find the largest \(i\) that passes; all smaller p-values pass too. R: p.adjust.
JASPAR 2024 (paper: Rauluseviciute et al. 2024); in R the JASPAR2024 package with TFBSTools::getMatrixSet. The family and class of each matrix are in tags(pfm). universalmotif::view_motifs draws and aligns logos. Other collections: CIS-BP, HOCOMOCO.
The chromVAR vignette explains addGCBias, getBackgroundPeaks, computeDeviations, deviationScores (z) and computeVariability; method in Schep et al. 2017. A negative z means the motif’s peaks are less accessible than expected in that sample, relative to matched background peaks; it says nothing about the mechanism.
readGAlignments reads the BAM; start()/end() are the leftmost/rightmost aligned base, so the 5’ end of a − strand read is its end(). coverage of 1-bp ranges counts insertions per base; indexing an Rle with a GRanges and as.matrix gives one row per window. promoters builds strand-aware windows. Residence time and footprints: Sung et al. 2014; bias correction: TOBIAS (Bentsen et al. 2020).
fastp detects and trims the Nextera adapters; bowtie2 -X 2000 allows fragments up to 2 kb; samtools fixmate -m adds the mate tags that samtools markdup needs; samtools idxstats gives reads per chromosome.
Solutions
B1. (a) About \(2 \times 300 = 600\) windows; \(\lambda = 600 \times 10^{-4} = 0.06\) chance matches per peak. (b) \(50\,000 \times 0.06 = 3000\). (c) \(1 - e^{-0.06} = 0.058\): about 6% of peaks contain a chance match. (d) What fraction of peaks would contain a GATA match by chance (the GATA motif is short, so at a lenient threshold this can be 10–20%), the match threshold and peak width, and above all a comparison with a background set of peaks. “25%” alone is not evidence of anything.
B2. (a)
| with match | without | fraction | |
|---|---|---|---|
| target | 120 | 280 | 30% |
| background | 1440 | 8160 | 15% |
- \(\mathrm{OR} = (120 \times 8160)/(280 \times 1440) = 979\,200 / 403\,200 = 2.43\). (c) \(400 \times 1560 / 10\,000 = 62.4\) expected; 120 observed, about twice as many. (d) \(2728 / 19\,404 = 14.1\%\) vs \(22\,271 / 175\,523 = 12.7\%\); \(\mathrm{OR} = (2728 \times 153\,252)/(16\,676 \times 22\,271) = 1.13\). Highly significant because the sets are large, but a weak effect: on this evidence EBF1 is not a major distinguishing motif. Before concluding, check a GC-matched background (EBF1’s motif is GC-rich and B-up peaks are AT-rich; with GC matching the OR rises to about 1.44, R5), the quality of the matrix, EBF1 expression, EBF1 ChIP-seq, and chromVAR (R6: the EBF1 motif is most accessible in lymphoid progenitors). EBF1 is in fact a B-cell master regulator; motif enrichment just measures it poorly here.
B3. (a) \(0.05 / 800 = 6.25 \times 10^{-5}\): four motifs pass (\(10^{-40}\), \(3 \times 10^{-12}\), \(2 \times 10^{-6}\), \(4 \times 10^{-5}\)). (b) BH thresholds \(0.05\,i/800 = 6.25 \times 10^{-5}\, i\): \(6.25 \times 10^{-5}\), \(1.25 \times 10^{-4}\), \(1.9 \times 10^{-4}\), \(2.5 \times 10^{-4}\), \(3.1 \times 10^{-4}\), \(3.75 \times 10^{-4}\), \(4.4 \times 10^{-4}\), \(5 \times 10^{-4}\). The 7th p-value (\(2.5 \times 10^{-4} \le 4.4 \times 10^{-4}\)) passes, the 8th (\(6 \times 10^{-4} > 5 \times 10^{-4}\)) does not: 7 motifs. (c) \(800 \times 0.05 = 40\). (d) Essentially one: all ETS motifs share the GGAA core, so they are 12 correlated tests of one signal (perhaps two, if PU.1-type and ETS1-type sites separate).
B4. (a) GC-rich and CpG-containing motifs: SP/KLF (GGGCGG), NRF1, E2F, ETS motifs typical of promoters (GABPA), CTCF. They are enriched in promoters against AT-rich random DNA because of composition and because promoters are open, not because they explain anything specific. (b) GC-matched peaks are also open chromatin with the same base composition, so a motif that remains enriched is more frequent in the target than composition and openness alone predict. (c) Report the GC-matched OR of 0.95 alongside the ns-background OR of 0.58, naming both backgrounds. The apparent strong depletion largely disappears after matching GC: the B-up peaks are AT-richer (distal elements) than the ns background, which contains many GC-rich promoters. Neither result establishes whether SP1 binds or drives accessibility.
B5. (a) No. SPIB, PU.1 and SPIC have nearly identical motifs (one family, one DNA-binding domain); the small differences in OR reflect the matrices, not which protein binds. (b) Expression (RNA-seq of B and T cells: PU.1 and SPIB are expressed in B cells; SPIC mainly in red-pulp macrophages), ChIP-seq or CUT&RUN for each candidate, and perturbation (knock-out or degradation followed by ATAC-seq). (c) The ETS core GGAA is shared, but the flanks differ: PU.1/SPIB prefer an A-rich 5’ flank (AAAGAGGAAGT), ETS1/GABPA prefer CCGGAAGT. T-cell-specific peaks contain ETS1-type sites, B-cell-specific peaks PU.1-type sites, and each matrix detects mostly its own subtype.
B6. (a) GATA1::TAL1: MEPs (and erythroblasts); SPI1: monocytes and B cells; CEBPA: monocytes; TCF7: CD4 T cells. (b) In monocytes, reads in peaks with a GATA motif are much less frequent than expected from the average sample and from matched background peaks: those peaks are relatively closed. It says nothing about repression: most likely no GATA factor is active in monocytes, and the peaks are open only in other cell types. (c) GATA1 and GATA3 bind the same WGATAR motif. chromVAR measures the motif, not the protein; in erythroid cells the GATA-motif peaks are open because of GATA1, whatever name the matrix carries. (d) Samples differ technically (GC bias of the library, fraction of reads in peaks); these shift all peaks with a given GC content or accessibility, motif or not. Background peaks matched on these properties move the same way, so the z-score keeps only the motif-specific part.
B7. (a) Two flanking maxima (≈ 0.7 at ±30–60 bp), a dip over the motif (≈ 0.25, the footprint), lower values further out (≈ 0.3 at ±100 bp). (b) \(0.25 / 0.70 \approx 0.36\). Without protection about 1 (a flat profile, apart from sequence bias). (c) Closed chromatin is inaccessible to Tn5 along the whole window, so there are almost no insertions (0.01 per base per site) and nothing to protect. No open region, no flanks, no dip. (d) The glucocorticoid receptor has a short residence time (about 10 s): it binds and leaves many times during tagmentation, so Tn5 mostly finds the site free. No footprint even though ChIP shows binding (Sung et al. 2014). (e) Tn5 sequence bias at the motif sequence: it is present whether or not the TF is there. Correct with a bias model (TOBIAS ATACorrect, chromBPNet), compare with naked-DNA Tn5 data, or compare bound with unbound sites of the same motif.
B8. (1) The background: random genomic regions are closed and AT-rich, so any set of open regions is enriched for the motifs of open chromatin; AP-1 is the classic motif of active enhancers. Compare with peaks that did not change (GC-matched). (2) The p-value: with thousands of peaks any small difference is significant; report the odds ratio and the fractions. (3) Causality and identity: enrichment is a correlation; the AP-1 family (FOS, JUN, ATF, BATF, …) has many members; to show that AP-1 opens the regions, measure binding (ChIP/CUT&RUN for the stimulated factor) and perturb it (inhibitor, knock-out) to see whether the peaks fail to open. chromVAR or footprinting changes are supportive, not proof.
C1. (a) 5 993 179 read pairs passed fastp; 99.65% aligned (94.5% concordantly once, 4.4% more than once). The rate is so high because the reads were selected as those ENCODE aligned to chr21 or chrM: a real full library would give a lower number, with reads from all chromosomes. After filtering (proper pairs, MAPQ ≥ 30) and duplicate removal: 504 974 reads on chr21 and 2 125 212 on chrM. (b) \(2\,125\,212 / 2\,630\,186 = 81\%\) of the filtered reads are mitochondrial. Mitochondrial DNA is not packed in nucleosomes, and a cell has hundreds of copies, so Tn5 cuts it eagerly (see ATAC-seq). Our subset exaggerates it (only chr21 of the nuclear genome is kept), but 20–50% chrM is common in full ATAC libraries. It does not matter here because we only look at insertions on chr21; it does waste sequencing depth. (c) markdup removed 8 720 088 of 11 350 274 reads (77%), most of them on the tiny chrM, where so many fragments share both ends by chance. On chr21, a PCR duplicate would count the same insertion twice: at single-base resolution this adds spikes that look like signal, so footprinting always uses deduplicated reads.
R1. (a) 211 824 tested peaks: 19 404 B_up, 16 897 T_up and 175 523 ns, exactly as saved in Differential accessibility. (b) The class column retains that analysis’s apeglm-shrunken effect sizes and adjusted-p threshold. Reapplying the cutoff to MLE fold changes would admit some borderline peaks and change the target sets. The ns class includes nonsignificant peaks and peaks below the effect-size threshold; it is not evidence that every ns peak is unchanged.
R2. (a) 879 motifs. The largest families are zinc-finger proteins with more than 3 adjacent fingers (124), HOX (49), NK homeodomain (40), paired-related homeodomain (39), FOX (33), dispersed zinc fingers (32), Tal-related bHLH (32) and ETS (28). (b) Each column sums to 903: the matrix was built from 903 aligned sites. (c) All three have the GGAA core. PU.1 and SPIB add an A-rich 5’ flank (AAAGAGGAAGT), ETS1 prefers CC before the core (ACCGGAAGT).
R3. The matching takes about 3 minutes. (a) Median 6.4% of peaks (range 0.4–65%), close to the 5% expected by chance for a 500-bp peak at \(p = 5 \times 10^{-5}\) (\(2 \times 500 \times 5 \times 10^{-5} = 0.05\)). Most motifs are present in a few percent of peaks, real sites and chance matches together. (b) MEIS1 (65%), SP5 (55%), IKZF2 (53%), FIGLA and ZEB1 (41%). These are short matrices with little information (MEIS1: TGACAG; IKZF: GGGAA; E-box: CAGCTG). A short matrix has few distinct scores, so the score cut-off that corresponds to \(p < 5 \times 10^{-5}\) cannot be set precisely, and many windows reach it. Treat enrichment results for such motifs with extra care.
R4. (a) \(\mathrm{OR} = (8227 \times 140\,448)/(11\,177 \times 35\,075) = 2.95\), the same as fisher.test’s estimate (about 2.95; Fisher reports a conditional maximum-likelihood estimate, which is almost identical for large tables). fisher.test uses a default print format that displays very small p-values as < 2.2e-16; the probability here is about \(10^{-966}\) and underflows on the ordinary probability scale, so enrich() evaluates the hypergeometric tail on the log scale. (b) B-up: ETS of the PU.1 type (SPIB, SPI1, SPIC), IRF/STAT (ETS–IRF composite elements and interferon-response elements), IKZF1, and POU/OCT (POU2F1/2/3, the OCT2 motif). T-up: BCL11B, ETS of the ETS1/ERG/GABPA type, IKZF3, RUNX (Runx1 OR 2.13, ETS1 OR 2.66), and further down TCF7/LEF (TCF7 OR 2.11). Both fit: PU.1, SPIB, OCT2, IRF4/8 and IKAROS are B-cell regulators; RUNX1/3, ETS1, TCF1 and BCL11B are T-cell regulators. (c) 511 (B-up) and 507 (T-up) of 879. Not useful by itself: half of all motifs, mostly redundant family members and composition effects. Rank by odds ratio and group by family. (d) B-up: EBF1 OR 1.13 (\(p \approx 4.5 \times 10^{-8}\)), PAX5 OR 0.90 (not enriched), PAX2 OR 1.86 (\(p \approx 1.5 \times 10^{-35}\)). Both are B-cell master regulators, so absence of enrichment is not absence of function. For EBF1 the effect is weak with this background (see R5); for PAX5 the JASPAR matrix MA0014.4 is short and matches only 1.8% of peaks, while the longer PAX2 matrix (same paired domain) detects the enrichment. Matrix choice and background matter; lack of enrichment does not show that the TF is inactive. In T-up peaks EBF1 is clearly depleted (OR 0.51). (e) Many CTCF sites are shared between B and T cells, so they are not differential in this comparison: they are under-represented in any set of cell-type-specific peaks compared with the ns peaks (OR 0.51 and 0.59).
R5. (a) Less GC-rich: mean GC 0.477 in B-up versus 0.513 in ns peaks. All 19 404 B-up peaks find partners in their 2%-GC bins, giving 19 404 distinct ns background peaks with mean GC 0.477. (b) GC-rich motifs move towards 1: SP1 0.58 → 0.95, KLF4 0.73 → 1.07, NRF1 0.38 → 0.73; their apparent depletion was largely composition. EBF1 rises from 1.13 to 1.44. SPIB hardly changes (2.95 → 2.89) and CTCF stays depleted (0.51 → 0.54): those effects survive GC matching. Reporting the background size and GC distribution makes a shortage of partners or an imperfect match visible. The values above use set.seed(1); other random draws vary slightly.
R6. (a) 77 healthy libraries become 47 donor × cell-type samples across 13 cell types after summing technical replicates. The liftOver filters retain 589 070 peaks; chromVAR uses the 100 000 most-read. dim(z) is 879 × 47; computeDeviations takes about 25 s on 4 cores after the motif matching (whole block about 3 minutes). The most variable motifs are GATA (GATA1::TAL1 34, then GATA4, Gata3, GATA6, GATA2), the PU.1-type ETS motifs (SPIC, Spi1, SPIB, 14–16) and E-box motifs (ERF::FIGLA, FIGLA, ZEB1, 13–15). (b) GATA1::TAL1: MEP 77, Ery 50, CMP 37, MPP 12, negative in all lymphoid and myeloid cells. KLF1: weak (Mono 12, Ery 5): the KLF motif is GC-rich and shared with many KLF/SP factors. CEBPA: GMP 21, Mono 22. Spi1: LMPP 19, GMP 25, Mono 22, B 19; negative in MEP, Ery, T and NK. EBF1: CLP 20, B 6. TCF3 (E2A): CLP 27, LMPP 19, B 17, CD4 9. POU2F2: B 13. Runx1: LMPP 18. TCF7: CD4 11, CD8 8. TBX21: NK 21, CD8 15. CTCF: high only in GMPs (26), a pattern without an obvious biological explanation; worth checking for a technical batch. Overall, the known regulators of each lineage come out where expected. (c) Gata3 follows GATA1::TAL1 (MEP 46, Ery 27, CMP 36) and is negative in CD4 T cells (−17), where GATA3 is the active GATA factor. The motif cannot tell family members apart; in erythroid cells the open GATA sites are bound by GATA1. (d) fam["FIGLA_MA0820.2"] and BHLHE22 are “Tal-related” and ASCL1 “MyoD/ASC-related”: bHLH factors binding E-boxes (CANNTG). In blood the E-box factors are E2A (TCF3), HEB (TCF12) and E2-2 (TCF4) in lymphoid cells, and TAL1 with GATA1 in erythroid cells. TBR1 (“TBrain-related”) is a T-box motif: in blood it stands for T-bet (TBX21) and Eomes, high in NK and CD8 T cells.
R7. (a) 504 974 insertions on chr21. 15 684 CTCF motif matches at \(p < 10^{-4}\): 400 (2.6%) in a CTCF ChIP peak, 427 in an ATAC peak without ChIP peak, 14 857 in closed chromatin. 82% of the 405 chr21 ChIP peaks contain a motif match. (b) Bound sites: flanks rise to about 0.7 insertions per site at −23 and +34 bp (5-bp smoothed), a dip over the motif (about 0.2 on either side of the centre) with a narrow spike at the centre, and lower values far out. Averages: flank (30–60 bp) 0.48, centre (±10 bp) 0.34, far (≥ 90 bp) 0.20; centre/flank = 0.69 (the central spike raises the ±10-bp average; without it the dip is deeper). Open but unbound sites: flat at about 0.45, no flanks, no dip, but the same central spike. Closed sites: flat near 0.01. (c) Being in an ATAC peak only means the site lies somewhere in an open region, typically not at its centre and not bound: no protein protects it and no CTCF-positioned nucleosome-free region surrounds it. Without binding there is neither a footprint nor the flank pattern. (d) Without orientation, + and − strand sites are averaged in opposite directions: the profile becomes nearly symmetric (flank maxima at −31 and +33 instead of −23 and +34) and the central dip slightly shallower (minimum of the 5-bp-smoothed profile within ±10 bp: 0.24 instead of 0.21). Real asymmetric features of the CTCF footprint are smeared out.
R8. (a) The strongest deviations occur near the insertion: C is enriched at −6 and +4 (0.44) and −1 (0.41), G at −4 (0.48), +1 (0.40) and +6 (0.41), while T is depleted at −4 (0.09) and A at +4 (0.12). Further out the composition settles at the GC-rich level of open chromatin (about 0.3 for each of C and G), above the chr21 average of 41% GC. (b) The sequence of a motif is nearly the same at every site, so Tn5’s preference for or against it repeats at every site. Averaged over thousands of sites this gives a reproducible spike or dip that has nothing to do with binding, as in the central spike of R7. Footprints must be compared with unbound sites of the same motif or corrected with a bias model.
Where this leads
- HOMER and MEME do known and de novo motif enrichment from the command line:
findMotifsGenome.pl b_up.bed hg38.fa out/ -size 200 -bg ns.bed, orsea --p b_up.fa --n ns.fa --m JASPAR2024.memeandstreme(see the lecture). - TOBIAS corrects Tn5 bias and compares footprints between conditions:
TOBIAS ATACorrect --bam atac.bam --genome hg38.fa --peaks peaks.bed, thenScoreBigwigandBINDetect --motifs JASPAR.meme. - chromVAR on single cells (ArchR, Signac) gives each cell a motif z-score; the same idea as R6 with cells as columns.
- ChIP-seq, CUT&RUN and CUT&Tag measure the binding of one TF directly and give the ground truth that motifs and footprints only suggest.
- How a CNN reads DNA shows that a convolutional filter is a motif scanner, and models like chromBPNet learn motifs and Tn5 bias from the sequence.
Key papers (optional further reading)
Not required reading and not examined.
- Heinz et al. 2010, Mol Cell. Simple combinations of lineage-determining transcription factors prime cis-regulatory elements required for macrophage and B cell identities.
- Bailey et al. 2015, Nucleic Acids Res. The MEME Suite.
- Rauluseviciute et al. 2024, Nucleic Acids Res. JASPAR 2024: 20th anniversary of the open-access database of transcription factor binding profiles.
- Schep et al. 2017, Nat Methods. chromVAR: inferring transcription-factor-associated accessibility from single-cell epigenomic data.
- Sung et al. 2014, Mol Cell. DNase footprint signatures are dictated by factor dynamics and DNA sequence.
- Bentsen et al. 2020, Nat Commun. ATAC-seq footprinting unravels kinetics of transcription factor binding during zygotic genome activation.