Motifs, motif enrichment and TF footprinting

Which transcription factors explain the open chromatin, and are they bound?

Epigenetics

About this lecture

Differential accessibility gave us thousands of peaks that are more open in B cells than in CD4 T cells, and the reverse. A list of peaks is not yet biology: which transcription factors (TFs) open these regions?

  • Motif enrichment: which TF motifs are over-represented in a set of peaks (a 2×2 test, and the choice of background).
  • chromVAR: how open the peaks with a given motif are, per sample (or per cell).
  • Footprinting: whether a TF actually sits on its site, from the pattern of Tn5 insertions.

Recap: a PWM finds motif matches

  • A position weight matrix (PWM) gives a log-odds score for each base at each position (from Gene regulation). The score of a window is the sum; scan both strands.
  • A match is a window whose score is unlikely in random sequence: here p < 5 \times 10^{-5} (the motifmatchr default).
  • Short motifs match by chance everywhere. A 500-bp peak has ~1000 windows, so about 5% of peaks match any given motif by chance alone.

Motif databases, and TF families

  • JASPAR 2024 (open, curated; 879 vertebrate CORE motifs), CIS-BP (motifs inferred for ~1600 human TFs), HOCOMOCO (from ChIP-seq). HOMER and MEME ship their own collections.
  • TFs of one family share a DNA-binding domain and bind almost the same motif. A motif hit names a family, not a TF.
  • Matrices for the same TF differ between databases and versions. JASPAR’s PAX5 matrix is only the 8-bp core; its PAX2 and PAX8 matrices are longer.

Motif enrichment is a 2×2 table

  • Count target and background peaks with and without a match. Effect size: the odds ratio; with 42% vs 20%, OR = 2.95.
  • p-value: Fisher’s exact test, which is the hypergeometric test: how surprising is it to draw this many motif peaks if the 19 404 B-up peaks were a random draw from B-up plus ns peaks?
  • Expected matches in B-up under the null: 19 404 × 43 302 / 194 927 ≈ 4310. Observed: 8227.

Choosing the background

  • The background decides the question. Here each differential group is compared with the tested ns peaks, excluding both B-up and T-up from the background.
  • GC content is the classic confounder: motifs differ in GC, and so do peak sets (promoters are GC-rich, distal enhancers AT-richer).
  • The random-genome background is the motif version of the naive shuffle in Genomic intervals: it answers “open vs closed DNA”, not “B vs T”.

Real data: the background changes the answer

  • B-up peaks are AT-richer than ns peaks (mean GC 0.48 vs 0.51) but GC-richer than random DNA (0.41).
  • Against ns peaks, GC-rich motifs (SP1, KLF4, NRF1) look depleted; GC matching removes most of this. EBF1 (GC-rich) gains: OR 1.13 → 1.44.
  • Against random genome, SPIB looks more enriched (OR 4.89 versus 2.95 against ns) and CTCF flips from depleted to enriched.

Real data: motifs in B-up and T-up peaks

  • B-up: PU.1 / SPIB / SPIC (ETS), IRF and STAT, OCT (POU2F2 = OCT2), IKZF1, MEF2, NF-κB. T-up: ETS1 / GABPA / ERG-type ETS, RUNX, TCF7/LEF1, BCL11B, GATA3 (OR 1.5).
  • EBF1 is only weakly enriched (OR 1.13) and PAX5’s JASPAR matrix not at all, although both are B-cell master regulators. EBF is clearly depleted in T-up peaks (OR 0.51).

One family, two lineages

  • Each point is a motif: enrichment in B-up (x) against enrichment in T-up (y).
  • The ETS family splits: PU.1/SPIB motifs (A-rich flank) go with B cells, ETS1/GABPA motifs (CCGGAAGT) with T cells. The flanks seen in the logos carry the lineage information.
  • CTCF and GC-rich promoter motifs (SP1, KLF4) are below 1 in both: constitutively open, not lineage-specific.

Hundreds of motifs: p-values and effect sizes

