Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Aligning RNA Genes With ATAC Peaks

CITE-seq, ATAC and Multiome Data · Tutorial 603 of 700

Aligning RNA Genes With ATAC Peaks

Learn to define reproducible peak-to-gene candidates from genomic coordinates and annotations without treating a coordinate match as proof of regulatory function.

Advanced 10 min read

What You'll Learn

  • Convert gene annotations and ATAC peak intervals to a consistent coordinate convention.
  • Define promoter windows relative to the transcription start site and gene strand.
  • Calculate peak–promoter overlap and identify multiple candidate peaks for one gene.
  • Recognize ambiguous assignments involving nearby genes, isoforms, or overlapping windows.
  • Compare promoter overlap, gene-body overlap, and nearest-TSS mapping rules.
  • Diagnose coordinate, annotation, and interpretation errors.

Why Coordinate Mapping Needs an Explicit Rule

An ATAC peak is a genomic interval with accessible chromatin; a gene annotation describes genomic locations associated with a gene. Matching the intervals is a practical way to create candidate peak-to-gene mappings. It does not, by itself, show that the peak regulates the gene, or that accessibility causes a change in its RNA expression. The mapping depends on choices such as genome assembly, transcript annotation, promoter-window size, and whether the rule is overlap or distance.

A reproducible mapping therefore starts by stating those choices. In this tutorial, genomic intervals use the 0-based, half-open convention: an interval \([a,b)\) includes bases \(a\) through \(b-1\), and its length is \(b-a\). This convention is common in ATAC-seq interval files such as BED. Gene annotations may use a different convention, so their coordinates must be converted before intervals are compared.

Definition: A peak–gene candidate mapping is a pair consisting of an ATAC peak interval and an annotated gene, selected by a stated coordinate-based rule. A promoter-overlap mapping is such a pair for which the peak and a defined promoter window overlap by at least one base. It is a candidate association, not evidence of a causal regulatory effect.

Coordinates, Strands, and Promoter Windows

A peak interval and a gene annotation can be compared only when they refer to the same genome assembly and chromosome naming scheme. For example, coordinates from one genome assembly are not interchangeable with coordinates from another, even if both use the label “chr1.” Check the assembly, chromosome identifiers, and coordinate conventions before calculating any overlaps.

Many gene annotations use 1-based, closed intervals, in which both endpoints are included. For such an interval with start \(s\) and end \(e\), the equivalent 0-based, half-open interval is \([s-1,e)\). For a transcript on the positive strand, its transcription start site (TSS) is its first base: annotation start \(s\) becomes TSS coordinate \(s-1\). For a transcript on the negative strand, its TSS is its last annotated base: annotation end \(e\) becomes TSS coordinate \(e-1\). The strand matters because “upstream” and “downstream” refer to transcription direction, not simply to lower and higher genomic coordinates.

Choose an upstream distance \(U\) and a downstream distance \(D\), in base pairs, for the promoter window. Let \(t\) be the TSS coordinate under the convention above. A positive-strand promoter window extends \(U\) bases to lower coordinates and \(D\) bases to higher coordinates. A negative-strand window reverses those genomic directions. The following expressions include the TSS base and exactly \(U\) upstream and \(D\) downstream bases, before clipping at a chromosome boundary.

$$ W(t,U,D)= \begin{cases} [t-U,\ t+D+1), & \text{positive strand},\\ [t-D,\ t+U+1), & \text{negative strand}. \end{cases} $$

This definition is a convention, not a uniquely correct biological boundary. A promoter window may be symmetric or asymmetric, and different analyses may use different distances. State the window in base pairs and apply the same rule consistently. If a window extends beyond the chromosome, truncate it at the chromosome boundary; do not wrap it to the other end.

For a peak \(P=[a,b)\) and a promoter window \(W=[c,d)\), the number of overlapping bases is

$$ L(P,W)=\max\{0,\ \min(b,d)-\max(a,c)\}. $$

The expression follows directly from the interval endpoints: the intersection starts at the larger of the two starts and ends at the smaller of the two ends. Its length is end minus start when that is positive; otherwise the intervals are disjoint and the overlap is zero. A promoter-overlap mapping is recorded when \(L(P,W)>0\). A stricter rule can require a minimum overlap length or a minimum fraction of the peak, but that threshold should be stated rather than selected after seeing the results.

Worked Example: Checking Overlap on Both Strands

