Why Background Choice Matters
A motif is a short sequence pattern associated with a transcription factor or other DNA-binding protein. When a motif occurs more often in chromatin peaks than in a background set, the difference may be biologically informative. But the comparison is only meaningful if the background represents genomic regions that could reasonably have served as controls for those peaks. A background made of very different regions can make a motif look enriched or depleted for reasons unrelated to the comparison of interest.
For example, GC-rich sequences can contain some motifs more often simply because of their nucleotide composition. Open chromatin may also differ from closed chromatin in sequence properties and in which regions are eligible to be called peaks. If peaks are compared with arbitrary genomic windows, an apparent motif difference can therefore reflect GC content, accessibility, or sequence composition rather than an association specific to the peaks.
The goal is not to find one universally correct background. It is to define the question precisely and select regions that support that question. Matching peaks to regions similar in accessibility, GC content, and sequence composition asks whether the motif is more common in the peaks than in otherwise comparable chromatin regions.
Specify the Comparison Before Selecting Regions
Start by stating what “enrichment” is intended to mean. One useful target is the difference in motif prevalence between called peaks and eligible genomic regions with similar accessibility and sequence properties. This is a conditional comparison: it asks about motif prevalence after accounting for the features used in matching. It does not estimate every biological difference between peaks and the genome as a whole.
Define the eligible genomic universe before sampling controls. It might consist of regions measurable in the same sample and assay, excluding the foreground peaks, with adequate sequence and mappability. Use consistent region lengths or account for length explicitly, since longer sequences have more opportunities to contain a motif. Specify the genome assembly, peak boundaries, motif-scanning method, and threshold in advance. A motif occurrence indicator can be written \(Y=1\) if a region contains at least one scan hit under that fixed procedure, and \(Y=0\) otherwise.
Accessibility should be measured in a way appropriate to the question, such as a signal summary from the same cell type and assay. GC content is the fraction of bases that are G or C. Sequence composition can include mono- or dinucleotide frequencies; matching dinucleotide composition can be important when motifs depend on particular adjacent bases. Other relevant features may include region length, mappability, chromosome, and distance to transcription start sites. Matching more features is not automatically better: each feature should be relevant to the intended comparison and measurable without using motif outcomes to choose controls.
Practical Matching Strategies
One approach is to form matched sets. For each peak, select one or more eligible background regions close in accessibility and GC content, while also requiring similar length and sequence composition. Matching can use exact categories for some variables and calipers for continuous ones. A caliper is a prespecified maximum acceptable difference; for example, a control might be required to fall within a narrow range of a peak’s GC fraction and accessibility score. If a peak has no suitable control, it is better to report that it was unmatched than to force a poor comparison silently.
Another approach is stratification. Divide regions into strata with similar accessibility and sequence characteristics, compare foreground and background within each stratum, and combine stratum-specific comparisons using weights appropriate to the target foreground. Weighting can serve a similar purpose when exact matches are unavailable, but it can be unstable if some regions receive very large weights or if there is little overlap between foreground and candidate controls.
Use regions that could have been selected under the assay and analysis design; document exclusions and keep the foreground out of its own control pool.
Include accessibility and sequence properties that could otherwise distort the comparison. Set tolerances before examining motif results.
Inspect whether each foreground region has suitable controls and whether the distributions of matched features are similar across groups.
Use a comparison consistent with the matching design, then report the target contrast, balance, exclusions, and important limitations.
Worked Examples
Worked Example: How GC Imbalance Creates Apparent Enrichment
Suppose a hypothetical set of peaks and a candidate background are scanned for the same motif using identical sequence lengths and a fixed threshold. In both groups, the motif occurs in 30% of high-GC regions and 10% of low-GC regions. However, 40% of the peaks are high-GC, while only 10% of the background regions are high-GC. Calculate the unadjusted motif rates.
For peaks, the rate is the weighted average across their GC groups:
Thus, 18% of peaks contain the motif. For the background:
The unadjusted ratio is \(0.18/0.12=1.50\), which could be described as 1.5 times the motif prevalence in peaks. Yet within both GC groups the rates are identical: 30% versus 30% in high-GC regions and 10% versus 10% in low-GC regions. The apparent difference arises entirely from the unequal GC composition of the two sets. This is why a background with a different sequence composition can give a misleading enrichment result.
Worked Example: A Matched-Pair Motif Comparison
Consider 12 hypothetical peak regions, each paired with one background region matched on accessibility, GC content, length, and dinucleotide composition. Motif scanning finds eight pairs in which the motif occurs only in the peak, one pair in which it occurs only in the background, two pairs in which it occurs in neither region, and one pair in which it occurs in both. Calculate the prevalence difference and an exact paired comparison.
The peak motif prevalence is \((8+1)/12=9/12=0.750\). The background prevalence is \((1+1)/12=2/12=0.167\). The paired prevalence difference is \(0.750-0.167=0.583\), or 58.3 percentage points in this hypothetical set.
For an exact paired test under the null of no directionally consistent difference, only discordant pairs are informative. There are \(8+1=9\) discordant pairs. Under the null, and assuming independent pairs with either direction equally likely, the number favoring the peak follows \(X\sim\mathrm{Binomial}(9,0.5)\). With eight favoring the peak, the two-sided exact p-value is:
This result is evidence of a difference for this hypothetical matched comparison under the stated test assumptions. It is not a 3.9% probability that the null is true, and it does not establish a causal role for the motif. With many motifs tested, the analysis must also address multiple testing. In real genomic data, nearby or overlapping pairs may be dependent, so the independent-pair assumption requires particular scrutiny.
Worked Example: Standardizing to the Foreground Accessibility Mix
Suppose peaks consist of 80 low-accessibility and 20 high-accessibility regions. Their motif rates are 10% and 30%, respectively. A candidate background has rates of 8% and 28% in those same accessibility groups, but its own composition is 20 low and 80 high-accessibility regions. Compare the raw rates and then standardize the background to the peak composition.
The peak rate is \(80(0.10)/100+20(0.30)/100=0.08+0.06=0.14\), or 14%. The raw background rate is \(20(0.08)/100+80(0.28)/100=0.016+0.224=0.24\), or 24%. This raw comparison makes the peak rate appear lower, largely because the background contains many more high-accessibility regions.
To compare at the peak accessibility mix, weight the background stratum rates by the peak proportions:
The standardized background rate is 12%, compared with 14% in peaks. The corresponding ratio is \(0.14/0.12=1.167\), and the difference is 2 percentage points. This adjusted comparison is quite different from the raw comparison. It illustrates why accessibility composition should be balanced or explicitly accounted for when that is part of the intended conditional comparison.
Why Matching Reduces a Specific Bias
The examples rely on a simple mixture identity. Suppose a feature \(Z\), such as GC group, has categories \(z\). The overall motif prevalence in a group \(G\) is the sum of the category-specific prevalence multiplied by that group’s category proportions:
Even if the conditional motif prevalence is the same in peaks and background within every category, the overall rates can differ when \(P(Z=z\mid G)\) differs between groups. Matching or standardizing makes the feature distributions more comparable, so that this source of difference is reduced.
This argument does not guarantee that every source of bias has been removed. It depends on measuring and balancing relevant features, having adequate overlap, and using a comparison appropriate to the target question. An unmeasured sequence property or a poor accessibility measurement can still leave residual imbalance. Also, if accessibility is a consequence of binding by the factor of interest, matching on accessibility changes the question: it estimates motif enrichment conditional on accessibility, rather than the total relationship between the factor-associated motif and peak status.
Diagnostics, Alternatives, and Limitations
Check balance after selecting controls, not just the matching algorithm’s settings. Compare distributions of accessibility, GC content, length, and selected sequence-composition measures using plots and summaries. A similar mean can conceal different tails or multimodality, so inspect distributions as well as averages. Report how many peaks were unmatched, the number of controls per peak, and whether matching tolerances were relaxed. Examine whether motif conclusions change under reasonable alternative tolerances or background samples.
Failure signs include substantial covariate imbalance after matching, many foreground regions without eligible controls, extreme weights in a weighted analysis, and motif results that change markedly with small changes to the background. A background with a high motif prevalence is not necessarily wrong: the key question is whether it represents the comparison of interest. But a result driven by a few regions, poorly matched tails, or a particular arbitrary control sample deserves caution.
| Approach | Strength | Main concern |
|---|---|---|
| Matched controls | Direct comparison of similar regions; balance is inspectable. | May discard peaks without suitable controls; results depend on matching choices. |
| Stratification | Shows comparisons within feature-defined groups and allows transparent standardization. | Many features can create sparse strata; coarse bins leave residual imbalance. |
| Weighting or regression adjustment | Can use continuous covariates and retain more regions. | Requires adequate overlap and appropriate modeling; extreme weights or model misspecification can mislead. |
| Sequence shuffling | Can provide a reference preserving selected sequence properties. | Shuffled sequences may not represent genomic regions, accessibility, chromatin context, or unpreserved sequence structure. |
No method repairs a poorly defined eligible universe. Matching on many variables can also reduce the available comparison set and alter the estimand. Conversely, matching only on GC while ignoring accessibility may be inadequate if the question concerns peaks compared with similarly accessible regions. Motif occurrence is a sequence-based proxy: enrichment alone does not show that a protein binds, that a motif is functional, or that the motif explains accessibility. These claims require additional evidence.
Common Pitfall
Check Your Understanding
Answer each question, then compare your reasoning with the solutions below.
- Why can a high-GC foreground and low-GC background create apparent motif enrichment even if within-GC motif rates are equal?
- A peak has no eligible control within the prespecified accessibility and GC tolerances. What should be reported, and why is silently widening the tolerance problematic?
- In a matched comparison, 6 discordant pairs favor peaks and 2 favor controls. Under the independent-pair null, what distribution describes the number favoring peaks, and what is the two-sided exact p-value?
- Why might matching on accessibility be inappropriate if the scientific target is the total relationship between a transcription factor and chromatin accessibility?
- Name two diagnostics that can reveal a background set is unsuitable, even when the matching procedure ran successfully.
Solutions. (1) The groups may have different proportions in GC categories, and the motif rates can differ between those categories; the overall rate then changes through the mixture of categories even when the within-category rates match. (2) Report the unmatched peak and the number excluded. Widening tolerances after seeing the result changes the comparison and can produce residual imbalance; any alternative tolerance should be justified and its consequences reported. (3) There are eight discordant pairs, so \(X\sim\mathrm{Binomial}(8,0.5)\) under the stated null. The exact two-sided p-value is \(2P(X\geq6)=2(28+8+1)/256=74/256=0.2891\). (4) Accessibility may lie on the pathway from binding to the chromatin state. Conditioning on it answers a conditional-enrichment question and can remove part of the relationship the total-effect question seeks to describe. (5) Examples include large post-match differences in covariate distributions, many unmatched peaks, extreme weights, or conclusions highly sensitive to small changes in control selection.