MainHistone H3 lysine 9 (H3 K9) trimethylation, a canonical post-translational modification of constitutive heterochromatin, is known to spread over large genomic territories and repress gene expression9. These defining properties of heterochromatin were recognized in classic position–effect variegation studies in Drosophila during the 1930s, in which euchromatic genes placed near domains with trimethylated H3 K9 (H3K9me3) became transcriptionally silenced1,2. However, subsequent discovery of genes whose expression depends on their residence within heterochromatin revealed that this conflict is not absolute. For example, expression of the light (lt) and rolled (rl) genes in flies requires their position within pericentromeric heterochromatin3,4,5. In mice and humans, proper expression of olfactory receptor (OR) and KRAB domain-containing zinc-finger protein (KZFP) genes also depends on H3K9me3 heterochromatin6,7. These ‘escapee’ genes suggest the existence of specialized regulatory strategies that allow transcription to occur within, or despite, heterochromatin, raising fundamental questions about when heterochromatin facilitates versus restrains gene expression.The vertebrate clustered protocadherin (Pcdh) locus provides a striking example of a large gene family whose expression has been proposed to require escape from a heterochromatic environment10,11,12,13. Pcdh genes are expressed predominantly in neurons, where they govern neuronal self–non-self discrimination and circuit formation8. In individual neurons, only a small subset of Pcdh genes are expressed, whereas most remain silent8. Because selection of Pcdh genes is random and combinatorial14,15,16,17, this process generates extraordinary cell surface protein isoform diversity that marks each neuron with a unique identity, or ‘barcode’. Neurites presenting the same Pcdh barcode recognize and avoid one another, thereby preventing self-adhesion, whereas neurites presenting distinct Pcdh barcodes do not self-recognize and can interact18,19,20. Consistent with their critical role in neural circuit assembly, genetic variants in Pcdh genes are associated with neurodevelopmental and neuropsychiatric disorders, including autism spectrum disorder21,22 and schizophrenia23.In mice, there are 58 Pcdh genes distributed across three tandemly arranged clusters—α (Pcdha), β (Pcdhb) and γ (Pcdhg)—spanning roughly 1 megabase of DNA on chromosome 18 (ref. 24) (Fig. 1a). Pcdha genes are regulated by the HS5-1 enhancer located downstream of the Pcdha cluster, whereas Pcdhb and Pcdhg genes are regulated by the HS18-22 and HS16-17 enhancers, respectively, located downstream of the Pcdhg cluster25 (Fig. 1a). The Pcdha and Pcdhg genes are further subdivided into ‘alternate’ and ‘c-type’ isoforms24 (Fig. 1a). Pcdh genes and their promoters are marked by H3 K9 trimethylation and CpG DNA methylation (5mC)10,13,26. Stochastic Pcdh gene choice requires promoter DNA demethylation driven by cohesin-mediated enhancer–promoter interactions, with promoter demethylation leading to CTCF binding and sustained transcription of the respective Pcdh gene10,13,15,27,28. Although these findings have identified how Pcdh promoters escape DNA methylation, they do not address how euchromatic Pcdh enhancers navigate H3K9me3 heterochromatin to activate silent Pcdh promoters. Several questions remain unanswered. Specifically, do stochastic enhancer–promoter interactions occur within heterochromatin? Is Pcdh transcription carried out within a heterochromatic environment otherwise programmed to suppress gene activity, or must Pcdh loci escape this environment to transcribe? And, does heterochromatin contribute to the stochasticity of Pcdh promoter choice?Fig. 1: A compact heterochromatin domain containing Pcdh genes forms as the genes become activated during OSN development.Full size imagea, UCSC mm10 genome track showing ORCA probe design for the Pcdh locus. White rectangles, Pcdh genes. Dark rectangles, Pcdh enhancers. Coloured bars, imaged locus positions. b, Single-cell expression of Pcdh genes over OSN development. HBC, n = 710; GBC, n = 84; INP, n = 751; iOSN, n = 1,155; mOSN, n = 5,354. Box plots show medians, interquartile ranges and whiskers extending to non-outlier extrema within 1.5× interquartile range. Outliers are not shown. c, Experimental design. d, Left, example staining of OSN marker genes from sequential rounds of imaging. Right, Pcdh loci labelled by ORCA in the same cells. White spots, Pcdh loci. e, Top row, contact frequency maps of Pcdh loci across OSN development. Bottom row, difference maps relative to mOSNs. Locus positions corresponding to the Pcdha, Pcdhb and Pcdhg clusters are labelled. Black arrowheads, the HS5-1, HS16-17 and HS18-22 enhancers. Black arrowheads, enhancer–promoter contacts. Boxed regions, inter-cluster contacts. n, number of traces. f, Average contact frequencies in the boxed regions of e. g, H3K9me3 nChIP–seq over the Pcdh locus in FACS-isolated HBCs and mOSNs. Tracks show two merged replicates. Boxed regions, heterochromatin domain corresponding to the boxed regions in e. h, Cumulative H3K9me3 nChIP–seq signal over the heterochromatin domain. Points are biological replicates; n = 2 replicates per stage. Significance was assessed using Welch’s unpaired t-test, P = 0.034. *P < 0.05. i, Median distance to the geometric centre of the locus for each locus position across OSN development. j, Median heterochromatin domain Rg (left axis; n as in e) and mean number of alternate Pcdh isoforms expressed per cell (right axis; n as in b). All Pcdh genes plotted on the right axis lie within the heterochromatin domain plotted on the left axis. Error bars, s.e.m. k, Example ORCA traces from HBCs and mOSNs coloured by regions gaining H3K9me3. l, Model of Pcdh locus architecture in HBCs and mOSNs. Scale bar, 10 μm (d). Mb, megabase.Source dataChromatin tracing of the Pcdh locusTo answer these questions, we sought a single-molecule view of Pcdh locus architecture during development that included the positioning of active and inactive promoters. Until now, most insights into this relationship have come from bulk genomic analyses. At a locus where only a few genes are active while most remain silent, bulk measurements mainly reflect the non-chosen genes, effectively averaging out the features of the chosen ones. To circumvent this limitation, we used optical reconstruction of chromatin architecture (ORCA), a single-molecule chromatin tracing assay29, in olfactory sensory neurons (OSNs) of the mouse olfactory epithelium (OE). We selected OSNs for three reasons. First, they undergo multiple stages of development and constantly regenerate, such that each stage is present within the OE simultaneously. Second, Pcdh gene expression is developmentally regulated during OSN maturation15,20, with approximately one gene per cluster expressed from each allele in mature OSNs (mOSNs) (Fig. 1b and Extended Data Fig. 1a–c). Third, stochastic expression of Pcdh genes has a critical role in OSN axon wiring and odour map formation20,30,31.We designed ORCA probes that tile the Pcdh locus in 90 10-kilobase bins, omitting repetitive and GC-poor regions (Fig. 1a). ORCA probes were validated in OE sections from mice in which mOSNs were genetically labelled (Extended Data Fig. 2a). We visualized ORCA data as contact frequency matrices, which depict the frequency that each pair of locus positions (bins along the Pcdh locus) falls within a specified three-dimensional (3D) distance across all imaged traces. We set this threshold near the average distance between adjacent locus positions in an experiment. The contact frequency map obtained from ORCA correlated strongly with chromosome conformation capture Hi-C data of the same genomic bins from sorted mOSNs (Extended Data Fig. 2b,c, Pearson’s r = 0.87), and the correlation remained high across a sweep of ORCA contact thresholds (Extended Data Fig. 2d). ORCA data from whole OE tissue also remained consistent across separate experiments (Extended Data Fig. 2e,f, Pearson’s r = 0.98) and showed good detection efficiency across locus positions (Extended Data Fig. 2g). These results demonstrate that ORCA faithfully captures Pcdh locus architecture.To study how Pcdh locus architecture changes during Pcdh gene activation and neuronal maturation, we combined ORCA imaging of Pcdh DNA with RNA fluorescence in situ hybridization (FISH) labelling of the five major OSN developmental cell stages: horizontal basal cells (HBCs), globose basal cells (GBCs), immediate neuronal precursors (INPs), immature OSNs (iOSNs) and mOSNs (Fig. 1c). This lineage spawns from the mitotic HBC population located near the basal surface of the OE. As OSNs progress along their developmental axis, these cells migrate towards the apical surface of the OE (Fig. 1c). RNA labelling of marker genes for each stage reflected this basal-to-apical migration (Fig. 1d). We also stained samples with fluorescently tagged wheat germ agglutinin (WGA), a lectin that binds cell membranes, to obtain 3D segmentations of cells in the OE (Extended Data Fig. 3a). We mapped both RNA and Pcdh DNA puncta to these segmentations, then classified ORCA traces (that is, individual DNA paths) into different developmental stages on the basis of the RNA signal of the cells in which they resided (Extended Data Fig. 3b,c).Pcdh locus compaction over developmentThe contact frequency maps for each stage of OSN development illustrated two trends. First, stripes denoting contacts between Pcdh enhancers and their target promoters became more prominent as cells matured (Fig. 1e and Extended Data Fig. 1d–f). Second, contacts between locus positions containing Pcdhb genes and the alternate genes from the Pcdha and Pcdhg clusters, as well as the 60-kilobase stretch upstream of the Pcdha genes, increased (Fig. 1e,f). Subtracting the contact frequency map of each developmental stage from the mOSN map emphasized that these inter-cluster contacts constituted the most pronounced changes in locus architecture over development (Fig. 1e).The formation of these inter-cluster contact domains was reminiscent of the checkerboard pattern created by compartmentalization of active and repressed chromatin domains seen on Hi-C maps32. Given that this compartmentalization is mainly driven by homotypic interactions between heterochromatic regions of the genome, we hypothesized that the locus regions engaging in these contacts would have histone marks characteristic of heterochromatin. To investigate this possibility, we performed quantitative native chromatin immunoprecipitation sequencing (nChIP–seq) for H3K9me3 in FACS-isolated HBCs and mOSNs. In HBCs, the Pcdh locus was lightly coated in H3K9me3, with H3K9me3 levels increasing roughly threefold in mOSNs (Fig. 1g,h). Furthermore, in mOSNs, two major stretches of enriched H3K9me3 emerged separated by regions devoid of H3K9me3 between and beyond them (Fig. 1g). Specifically, the DNA regions of the Pcdh locus that engaged in inter-cluster contacts over OSN development became heavily coated with H3K9me3, whereas regions of the locus containing Pcdh c-type genes and enhancers remained free of H3K9me3 (Fig. 1e,g). We hereafter refer to the H3K9me3-marked chromatin regions engaging in inter-cluster contacts as the ‘heterochromatin domain’ of the Pcdh locus. This definition indicates the spatial arrangement of the regions within the Pcdh locus that are marked by H3K9me3 in OSNs. We refer to the regions of the locus not marked by H3K9me3 containing Pcdh c-type genes and enhancers as euchromatin.To understand the positioning of the heterochromatin domain within the architecture of the Pcdh locus, we calculated the distance of each locus position to the geometric centre of its respective trace and examined the median over all traces across each stage of development. All locus positions moved closer to the geometric centre as cells matured, indicating a general compaction of the locus (Fig. 1i). Layered on top of this trend, locus positions belonging to the heterochromatin domain moved closest to the centre (Fig. 1i, boxed regions), whereas euchromatic regions remained further in the periphery. To better quantify the degree of compaction of the heterochromatin domain, we measured its radius of gyration (Rg), a metric commonly used to describe the volume of a polymer, and found that Rg decreases as neurons mature (Fig. 1j). Surprisingly, as compaction increases, so does the number of genes expressed per cell from within the domain (Fig. 1j). We further visualized these changes in locus architecture by plotting individual traces coloured by regions that become heterochromatic or euchromatic over development and by examining single-molecule distance maps (Fig. 1k and Extended Data Fig. 4). Despite heterogeneity across traces, the formation of the domain was evident: in HBCs, both regions tended to occupy large and intermixed volumes, whereas in mOSNs, the regions segregated, with heterochromatin forming a dense, more centrally located domain and euchromatin occupying more open volumes in the periphery (Fig. 1k and Extended Data Fig. 4).Overall, these results indicate that in neural stem cells, the Pcdh locus is lightly coated with H3K9me3 heterochromatin, yet open and intermixed, with a compact heterochromatin domain forming in its centre as cells mature into post-mitotic neurons (Fig. 1l). Counterintuitively, the formation of this compact structure coincides with activation of Pcdh genes (Fig. 1j).Pcdh transcription from heterochromatinThese results could be explained by the presence of two distinct subpopulations—actively transcribing loci that transiently lose heterochromatin and silent loci that do not. Alternatively, actively transcribing loci could retain heterochromatin and their compacted architecture. Because our bulk measurements of H3K9me3 by nChIP–seq could not distinguish between these two possibilities, we turned to stochastic optical reconstruction microscopy (STORM) to measure H3K9me3 in single cells. We combined STORM for H3K9me3 with RNA FISH labelling of Pcdh isoforms and OSN cell types, as well as ORCA imaging of DNA, to test for colocalization of heterochromatin with transcribing Pcdh alleles (Fig. 2a). We used RNA probes against 11 Pcdh isoforms and confirmed their specificity for their target isoforms in vitro (Extended Data Fig. 5a,b).Fig. 2: Pcdh transcription occurs in H3K9me3-marked nuclear territories without disrupting heterochromatin domain compaction.Full size imagea, Experimental design. b, Example images of transcribing Pcdh loci in H3K9me3-marked nuclear territories. In the two rightmost columns, individual H3K9me3 STORM localizations and Pcdh DNA paths are shown, with the ORCA barcode corresponding to the transcribed gene labelled along with the detected nascent RNA punctum. DAPI staining reflects inverted nuclei found in mOSNs. c, Distribution of median STORM signal around randomly positioned loci across 1,000 simulations compared with the median STORM signal around observed Pcdh loci. STORM signal was defined as the number of H3K9me3 localizations within 324 nm (3 pixels) of a locus. Statistical significance was assessed using a one-sided empirical Monte Carlo test, for which the P value was calculated as the fraction of simulations with median STORM signal greater than or equal to the observed median. No adjustment for multiple comparisons was applied. d, H3K9me3 STORM signal around Pcdh loci with and without detected nascent transcription of any Pcdh isoform stained for. e, Heterochromatin domain Rg for Pcdh loci with and without detected nascent transcription of any Pcdh isoform stained for. f, H3K9me3 STORM signal around Pcdh loci with and without detected nascent transcription of specific Pcdh genes. STORM signal was measured within 324 nm of the ORCA barcode containing the Pcdh gene in question. g, Heterochromatin domain Rg for Pcdh loci with and without detected nascent transcription of specific Pcdh genes. H3K9me3 STORM signal in d and f is plotted as log10(signal + 1). For d–g, box plots show medians, notches representing approximate 95% confidence intervals for the median, interquartile ranges and whiskers extending to non-outlier extrema within 1.5× interquartile range. Outliers are not shown. Numbers indicate individual traces included in the analysis. Significance was assessed by a two-sided Wilcoxon rank-sum test; for gene-specific comparisons in f and g, P values were adjusted using the Benjamini–Hochberg procedure. NS, not significant; Txn, transcription. Scale bars, 1 μm (b, DAPI), 250 nm (b, rightmost insets).Source dataOverlaying Pcdh RNA staining on Pcdh DNA loci labelled by ORCA revealed DNA traces that colocalized with RNA puncta (Extended Data Fig. 6a). By measuring distances between Pcdh loci and Pcdh RNA puncta, we identified a data-driven distance threshold below which RNA transcripts could be classified as nascent (Extended Data Fig. 6b,c). RNA puncta within this threshold were brighter than those beyond it, consistent with nascent transcriptional bursting33 (Extended Data Fig. 6d).We then examined the spatial relationship between transcribing Pcdh DNA loci and H3K9me3 STORM signal in mOSNs. Remarkably, we observed many examples of nascent transcription occurring at Pcdh loci that colocalized with H3K9me3 STORM (Fig. 2b and Extended Data Fig. 7a). Plotting the ORCA traces of these loci alongside H3K9me3 STORM localizations revealed transcribing promoters spatially residing within heterochromatin (Fig. 2b and Extended Data Fig. 7a).To assess whether STORM captured a nuclear enrichment of H3K9me3 over the Pcdh locus, we quantified the number of H3K9me3 localizations surrounding Pcdh loci relative to randomized positions within the same nuclei. The median number of H3K9me3 localizations detected around Pcdh DNA loci exceeded that of randomized positions in 999 of 1,000 simulations (empirical P = 0.002) (Fig. 2c). We performed the same analyses on Tex15 loci, which are not marked by H3K9me3 as assayed by bulk nChIP–seq (Extended Data Fig. 7b–d). We used Tex15 nascent RNA transcripts as proxies for Tex15 DNA positions (Extended Data Fig. 7c,d). In contrast to Pcdh loci, Tex15 loci did not show an enrichment for H3K9me3 (empirical P = 0.292) (Extended Data Fig. 7d). Furthermore, we observed more Tex15 loci lacking any H3K9me3 signal compared with Pcdh loci (Extended Data Fig. 7e).We next asked whether Pcdh transcription was associated with reduced local H3K9me3 signal and domain compaction by first dividing loci into those with or without detectable nascent transcription, the latter of which we hereafter refer to as non-transcribing. We then measured the number of H3K9me3 STORM localizations around these loci and the Rg of their heterochromatin domains by ORCA. Surprisingly, transcribing Pcdh loci had slightly higher H3K9me3 STORM signal and slightly more compact heterochromatin domains relative to non-transcribing loci (Fig. 2d,e). Furthermore, transcription of individual Pcdh genes was associated neither with a change in H3K9me3 STORM signal around transcribing promoters, at the resolution of our assay, nor with a change in heterochromatin domain compaction (Fig. 2f,g).Overall, these analyses indicate that transcription of Pcdh loci can occur in H3K9me3-rich nuclear territories and does not disrupt the heterochromatin domain of the locus.Pcdh transcriptional readthroughThese data prompted us to further evaluate features of a transcribing Pcdh locus. To do that, we expanded the design of our RNA probes to a total of 31 Pcdh genes that showed appreciable staining and specificity (Extended Data Fig. 5a,b). We noted that nascently transcribing RNA puncta often colocalized with other Pcdh RNAs of the same cluster (Fig. 3a), and more nascent puncta were detected for progressively downstream isoforms at the Pcdha and Pcdhg, but not Pcdhb, clusters (Fig. 3b). Meanwhile, mature transcript levels measured by bulk RNA sequencing (RNA-seq) remained relatively flat across all clusters (Fig. 3b). We reasoned that these results could reflect nascent transcription of Pcdha and Pcdhg genes that reads through downstream isoforms (Fig. 3c). Yet, the number of nascent Pcdh RNAs detected at a locus was not associated with changes in heterochromatin domain Rg (Fig. 3d), indicating that this putative transcriptional readthrough occurs without domain decompaction.Fig. 3: Pcdh transcription reads through downstream genes and is associated with enhancer–promoter contact.Full size imagea, Example Pcdh RNA staining of Pcdha3, Pcdha6 and Pcdha11. Insets and field of view correspond to those in Extended Data Fig. 6a. b, Nascent RNA puncta detected by RNA FISH (left axis, dark grey bars) and bulk RNA-seq read counts (right axis, light grey bars) for stained Pcdh isoforms across each cluster. Nascent RNA puncta were quantified from one OE tissue section. For bulk RNA-seq, black dots represent biological replicates (n = 2). c, Schematic of Pcdh RNA labelling with the RNA FISH probes used under transcriptional readthrough. d, Heterochromatin domain Rg for Pcdh loci grouped by the number of nascent Pcdh RNAs detected per trace. Only nascent RNAs from Pcdh genes located in the heterochromatin domain were counted. Pearson correlation across all traces using ungrouped nascent RNA counts: r = 0.011, P = 0.156. Box plots show medians, notches representing approximate 95% confidence intervals for the median, interquartile ranges and whiskers extending to non-outlier extrema within 1.5× interquartile range. Outliers are not shown. Numbers indicate individual traces included in the analysis. e, Top, difference maps obtained by subtracting the contact frequencies of non-transcribing Pcdh loci from transcribing Pcdh loci for Pcdha3, Pcdha6 and Pcdha11. Bottom, change in contact frequency during transcription of each Pcdh RNA between HS5-1 and locus positions containing Pcdha promoters. Values correspond to boxed map regions. f, As in e for Pcdhb11, Pcdhb16, Pcdhb19 and HS18-22. Arrowheads denote matrix positions representing the contact frequency between each Pcdhb gene and HS18-22. g, As in e and f for Pcdhga2, Pcdhga5, Pcdhga8 and HS16-17. In e–g, maps are magnified to the genomic regions containing the enhancer–promoter interactions analysed. Locus positions corresponding to each cluster and enhancer are labelled. n, the number of individual traces included in the analysis. Scale bar, 10 μm (a). e–p, enhancer–promoter.Source dataTo identify features of locus architecture associated with transcription, we subtracted the contact frequency maps of non-transcribing loci from the maps of transcribing loci in mOSNs. This revealed an enrichment of enhancer–promoter contacts in transcribing loci (Fig. 3e–g), which was further supported by an increase in transcription probability as a function of enhancer–promoter proximity (Extended Data Fig. 8). For Pcdha and Pcdhg genes, these enhancer–promoter contact enrichments included promoters upstream of the transcribing isoform, and the magnitude of enrichment experienced by each promoter diminished when filtering on transcription of progressively downstream isoforms (Fig. 3e,g). By contrast, Pcdhb promoters had more local enhancer-contact enrichments upon transcription (Fig. 3f).Together, these data indicate that at the Pcdha and Pcdhg clusters, transcription of chosen promoters reads through downstream genes. This pattern is consistent with splicing of Pcdha and Pcdhg variable exons to three small constant exons located 3′ of these clusters34, and was not observed at the Pcdhb cluster, which lacks constant exons. Furthermore, these data indicate that Pcdh gene choice is driven by highly specific enhancer–promoter interactions across this multi-gene, multi-enhancer locus.Positioning of Pcdh genes and enhancersWe next asked where Pcdh transcription and enhancer–promoter interactions occur within the spatial architecture of the locus (Fig. 1l) and, in particular, whether transcribing promoters remain within or exit the heterochromatin domain. To assess the positioning of transcribing promoters, we measured the distances between promoters and heterochromatic locus positions in the presence and absence of transcription in mOSNs (Fig. 4a). These distances did not change during transcription (Fig. 4a). On the other hand, distances between promoters and euchromatic locus positions decreased during transcription (Fig. 4a). This effect seemed driven by decreased distances between promoters and enhancers upon transcription (Fig. 4b). These results indicate that enhancer–promoter contacts associated with transcription bring euchromatic locus positions closer to the heterochromatin domain, but neither these contacts nor transcription itself cause transcribing promoters to exit the domain. Plotting transcription probability as a function of a promoter’s distance to the heterochromatin centre supported this conclusion, as promoters were most likely to be transcribing at distances within the median Rg of the heterochromatin domain (Fig. 4c).Fig. 4: Pcdh genes transcribe from the heterochromatin domain and enhancers approach the domain to contact promoters.Full size imagea, Median distances of Pcdh promoters to all other heterochromatic and euchromatic locus positions in non-transcribing and transcribing traces. For each isoform, median promoter-to-heterochromatin (HC) and promoter-to-euchromatin (EC) distances were first calculated for each trace and then summarized by the median across traces. Each dot represents one Pcdh isoform, with paired points connected by grey lines. Black bars, median across isoforms for each transcription state. For promoter–HC distances: P = 0.466. For promoter–EC distances: P = 8.98 × 10−5. b, Median distances between Pcdh promoters and their respective enhancers in non-transcribing and transcribing traces. Each dot represents one Pcdh promoter–enhancer pair, with paired points connected by grey lines. Black bars, median across promoter–enhancer pairs for each transcription state. P = 0.019. Significance in a and b was assessed across isoforms or promoter–enhancer pairs using a two-sided Wilcoxon signed-rank test. *P < 0.05, ****P < 0.0001. c, Transcription probability as a function of promoter distance to the centre of the heterochromatin domain. Points represent the fraction of promoter observations classified as transcribing within each bin. Data were aggregated across all Pcdh isoforms included in the analysis. Grey bars, number of promoter-to-heterochromatin centre measurements per bin. Dashed line, median heterochromatin domain Rg across all traces. Bin size, 50 nm. Error bars, 95% Wilson binomial confidence intervals. For a–c, analyses included 28 Pcdh isoforms across 16,399 ORCA traces from mOSNs. d, Example ORCA traces of transcribing Pcdha3, Pcdhb16 and Pcdhga2 loci with and without enhancer–promoter contacts. The transcribed Pcdh gene is labelled in blue in each trace.Source dataTo further dissect the positioning of enhancers and promoters relative to the heterochromatin and euchromatin compartments of the locus during contact, we calculated the distances of each locus position to the centre of the heterochromatin domain (dHC) and the centre of the euchromatic region housing the cluster-specific enhancer(s) of that position (dEC) (Extended Data Fig. 9a). We examined Pcdhb16 as a case study. In non-transcribing traces and transcribing traces without enhancer–promoter contacts, Pcdhb16 was closer to the heterochromatin centre than the euchromatin centre, whereas its enhancer HS18-22 showed the opposite relationship (Extended Data Fig. 9a). In Pcdhb16-transcribing traces with enhancer–promoter contacts, Pcdhb16 and its enhancer HS18-22 were more equidistant to the two centres (Extended Data Fig. 9a). Further evaluation of the equidistant state showed that the dHC of both promoter and enhancer decreased during contact, but that the enhancer dHC decreased by a greater magnitude (Extended Data Fig. 9b), consistent with promoters remaining within the heterochromatin domain during contact and the enhancers approaching the domain to engage promoters (Fig. 4a,b). Extending these analyses to all other Pcdh genes stained for showed similar positionings of transcribing Pcdh promoters and cognate enhancers relative to their compartment centres: when in contact, promoters and enhancers became more equidistant to the two centres; when not in contact, promoters were closer to the heterochromatin centre than the euchromatin centre, whereas enhancers were closer to the euchromatin centre (Extended Data Fig. 9c,d). Quantifying the percentage of transcribing traces with and without enhancer–promoter contacts revealed the latter state to be more prevalent (Extended Data Fig. 9e), indicating that promoters transcribe at positions closer to the heterochromatin centre, and that Pcdh transcription can be sustained in the absence of enhancer engagement.Individual traces reflected the above behaviours. Transcribing promoters remained within the heterochromatin domain, and enhancers approached the domain to engage promoters (Fig. 4d).Heterochromatin and cohesin in Pcdh choiceLastly, we investigated the genome folding mechanisms that establish Pcdh locus architecture and how this architecture supports stochastic Pcdh gene choice. The wild-type (WT) locus architecture is defined by stripes corresponding to enhancer–promoter contacts and by inter-cluster contacts within the heterochromatin domain (Fig. 1e). To abolish enhancer–promoter contacts, we conditionally removed Rad21, the kleisin subunit of the cohesin protein complex, using an Omp-ires-cre;Rad21fl/fl;tdTomatofl/fl (Rad21 cKO) mouse (Extended Data Fig. 10a). To perturb heterochromatin compaction, we conditionally deleted Setdb1, the SET domain bifurcated histone methyltransferase 1, which catalyses di- and trimethylation of H3K9, using an Omp-ires-cre;Setdb1fl/fl;tdTomatofl/fl (Setdb1 cKO) mouse (Extended Data Fig. 10a). We confirmed knockout of Rad21 and Setdb1 in mOSNs by immunofluorescence (Extended Data Fig. 10b), then performed ORCA in both mouse models.Rad21 deletion abolished enhancer–promoter contacts as evidenced by a loss of stripes (Fig. 5a), consistent with previous reports10,13,15,27. By contrast, Setdb1 deletion resulted in a loss of inter-cluster contacts (Fig. 5a), which was accompanied by an approximately 40% reduction of H3K9me3 over the heterochromatin domain (Fig. 5b,c and Extended Data Fig. 10c). Furthermore, separation between heterochromatic and euchromatic regions of the locus increased in Rad21 cKO but decreased in Setdb1 cKO (Fig. 5d), whereas the relative size of the heterochromatin domain increased in Setdb1 cKO but decreased in Rad21 cKO (Fig. 5e).Fig. 5: Loop extrusion and heterochromatin compaction cooperate to shape Pcdh locus architecture and stochastic Pcdh gene choice.Full size imagea, Contact frequency maps of Rad21 cKO (left), WT (middle) and Setdb1 cKO (right) mOSNs. Black arrowheads, loss of enhancer–promoter contacts in the Rad21 cKO. Boxes, reduction of inter-cluster contacts within the heterochromatin domain in the Setdb1 cKO. n, number of individual traces used in the analysis. b, H3K9me3 nChIP–seq tracks from each genotype. c, H3K9me3 signal over the heterochromatin domain in WT and Setdb1 cKO. Each black dot represents one biological replicate (WT: n = 6; Setdb1 cKO: n = 3). Data were combined across three independent experiments for WT and two independent experiments for Setdb1 cKO. Bars indicate means. Significance was assessed using Welch’s unpaired t-test, P = 0.007. d, Separation scores for the HC and EC regions of the locus. In the schematic, red regions represent heterochromatin and grey regions represent euchromatin. e, HC domain size as a fraction of total locus volume in terms of Rg. For d and e, distributions are shown as violin plots. Horizontal lines and numbers indicate medians. Significance was assessed using a two-sided Wilcoxon rank-sum test with Benjamini–Hochberg correction. Adjusted P values for Rad21 cKO versus WT, WT versus Setdb1 cKO and Rad21 cKO versus Setdb1 cKO, respectively: P = 1.5 × 10−103, P = 3.6 × 10−101 and P