B-up T-up
motifs tested 879 879
enriched at BH FDR 5% (OR > 1) 511 507
enriched at Bonferroni 5% (p < 0.05 / 879 = 5.7 × 10⁻⁵) 361 432
strongest odds ratio 2.95 (SPIB) 2.89 (BCL11B)
  • With ~19 000 target peaks, tiny effects are significant. Half of all motifs pass FDR 5%; most are family members of a few real signals, or GC.
  • Correct for the number of motifs (BH or Bonferroni, as for genes in RNA-seq), then rank by effect size (odds ratio, or fraction of target vs background), and group motifs by family.
  • With few target peaks (say 200), the opposite problem: little power, and multiple testing matters more.

Known motifs vs de novo discovery

  • Known-motif enrichment tests each database motif: fast, names come for free, but limited to the database and to the quality of each matrix (PAX5 above).
  • De novo discovery finds the words that best separate target from background, builds a PWM, then compares it with the database: “looks like EBF1”.
  • Both give a motif, not a TF: the family problem remains.

HOMER and MEME on the command line

# HOMER: known + de novo motifs, 200 bp at the peak centre,
# GC-matched random genomic background (default) ...
findMotifsGenome.pl b_up.bed hg38.fa homer_b_up/ -size 200 -p 8
# ... or the saved ns peaks as background for differential peaks
findMotifsGenome.pl b_up.bed hg38.fa homer_bg/ -size 200 -bg ns.bed -p 8

# MEME suite: known motifs (SEA) and de novo (STREME) vs the saved ns peaks
bedtools getfasta -fi hg38.fa -bed b_up.bed   > b_up.fa
bedtools getfasta -fi hg38.fa -bed ns.bed > ns.fa
sea    --p b_up.fa --n ns.fa --m JASPAR2024_CORE_vertebrates.meme
streme --p b_up.fa --n ns.fa --dna
  • Not installed in this course: the exercise does the known-motif test in R (motifmatchr + Fisher), which shows every step.

chromVAR: motif accessibility per sample

  • Enrichment needs a set of peaks. chromVAR asks the question per sample: are the peaks with motif X more open in this sample than in the average sample?
  • Compare with background peaks matched for GC content and average accessibility, so technical differences between samples (GC bias, signal-to-noise) cancel.
  • Output: a deviation z-score per motif and sample, and the variability of each motif across samples.

Real data: chromVAR across haematopoiesis

  • 13 cell types, 47 donor × cell-type samples from Corces et al. 2016; the 100 000 most-read peaks; 879 JASPAR motifs.
  • Motifs of 26 known regulators. GATA in MEPs and erythroblasts (and rising from HSC to MPP to CMP); CEBP in GMPs and monocytes; PU.1/SPIB in LMPPs, GMPs, monocytes and B cells; EBF1 in CLPs (less in B cells); the E-box (TCF3, E2A) in LMPPs, CLPs, B and T cells; POU2F2 and NF-κB in B cells; TCF7/LEF1 in CD4 and CD8 T cells; T-box (TBX21, EOMES) and ETS1 in NK and CD8 T cells.
  • The motif called Gata3 behaves exactly like GATA1: it is highest in erythroid cells, not in T cells. Same family, same motif.

Variability, and single cells

  • Variability ranks motifs by how much their accessibility differs between samples: an unsupervised way to find the TFs that distinguish cell types.
  • The top of the list is dominated by families, often under unexpected names: FIGLA, ASCL1, BHLHE22 are E-box motifs (E2A/TCF3 in lymphoid cells), TBR1 is a T-box motif (T-bet, Eomes), MAFG::NFE2L1 is the erythroid NFE2 motif.
  • chromVAR was built for single-cell ATAC-seq, where each cell has a few thousand fragments: no single peak is informative, but summed over the thousands of peaks with a motif, each cell gets a z-score (ArchR, Signac).