Suppose a hypothetical positive-strand transcript has TSS coordinate \(t=1020\). Use a promoter window with \(U=100\) bp and \(D=40\) bp. A peak is \(P=[1000,1040)\). Find the window and overlap.

For the positive strand, \(W=[t-U,t+D+1)=[1020-100,1020+40+1)=[920,1061)\). The peak and window overlap from coordinate 1000 up to, but not including, 1040. Thus \(L=\max\{0,\min(1040,1061)-\max(1000,920)\}=\min\{1040,1061\}-\max\{1000,920\}=1040-1000=40\) bp. The peak is fully inside this promoter window.

Now suppose a hypothetical negative-strand transcript has TSS \(t=2000\), with the same \(U\) and \(D\), and a peak \(P=[2080,2120)\). Its promoter window is \(W=[t-D,t+U+1)=[1960,2101)\). The overlap is \(L=\max\{0,\min(2120,2101)-\max(2080,1960)\}=2101-2080=21\) bp. The window extends farther to higher coordinates because those positions are upstream for a negative-strand transcript. Both results assume that all coordinates have already been converted to the same convention and assembly.

One Gene Can Have Several Candidate Peaks

A gene is not necessarily represented by one peak. Several separated intervals may overlap its promoter window, and a peak may overlap windows for more than one gene. Preserve these as separate candidate pairs rather than silently selecting one peak or forcing each peak to one gene. A mapping table can include the peak identifier, gene identifier, chromosome, interval, strand, TSS, window definition, overlap length, and the rule used to create the pair.

Transcript choice also matters. A gene can have multiple annotated transcripts with different TSSs, including alternative promoters. One approach is to map against transcript-level TSSs and retain transcript identifiers; another is to select one representative transcript per gene by a prespecified annotation rule. Collapsing transcript-level mappings to gene level can create duplicate pairs, so specify whether duplicates are retained, combined, or summarized. A gene-level label alone may conceal which annotated TSS generated a match.

Worked Example: Retaining Multiple Peaks and an Ambiguous Match

Consider a hypothetical positive-strand gene A with TSS \(t=5000\), using \(U=500\) bp and \(D=100\) bp. Its window is \([4500,5101)\). Two peaks are observed: \(P_1=[4520,4560)\) and \(P_2=[4980,5020)\). For each, calculate the overlap with gene A’s window.

For \(P_1\), \(L=\max\{0,\min(4560,5101)-\max(4520,4500)\}=4560-4520=40\) bp. For \(P_2\), \(L=\max\{0,\min(5020,5101)-\max(4980,4500)\}=5020-4980=40\) bp. Both peaks meet the overlap rule and should be retained as separate candidates for gene A. Their shared overlap length does not mean that they have equal regulatory importance.

Now add a hypothetical negative-strand gene B with TSS \(t=5080\) and the same upstream and downstream distances. Its window is \([5080-100,5080+500+1)=[4980,5581)\). Peak \(P_2=[4980,5020)\) overlaps gene B’s window by \(5020-4980=40\) bp as well. Thus \(P_2\) maps to both gene A and gene B under the stated rule. The coordinate rule does not resolve which gene, if either, is functionally regulated by this peak; keep both candidate pairs and report the ambiguity.

Coordinate Conversion and Alternative Mapping Rules

Promoter overlap is not the only possible coordinate rule. A peak may overlap a gene body without overlapping the selected promoter window. A nearest-TSS rule instead assigns a peak to the gene with the closest TSS, usually within a declared maximum distance. These rules answer different questions: promoter overlap identifies intersection with a specified TSS-centered interval; gene-body overlap identifies intersection with an annotated gene span; nearest-TSS assignment uses distance even when there is no interval overlap. Do not treat their results as interchangeable.

A nearest-TSS rule also needs a tie policy and a distance definition. For example, one can calculate distance from a peak midpoint to the TSS and retain all genes tied for the minimum within a maximum distance. The midpoint is a chosen summary of the peak interval, not a biological point that is necessarily more informative than the full interval. Alternatively, distance can be measured from the nearest peak boundary. State which definition is used and retain multiple assignments when a prespecified tie or ambiguity rule requires it.

Worked Example: Converting an Annotation Before Mapping