Footprints: a bound TF protects its site

  • Tn5 cannot insert where a protein sits. A TF bound for long enough leaves a dip of insertions over its motif (the footprint), flanked by high insertion rates in the free DNA next to it.
  • Footprinting needs base-resolution insertion sites (the +4/−5 shifted read ends of ATAC-seq processing and peak calling), not coverage, and deep sequencing: ~10⁸ reads for single sites.

From reads to an aggregate footprint

  • Each read end is one Tn5 insertion: in BED coordinates, start + 4 for reads on +, end − 5 for reads on −. In 1-based R coordinates, use start + 4 and end − 4.
  • Take every motif match, cut a window of ±100 bp around its centre, flip sites on the − strand, and average the insertion counts position by position.

Real data: CTCF footprint in GM12878

  • Bound sites (motif in a ChIP peak, n = 400): high flanks peaking at about −23 and +34 bp, and a dip over the motif. Open but unbound motif sites (n = 427): flat, no flanks, no dip. Closed sites: almost no insertions.
  • The narrow spike at the motif centre appears in bound and unbound sites: it is Tn5’s sequence preference, not protein.

Tn5 has a sequence preference

  • Base composition around 200 000 insertion sites in the GM12878 reads, relative to the same reads 20–30 bp away. Within ±10 bp of the insertion, bases are up to 1.8-fold enriched or 2.6-fold depleted, in a structured pattern around the 9-bp duplication.
  • Tn5 does not cut at random: some sequences are cut more often whatever is bound. A motif has nearly the same sequence at every site, so this preference repeats at every site and does not average out.

Correcting for Tn5 bias

  • Observed insertions = Tn5 sequence preference × protection. Inside a motif the sequence is the same at every site, so the bias is the same at every site and adds up in the aggregate: it can create a fake footprint, or hide a real one.
  • Correct by comparing with insertions expected from sequence alone: Tn5 on naked DNA, a k-mer model (TOBIAS ATACorrect), or a neural network bias model (chromBPNet).

Which TFs leave footprints?

  • Footprint depth reflects how long the TF stays on DNA (residence time), not just whether it binds.
  • CTCF (minutes) footprints well. Many TFs exchange within seconds and leave little or no footprint even where ChIP-seq shows binding (Sung et al. 2014).
  • “No footprint” is therefore not evidence of no binding; compare conditions (TOBIAS BINDetect) rather than reading single sites.

A motif is not a binding event

  • Of 15 684 CTCF motif matches on chr21, only 400 (2.6%) lie in a CTCF ChIP-seq peak; 95% are in closed chromatin. Conversely, 82% of the 405 chr21 CTCF ChIP peaks contain a match.
  • CTCF has one of the longest, most informative motifs. For short motifs (GATA: WGATAR) the fraction bound is far smaller. A match says where a TF could bind; chromatin and partners decide where it does (Gene regulation).

Three questions, three tools

  • Enrichment for a set of peaks (differential peaks, a cluster); chromVAR for samples or single cells; footprinting for sites, with deep data and bias correction.
  • All three start from motifs, so all three inherit the motif’s limits: family redundancy, imperfect matrices, and motif ≠ binding.

Summary

idea key fact
motif match PWM log-odds score above a p-value threshold; ~5% of 500-bp peaks match any motif by chance
databases JASPAR, CIS-BP, HOCOMOCO; families share motifs, so a motif names a family
enrichment 2×2 table: target vs background × match vs no match; odds ratio; Fisher = hypergeometric
background decides the question; tested ns peaks for differential sets; match GC; random genome inflates
multiple testing ~900 motifs: BH or Bonferroni, then rank by effect size and group by family
de novo find enriched words, build a PWM, compare with the database (HOMER, STREME, Tomtom)
chromVAR per-sample deviation of motif peaks vs GC/accessibility-matched background; z-score; variability; single cells
footprint dip of Tn5 insertions at a bound motif, high flanks; aggregate over oriented sites
caveats Tn5 sequence bias makes fake footprints (correct: TOBIAS, chromBPNet); short residence time leaves none

Key papers (optional further reading)

Not required reading and not examined. For those who want the primary literature.