Suppose a hypothetical positive-strand transcript is recorded in a 1-based, closed annotation with start 1001 and end 1800. Its TSS is the annotation start, so in 0-based coordinates the transcript interval is \([1000,1800)\) and the TSS coordinate is \(t=1000\). Use \(U=100\) bp and \(D=20\) bp. A peak is supplied in 0-based, half-open form as \(P=[970,1005)\).

The positive-strand promoter window is \([1000-100,1000+20+1)=[900,1021)\). The peak overlaps the promoter window by \(\min(1005,1021)-\max(970,900)=1005-970=35\) bp, so it is a promoter-overlap candidate. The peak also overlaps the converted gene body \([1000,1800)\) by \(1005-1000=5\) bp. Those are two distinct overlap descriptions of the same peak–gene pair.

If the annotation were compared as though its start coordinate 1001 were already 0-based, the TSS and window would each shift by one base. That error happens not to eliminate this particular overlap, but it can change boundary decisions for peaks that touch only an endpoint. Conversion is therefore required even when an example’s final candidate list appears unchanged.

Assumptions, Diagnostics, and Common Failures

Coordinate mapping assumes that the peaks and annotations use the same genome assembly, chromosomes are represented consistently, interval endpoints follow the stated convention, and the chosen transcript annotations are appropriate for the analysis. It also assumes that the promoter-window definition is suitable for the purpose at hand. These are operational assumptions: they make the mapping reproducible, but they do not establish that a peak regulates the gene.

Useful checks include counting intervals with invalid or zero length, checking that peak and annotation chromosome names match, and confirming that converted interval lengths agree with the source convention. Inspect peaks near TSSs and chromosome boundaries by hand. Summarize how many peaks map to zero, one, or multiple genes and how many genes receive zero, one, or multiple peaks. Large unexpected numbers of zero or many-to-many mappings can indicate a coordinate or annotation mismatch, but can also reflect the chosen window size and genomic structure.

  • Off-by-one errors. A closed interval and a half-open interval treat endpoints differently. Convert first, then use one overlap formula throughout.
  • Ignoring strand. Applying a positive-strand window formula to a negative-strand gene reverses the meanings of upstream and downstream.
  • Mixing assemblies. Matching chromosome names is not enough if the coordinate reference differs.
  • Forcing a unique gene. A peak overlapping two promoter windows is ambiguous under the overlap rule. Do not resolve that ambiguity by arbitrary ordering.
  • Calling a match functional regulation. A coordinate match defines a candidate only. It does not show a regulatory effect, direction, or causal mechanism.

Window size creates a trade-off. A wider window captures more potential promoter-adjacent peaks but also increases the chance of overlapping nearby genes and producing ambiguous candidates. A narrow window reduces those matches but may omit peaks associated with alternative or more distant regulatory regions. Nearest-TSS mapping avoids requiring promoter overlap, while gene-body overlap has a direct interval interpretation; neither resolves function on its own. More elaborate evidence may be needed for regulatory conclusions, but such evidence is outside coordinate mapping itself.

Key takeaway: A defensible peak-to-gene map records the coordinate assembly, interval convention, annotation and transcript choice, strand-aware promoter-window dimensions, and assignment rule. Preserve multiple candidates when the rule supports them, and interpret every coordinate match as a mapping candidate rather than proof of regulation.

Check Your Understanding

Answer each question using the interval and strand conventions defined above. Short solutions follow the questions.

  1. A positive-strand transcript has TSS coordinate 3000. With \(U=200\) bp and \(D=50\) bp, what is its promoter window?
  2. A peak is \([2990,3010)\), and a promoter window is \([2800,3051)\). How many bases overlap?
  3. Why must the promoter window for a negative-strand transcript extend toward higher genomic coordinates for its upstream portion?
  4. A peak overlaps the promoter windows of two genes. What should be reported under an overlap mapping rule?
  5. What does a promoter-overlap mapping establish, and what does it not establish?

Solutions. (1) The window is \([3000-200,3000+50+1)=[2800,3051)\). (2) The peak is entirely inside the window, so the overlap is \(3010-2990=20\) bp. (3) Transcription proceeds from higher toward lower genomic coordinates on the negative strand, so upstream lies at higher coordinates. (4) Retain both peak–gene candidate pairs and report the ambiguity; the overlap rule does not select a unique target. (5) It establishes that the peak intersects a specified, strand-aware promoter interval for the annotated gene. It does not establish that the peak regulates that gene or causes a change in expression.

Clinical Biostats