Abstract
Mechanistic understanding of how networks of neurons carry out neural computations requires knowledge of their underlying synaptic connectivity. However, current methods for reconstructing synaptic connections are extremely laborious and typically limited to mapping connections between nearby neurons. Here we developed Barcoded Rabies In Situ Connectomics (BRISC), which uses rabies viruses carrying random molecular barcodes to map both local and long-range monosynaptic inputs of hundreds of neurons in parallel. To ensure that the majority of post-synaptic starter neurons are uniquely labeled with distinct barcode sequences, we generated libraries of rabies viruses with sufficient diversity to label >1000 neurons and controlled the probability of barcode transmission between starter neurons by limiting their density. We applied BRISC to map inputs of single neurons in the mouse primary visual cortex. We read out the expression of viral barcodes in rabies-infected neurons in situ, preserving spatial information. We then matched barcode sequences between starter and presynaptic neurons, mapping the inputs of 385 neurons and identifying 7,814 putative synaptic connections, revealing layer- and cell-type-specific local connectivity rules and topographic organization of long-range inputs. These results show that BRISC can simultaneously resolve the synaptic connectivity of hundreds of neurons, enabling reconstruction of neural circuits at an unprecedented scale.
Subject terms: Neural circuits, Biological techniques, Striate cortex
By sequencing molecular barcodes transmitted by rabies viruses between connected cells, Barcoded Rabies In Situ Connectomics (BRISC) maps both local and long-range input of hundreds of neurons in parallel while preserving spatial information.
Introduction
Although recent years have seen dramatic advances in connectomics approaches based on volume electron microscopy, they remain limited to reconstructing single volumes up to ~1 mm31–3. The effort required to process a single volume makes it impractical to compare connectivity rules between different areas or experimental conditions, such as in models of psychiatric or neurological diseases. Adding to the challenge, recent transcriptomic studies have revealed a surprising diversity of cell types throughout the brain4–8, raising speculation that different transcriptomic cell types may subserve distinct computational roles owing to their differential connectivity9,10. Therefore, there is an acute need for methods that can read out synaptic connectivity with high throughput while preserving molecular information.
Over a decade ago, Zador and colleagues11 proposed that synaptic connectivity could be read out at a massive scale using DNA sequencing. By labeling individual neurons with unique oligonucleotide barcodes and having them transmit these barcodes to their synaptic partners, the connectivity matrix could be read out by matching barcode sequences across neurons. Owing to its scalability, this approach has the potential to revolutionize connectomics, but it has been challenging to implement for mapping connectivity in vivo12–15.
Rabies viruses can propagate transynaptically from infected neurons to their presynaptic partners and have been proposed as a potential vehicle for barcode transmission14–17. Conventional monosynaptic rabies tracing labels inputs to populations of interest using deletion mutant rabies viruses that lack the gene encoding rabies glycoprotein (G), which is essential for the generation of infectious virions18,19. Therefore, only cell populations where G expression is provided in trans, referred to as starter cells, can transmit the virus to their direct presynaptic partners19. As long as presynaptic cells do not express G themselves, the virus cannot propagate further, leading to monosynaptically restricted tracing.
Barcoded rabies tracing aims to map inputs to many starter neurons simultaneously while maintaining single-cell resolution not afforded by traditional bulk rabies tracing. By using rabies viruses that express random mRNA barcodes, connections between individual presynaptic and starter neurons are identified by matching their barcode sequences (Fig. 1a). An essential prerequisite for applying such an approach is the unique labeling of starter neurons with distinct barcode sequences. However, this has proved difficult to achieve in practice14,15. First, multiple starter cells may be infected by rabies virions carrying the same sequence during the initial viral injection. Second, non-unique labeling can also occur if starter cells transmit barcodes to one another. Both of these factors have hampered previous efforts to map connectivity using barcoded rabies viruses15. Although the generation of higher diversity libraries has since been reported, they have not yet been applied in vivo17.
Fig. 1. Generation and delivery of barcoded rabies virus libraries.

a BRISC experimental outline. b Rabies packaging schematic. c Barcoded rabies virus plasmid schematic. The barcode was integrated in the mCherry transgene 3' UTR. HDVagrz was replaced with a supercutter version. d Barcode abundance distribution of plasmid and viral libraries. e Proportion of uniquely labeled starter neurons as a function of the number of independent infections. The barcoded viral library has sufficient complexity to label >1000 starter cells. f Barcode abundance distribution of previously described barcoded rabies libraries, our low diversity library produced before optimizing viral packaging (RV2), and our high diversity library (RV35). g Same as (e), for f. Libraries label 95% of cells uniquely for the following number of independent infection events: Clark 2021—33, Saunders 2022—69, Zhang 2024—28, Shin 2024 N2c—35,728, Shin 2024 SADB19—151,931, Tan 2025 N2c—350, RV2—630, RV35—1320. h Predicted relationship between starter neuron density and the frequency of barcode transmission between starters. For 20 presynaptic cells per starter, the 5% probability of spread between starters (horizontal dashed line) corresponds to 384 cells per mm3 (vertical dashed line). i mCherry fluorescence in mouse brain infected with barcoded rabies in primary visual cortex, imaged using serial two-photon tomography (n = 1 injection). Maximum intensity projection over 0.5 mm. Scale bar—1 mm. j Identification of starters from i, based on nuclear mCherry fluorescence (maximum intensity projection spanning 4.8 μm, blue—DAPI, red and green—mCherry with different contrast limits, see “Methods”, n = 1 injection) Scale bar—20 μm. k Density of rabies-infected neurons as a function of distance to the injection site. l mCherry fluorescence in mouse visual cortex infected locally with Cre-dependent AAV helper and either intracerebral or intravenous injection of AAV-Cre (n = 1 injection per condition). Scale bar—250 μm. m Spatial distribution of detected mCherry cells from intracerebral or intravenous AAV-Cre injections. n Kernel density estimates (KDEs) of the distribution of pairwise distances between mCherry-positive cells in intracerebral/intravenous AAV-Cre injections, median distances (triangles)—0.20 mm, 256 cells, and 0.35 mm, 114 cells, respectively. Source data are provided as a Source Data file.
Here, we describe the development of Barcoded Rabies In Situ Connectomics (BRISC), which overcomes these obstacles to map putative presynaptic ensembles of hundreds of starter neurons simultaneously. BRISC uses libraries of rabies viruses with sufficient diversity to uniquely label >1000 starter neurons while ensuring that >95% of them carry unique barcodes. To minimize the frequency of transmission of barcodes between starter neurons, their density is tightly controlled by limiting dilution of an AAV expressing Cre-recombinase. In contrast to Cre delivery targeting specific transcriptionally or anatomically defined cell types15, the stochastic infection of starter neurons by AAV-Cre enables BRISC to map inputs of diverse cell populations simultaneously. After allowing the rabies virus to spread from starter to presynaptic neurons, barcodes are read out from intact tissue sections using in situ sequencing, preserving spatial information.
We applied BRISC to map monosynaptic inputs onto single neurons in the mouse primary visual cortex (V1). First, by reconstructing local connectivity, we identified layer-specific connectivity rules that are consistent with the established wiring patterns of V1. Second, by combining BRISC with in situ sequencing of cell-type marker transcripts, we demonstrate its potential to relate the connectivity of individual neurons to their molecular identity. Finally, by applying BRISC to map the spatial distribution of long-range inputs, we reveal the topographic organization of corticocortical inputs onto single V1 neurons. Together, these results demonstrate the potential of BRISC for high-throughput reconstruction of both long-range and local microcircuits.
Results
Generating high diversity barcoded rabies libraries
Identification of individual synaptic connections using barcoded rabies tracing depends on the unique labeling of starter neurons by distinct barcode sequences. We chose the CVS-N2c(ΔG) strain of rabies virus as the basis for generating diverse barcoded viral libraries. Compared to the widely used SAD-B19(ΔG) strain, CVS-N2c(ΔG) shows enhanced transsynaptic spread and lower neuronal cytotoxicity20. We first optimized the production of high-diversity barcoded rabies libraries. The rescue of infectious rabies virus particles from plasmid DNA is technically challenging because rabies has a negative-sense RNA genome. The genome cannot be directly translated by the host cell and must be encapsidated by the viral nucleoprotein (N) to form a ribonucleoprotein (RNP) complex that is recognized by the viral polymerase. Therefore, viral rescue involves transcribing the antigenome, a positive-sense complement of the genome, which is then encapsidated by viral proteins (N, P, and L) provided by helper plasmids to initiate replication. This rescue is highly inefficient21 and therefore constitutes the primary bottleneck reducing library diversity14. Successful encapsidation and replication of the viral RNA relies critically on the precise sequence of the 5’ and 3’ ends22. To produce these, self-cleaving RNA structures called ribozymes have been engineered to flank the viral sequence23. Upon transcription, these ribozymes autocatalytically cleave the RNA, releasing the viral antigenome with the exact termini required for replication (Fig. 1b). Previously described plasmids for rescue of CVS-N2c(ΔG) contain an incomplete sequence of the hepatitis delta virus antigenomic ribozyme (HDVagrz) responsible for generating the 3’ end of the viral antigenome24. This truncated form exhibits reduced cleavage efficiency relative to the full-length ribozyme. The efficiency of this self-cleavage directly limits the number of successful rescue events, creating a bottleneck that reduces library diversity14. To improve rescue efficiency, we first inserted the full-length HDVagrz in the CVS-N2c(ΔG) genome plasmid. Then, we inserted a 20-nucleotide random barcode sequence downstream of an mCherry transgene in the CVS-N2c(ΔG) genome by inverse PCR (Fig. 1c).
We used the resulting plasmid library to package barcoded rabies viruses and optimized the viral packaging protocol to improve the diversity of the viral library (see “Methods”). We quantified the diversity of the plasmid and the resulting viral libraries using Illumina sequencing (Fig. 1d). As a consequence of the bottleneck imposed by the inefficiency of rabies virus rescue, the resulting viral library contained five-fold fewer unique barcodes than the plasmid library (2.8 × 106 barcodes in the plasmid library compared to 5.3 × 105 in the viral library). Furthermore, while the 100 most abundant barcodes accounted for only 0.06% of the plasmid library, they comprised 3.9% of the viral library. These results demonstrate that the diversity of barcoded virus libraries is constrained by both the inefficiency of viral rescue and the uneven amplification of viral barcodes during subsequent viral production steps.
We next calculated how many neurons could be labeled uniquely if barcodes were randomly sampled from each library based on their abundance distributions (Fig. 1e)25. The plasmid library had sufficient diversity to label >80,000 cells while ensuring that 95% of them received unique barcodes. The same threshold was reached at 1320 cells for the viral library. Therefore, the resulting barcoded viral libraries have sufficient diversity to trace inputs of >1000 starter neurons despite the reduction in barcode diversity during viral packaging, surpassing most previously described barcoded rabies libraries (Fig. 1f, g)14,15,17,26,27.
We then asked how the diversity of the rabies viral library depends on the scale of viral rescue. Compared to a library generated from transfection of 12 wells, a library generated from 2 wells had a substantially lower diversity, sufficient to label only ~132 neurons with the same 95% unique threshold (Supplementary Fig. 1). This indicates that viral rescue constitutes a key bottleneck in the production of barcoded rabies viruses, suggesting that library diversity could be further improved by increasing its scale.
Controlling starter neuron density
Non-unique labeling of starter neurons can also result from the transsynaptic spread of viral barcodes between starters. Under the simplifying assumption of random connectivity, the probability that a given starter neuron will transmit its barcode to another starter cell is determined by the number of neurons transsynaptically infected by each starter cell, and by the proportion of neurons at the injection site that are starter cells (Fig. 1h, see “Methods”). To determine the average number of nearby cells labeled by each starter neuron, we injected starter AAVs FLEX-H2B-mCherry-P2A-N2cG and FLEX-H2B-EBFP2-P2A-TVA in the mouse primary visual cortex (V1) alongside low-titer AAV hSyn-Cre to control starter cell density, followed by CVS-N2c(ΔG) mCherry barcoded rabies virus (Fig. 1i). We then quantified the distribution of rabies-infected cells throughout the brain and the number of starter neurons at the injection site. Starter neurons were identified based on nuclear fluorescence of the H2B-mCherry-P2A-N2cG construct (Fig. 1j, see “Methods”). On average, we detected 66.6 presynaptic neurons per starter (17,505 presynaptic neurons for 263 starter cells). As the expression of starter AAVs is restricted to the injection site, local but not long-range transsynaptic spread can lead to the transmission of barcodes between starter neurons. Therefore, we quantified the density of rabies-infected neurons as a function of distance from the injection site (Fig. 1k). As expected, the density was highest near the center of the injection site, with each starter neuron infecting an average of 20.9 presynaptic cells within 0.5 mm of the injection center. Together, these observations suggest that to limit the proportion of starter neurons that transmit their barcodes to other starter cells to <5%, the proportion of starter cells at the injection site must be limited to 2.6 × 10−3, which corresponds to a density of ~400 starter cells per mm3 (Fig. 1h, see “Methods”). As the probability of transsynaptic spread rapidly drops off with distance, in an ideal scenario starter neurons would be uniformly distributed throughout the brain region of interest. However, stereotactic injection of starter AAVs inevitably results in the clustering of starter neurons. This would lead to a high local density of starter cells, thereby increasing the probability of barcode transmission between them. To control the density of starter neurons while minimizing their spatial clustering, we used tail vein injections of blood-brain-barrier penetrating AAV PHP.eB hSyn-Cre28. Intravenous delivery resulted in a more uniform distribution of starter cells compared to local intracerebral injection (Fig. 1l-m) with a similar number of presynaptic cells labeled per starter neuron (Supplementary Fig. 2a–c). Consequently, the pairwise distances between starter cells were higher after intravenous delivery of Cre compared to intracerebral delivery (Fig. 1n).
Finally, to determine the conditions necessary to achieve the desired density of starter neurons, we injected serial dilutions of AAV PHP.eB hSyn-Cre into tdTomato Cre reporter mice and quantified the number of tdTomato-positive neurons throughout the brain using serial two-photon tomography. The density of cells expressing Cre scaled with increasing titers of AAV (Supplementary Fig. 2d). Therefore, systemic delivery of AAV PHP.eB hSyn-Cre provides a means to control the density of starter neurons in order to limit the probability of transsynaptic spread between them.
In situ sequencing of rabies viral barcodes
We next applied BRISC to systematically map synaptic inputs of V1 neurons. We used a tail vein injection of AAV PHP.eB hSyn-Cre and stereotactic injections of AAVs FLEX-H2B-mCherry-P2A-N2cG and FLEX-H2B-EBFP2-P2A-TVA to induce sparse expression of TVA and N2cG from starter AAVs. We made three injections arranged along the mediolateral extent of the primary visual cortex, allowing us to sample starter neurons across different layers, cell types, and retinotopic coordinates of V1. Thirteen days later, we injected the barcoded rabies virus library described in Fig. 1c–e at the same three injection sites as the AAVs. We allowed the barcodes to spread to presynaptic neurons for 7 days before collecting the brain tissue (Fig. 2a).
Fig. 2. Sequencing rabies virus barcodes in situ.

a Virus injection timeline. Three injections were arranged along the mediolateral extent of primary visual cortex at the same anterior-posterior location. b Schematic of the protocol for sequencing rabies virus barcodes alongside cell type marker transcripts. c Extent of the in situ sequencing volume in the mouse brain. d Nuclear mCherry fluorescence identifies starter neurons expressing G glycoprotein. Scale bar—50 μm. e Example sequencing round during in situ sequencing of cell type marker transcripts. Scale bar—50 μm. f Example sequencing round of rabies virus barcodes. Dashed and solid rectangles indicate the image regions depicted in (d, e, g), respectively. Scale bar—250 μm. g Three example neurons infected with barcoded rabies virus across sequencing rounds. Scale bar—20 μm. h UMAP representation of cell type marker gene expression across cells, color-coded according to their assigned cell type. i Distribution of rabies-infected cells in UMAP space. j Cells color-coded according to expression levels of example marker genes (projection of 10 coronal sections). Data in (c–j) from n = 1 mouse. Source data are provided as a Source Data file.
Ensuring that starter neurons are uniquely labeled requires dense sequencing to capture the majority of starter neurons, precluding the use of single-cell or single-nucleus RNA sequencing, which recovers only a subset of infected neurons14,15. To overcome this, we developed a strategy for sequencing rabies virus barcodes in situ alongside endogenous transcripts for cell type identification based on BARseq2 and coppaFISH (see “Methods”)29–31. This method uses rolling circle amplification followed by sequencing-by-synthesis from intact tissue sections (Fig. 2b), which is performed by imaging the tissue over multiple sequencing rounds to read out barcode sequences. Recovering all starter neurons in a barcoded rabies tracing experiment by in situ sequencing requires imaging tens of tissue sections, which limits the throughput of barcoded rabies tracing experiments. To increase the speed of data acquisition, we designed custom sequencing flowcells and an imaging setup based on a conventional epifluorescence microscope, which allowed for the parallel imaging of the four fluorophores associated with each DNA base. This enabled the simultaneous sequencing of up to 40 coronal sections of mouse brain (Supplementary Fig. 3). We processed serial cryosections spanning 800 μm of brain tissue along the anterior-posterior axis, covering a total imaging volume of ~12 mm3 (Fig. 2c). We sequenced 10 nucleotides of the viral barcode as the number of starter cells that could be uniquely identified plateaued at that length (Supplementary Fig. 4, see “Methods”).
Nuclear localized H2B-mCherry expressed from AAV FLEX-H2B-mCherry-P2A-N2cG is preserved in cryosections, allowing the detection of starter neurons without any further staining (Fig. 2d). The sequenced volume contained 92% of all mCherry-positive cells across the injection site (Supplementary Fig. 5a, see “Methods”). Based on the distribution of presynaptic cells in bulk tracing experiments (Fig. 1i–k), we estimated that the sequenced volume included approximately 44% of all presynaptic cells across the brain (Supplementary Fig. 5b). We then sequenced the transcripts of a panel of 98 cell-type marker genes (Fig. 2e, j, Supplementary Fig. 5c), selected to facilitate the classification of V1 cell types, followed by the rabies virus barcode (Fig. 2f, g). Finally, we used in situ hybridization to measure the expression of highly expressed cell-type marker genes, followed by DAPI staining to assist with cell segmentation. Barcodes were assigned to cells using a probabilistic algorithm that relies on spatial clustering of barcodes near the infected cell nucleus (see “Methods”). We used the expression of cell-type marker transcripts to classify cells into major cortical cell types (Fig. 2h). Excitatory neuronal cell types displayed their expected laminar biases (Supplementary Fig. 6). Rabies-infected cells were intermingled with uninfected cells in UMAP space and were assigned to clusters corresponding to major cell types of V1 (Fig. 2i), indicating that rabies infection did not interfere with cell-type identification.
We classified rabies-infected neurons as starter cells if they expressed H2B-mCherry or as presynaptic cells if they did not, and examined the barcode sequences present in individual cells. The majority (93%) of rabies-infected neurons contained only one barcode (Fig. 3a), although starter cells were more likely to contain multiple barcodes than presynaptic cells. This finding is consistent with previous studies14,16 and is likely a consequence of multiple EnvA/TVA-mediated infection events occurring per cell in starter neurons after viral injection.
Fig. 3. Specificity and sensitivity of in situ barcode detection.

a Number of barcodes detected in individual presynaptic and starter neurons. Most presynaptic neurons express a single barcode, while some starter neurons express >1. b Barcodes detected in situ (solid blue line) reflect the abundance distribution of the viral library (black). In contrast, random barcodes (dashed blue line) were rarely found in the library and typically match low abundance barcodes. c Number of starter cells per detected barcode sequence. d Number of presynaptic cells for orphan barcodes and barcodes found in at least one starter. Orphan barcodes are typically found in a small number of cells. e Number of barcode transcripts detected in rabies-infected neurons identified using probes targeting rabies viral transcripts (n = 1489 cells). Dotted line indicates cells with <3 barcode spots. Inset image shows rabies viral transcripts in red and rabies barcode transcripts in cyan. Scale bar—20 μm. f mCherry fluorescence intensity in starter neurons is correlated with the efficiency of transsynaptic spread (r(375) = 0.30, p = 2.6 × 10−9, 95% CI = [0.21, 0.39], for two-sided Pearson correlation test of log-fluorescence and log (number of presynaptic cells + 1), n = 377 starters, shading indicates regression slope 95% confidence interval). Source data are provided as a Source Data file.
In total, we detected 2,158 distinct barcode sequences in rabies-infected cells. 96.2% of these barcodes precisely matched sequences in the RNA sequencing library derived from the barcoded viral prep, compared to only 37.9% of randomly generated barcodes. The probability of finding a barcode in situ was proportional to their abundance in the sequencing library (Fig. 3b), validating the fidelity of barcode detection in situ. In contrast, random barcode sequences tended to correspond to low-abundance sequences in the library (Fig. 3b).
Among these barcodes, 564 were found in starter neurons. The majority of these were found in exactly one starter cell (Fig. 3c). The remaining 1594 orphan barcodes that were not found in any starter cells were typically found in a small number of presynaptic cells (Fig. 3d). We considered several factors, which could explain the presence of these orphan barcodes: direct infection of non starter cells during the initial virus injection, failure to detect starter neurons due to the sensitivity limits of barcode sequencing or mCherry fluorescence detection, and the death or loss of starter neurons before sequencing.
Neurons infected by the CVS-N2c strain of rabies virus have previously been shown to remain viable for at least 2 weeks20. Since the tissue in our experiments was collected 1 week after rabies injection, extensive rabies-induced cell death is unlikely. However, we cannot exclude that some of the orphan barcodes could result from the death of starter neurons due to rabies cytotoxicity.
Orphan barcodes could also result from direct infection of mCherry-negative cells during the initial virus injection as a consequence of contamination by G-coated rabies virus or leaky TVA expression. To quantify the frequency of infection by G-coated rabies virus, we injected the barcoded rabies virus without injecting starter AAVs and quantified the number of rabies-infected neurons around the injection site (Supplementary Fig. 7a, n = 2, 4 and 5 neurons). We also injected AAV FLEX-H2B-EBFP2-P2A-TVA without AAV PHP.eB hSyn-Cre or AAV FLEX-H2B-mCherry-P2A-N2cG. This was followed by rabies injection after 14 days to determine the rate of direct rabies infection due to leaky TVA expression (Supplementary Fig. 7b, n = 2, 9 and 17 neurons). As the number of rabies-infected neurons detected in these experiments was far fewer than the 11,445 presynaptic cells expressing orphan barcodes observed in our in situ sequencing data, orphan barcodes cannot be explained by contamination from G-coated rabies virus or leaky TVA expression.
Orphan barcodes could also result from the missed detection of starter neurons due to the limited sensitivity of barcode detection. To quantify this sensitivity, we designed a panel of probes targeting the transcripts of N, P, M, and L rabies virus genes, which allowed us to reliably detect rabies-infected neurons in situ (Fig. 3e, inset). We found that 17.5% of rabies-infected neurons contained <3 barcode spots and therefore, would not be identified in the sequencing experiments described above (Fig. 3e). Therefore, while identification of starters and presynaptic neurons may be limited by the sensitivity of barcode detection, it cannot fully account for the frequency of orphan barcodes and the fact that the majority of them are present in <5 presynaptic cells.
Alternatively, orphan barcodes could originate from starter neurons with low mCherry expression that fall below our detection threshold. Since H2B-mCherry is co-expressed in a bicistronic cassette with N2cG via a P2A ribosome skipping peptide sequence, cells with low mCherry expression are likely to express low levels of N2cG32, resulting in inefficient transsynaptic spread33,34. This would explain the observation that orphan barcodes are typically found in a small number of presynaptic neurons (Fig. 3d). To explore this possibility, we selected barcodes found in exactly one starter neuron and quantified mCherry fluorescence intensity in the starter cell. We found that mCherry fluorescence was correlated with the number of presynaptic cells with the same barcode sequence (Fig. 3f). Together, these findings suggest that the excess of orphan barcodes with small numbers of presynaptic cells originates from starter neurons that fell below the mCherry detection threshold.
Among barcodes found in starter neurons, 442 were found in exactly one starter, while 122 were found in multiple starter cells (Fig. 3c). As discussed above, barcodes present in multiple starter neurons could result from initial infection by virions carrying the same sequence or transsynaptic spread between starters. To distinguish between these possibilities, we first asked whether barcodes present in multiple starter neurons were more abundant in the viral library (Supplementary Fig. 8a, b). These barcodes largely followed the abundance distribution of the viral library, with only a small excess of high-abundance sequences among barcodes present in multiple starters (6.6%, 8/122 barcodes). In addition, the median pairwise distance between starter cells sharing a barcode was shorter than between those labeled with different barcode sequences (Supplementary Fig. 8c). Together, these observations suggest that non-uniquely labeled starter cells primarily result from transmission of barcodes between starters. Barcodes present in >1 starter cell were excluded from further analyses.
Barcoded rabies tracing reveals spatial organization of presynaptic ensembles of single neurons
We next analyzed the spatial distribution of starter and presynaptic neurons by registering in situ sequencing data to the Allen Common Coordinate Framework reference atlas35. The majority (93.2%) of starter neurons were located in V1, distributed along the mediolateral axis following the locations of rabies virus injections (Fig. 4a). On the other hand, presynaptic neurons were more broadly distributed and were found in higher visual areas, retrosplenial cortex, temporal association area, auditory areas, and lateral geniculate nucleus in the thalamus. Within V1, starter neurons were most densely concentrated within layers 2/3 and 5 (Fig. 4b), potentially reflecting the tropism of AAV PHP.eB36,37, while presynaptic cells were more broadly distributed.
Fig. 4. Presynaptic ensembles of barcoded starter neurons.

a Spatial location of starter neurons (black) and presynaptic cells. Presynaptic cells are color-coded according to brain area. Left - coronal projection, area outlines correspond to the coronal plane at the center of the sequencing volume, right - cortical flatmap. Scale bar—1 mm. b KDEs of the layer distribution of starter and presynaptic neurons in V1 in cortical flatmap coordinates. c Number of starter cells connected to each presynaptic cell. d Barcodes present in presynaptic cells for starter cells expressing multiple unique barcodes. Starter cells almost always only transmit one barcode to presynaptic neurons. e Spatial location of starter and presynaptic neurons for 3 example barcodes. Left - coronal projection, right - cortical flatmap centered on the visual cortex. Scale bar—1 mm. f Location of presynaptic cells relative to starter neurons in cortical flatmap coordinates compared to shuffle control. g KDE of relative mediolateral location of presynaptic cells with respect to starter cells. Presynaptic cells are clustered near starter cells. Shaded area indicates 95% confidence interval of the shuffle control (see “Methods”). Source data are provided as a Source Data file.
We analyzed the putative presynaptic sub-networks of starter neurons expressing barcodes that were found in exactly one starter cell. The majority of presynaptic cells were connected to one such starter neuron, although some contained barcodes from multiple starter cells (Fig. 4c). For starter neurons that expressed multiple barcodes, presynaptic neurons almost always received only one of them (Fig. 4d).
Superinfection exclusion has been reported to prevent re-infection by rabies viruses after a primary rabies infection has been established in a cell38. To determine whether superinfection exclusion could explain the low frequency of presynaptic cells connected to multiple starters, we compared the distribution of the number of starter neurons connected to each presynaptic cells to a Poisson model assuming independent barcode transmission (Supplementary Fig. 9). The observed frequency of presynaptic cells matching >1 starter was greater than expected from the Poisson model, suggesting that this frequency reflects the sparseness of rabies infection rather than active exclusion.
We considered all neurons expressing any of the unique barcodes present in a given starter cell as a part of its presynaptic sub-network. On average, we detected 20.3 presynaptic cells for every uniquely labeled starter neuron. As the sequenced volume contained the majority of starter cells but only ~44% of their presynaptic inputs (Supplementary Fig. 5b), this figure underestimates the overall efficiency of transsynaptic spread.
Presynaptic neurons connected to V1 cells were found both within V1 and in other cortical areas (Fig. 4e). They tended to cluster near their starter cell (Fig. 4f, g, median distance 0.73 mm vs 1.14 mm for shuffle control, p-value = 0.002, n = 385 starter cells, 7693 presynaptic cells, 7814 connections, see “Methods”), consistent with the fact that the connection probability of cortical neurons rapidly decreases with intersomatic distance39,40.
Layer- and cell-type-specific connectivity rules
Focusing on the connectivity of excitatory neurons, we analyzed the layer distribution of local (<1mm) presynaptic inputs as a function of the layer location of the starter cells (Fig. 5a). We first computed the input fraction, i.e., the proportion of excitatory inputs across different cortical layers for starter neurons across cortical layers, revealing layer-specific input patterns (Fig. 5b–d). Most notably, neurons in layer 2/3 were strongly recurrently connected, receiving 42% of their local excitatory inputs from other layer 2/3 cells. Their second strongest input arose from layer 4, reflecting the well-established pathway through which feed-forward sensory signals are conveyed to layer 2/3 neurons41. Neurons in layer 5 were also recurrently connected and received strong layer 2/3 input. Finally, layer 6a received broad input from both superficial and deep layers. These findings are consistent with the canonical organization of the cortical circuit and bulk rabies tracing data42.
Fig. 5. BRISC reveals layer- and cell-type-specific connectivity patterns.

a Relative mediolateral location and cortical depth of presynaptic cells connected to starter neurons across cortical layers in cortical flatmap coordinates. Black—starter cells; red—presynaptic cells. Scale bar—200 μm. b Number of presynaptic neurons for starter cells across cortical layers (left) and their input fractions (right). c Input fractions for starter cells across cortical layers (Black lines indicate means, n = 85, 34, 119, 9, and 2 starter cells, with 646, 480, 1844, 53, and 8 presynaptic cells for layer 2/3, 4, 5, 6a, and 6b respectively). d Graphical representation of input fractions in (b, c). Only connections representing >0.2 of inputs to a given starter population are shown. Arrow width is proportional to connection strength; color represents the width of the confidence interval. e Input fraction compared to shuffle control. The radius of the bubbles indicates effect size, i.e., the log-ratio of observed and shuffle control input fractions. The color of the bubbles indicates significance and direction of the effect, with red and blue hues representing over- and under-representation compared to shuffle control, respectively. Solid outline indicates statistical significance, two-sided permutation test p-values, 5% false discovery rate corrected (Benjamini-Hochberg). f Output fraction across cortical layers. g Output fraction compared to shuffle control. Notation as in panel (e). h Inhibitory cell type marker gene expression across Pvalb, Sst, Lamp5, and Vip interneurons. Mean normalized and log1p-transformed expression of each gene was rescaled to 1 across cell-type clusters. i Number of presynaptic interneurons (left) and input fraction (right) of starter neurons across interneuron classes. j Graphical representation of input fractions in (i). Notation as in (d). Source data are provided as a Source Data file.
Next, to identify over- and under-represented connections, we compared the observed connectivity matrix to a shuffle distribution, where we randomly permuted the barcodes assigned to presynaptic neurons (Fig. 5e). This analysis preserves the relative abundance of neurons across cortical layers, controlling for the tropism of starter AAVs and potential biases in the transsynaptic spread of rabies virus. It confirmed that starter neurons located in layer 2/3 preferentially received input from other layer 2/3 cells, as well as layer 4 neurons, and were less likely to receive inputs from deep cortical layers.
We next analyzed the connectivity matrix from the perspective of presynaptic neurons and computed the layer distribution of starter neurons as a function of presynaptic cell layer (Fig. 5f). As these output fractions are biased by the distribution of starter cells, we used the shuffling procedure described above, which maintains the distribution of starter cells and the number of presynaptic cells per starter, and compared the observed output fractions to the shuffle distribution (Fig. 5g). We found that layers 2/3 and 4 preferentially target layer 2/3 neurons but are less likely to target layer 5. On the other hand, layers 5, 6a, and 6b preferentially target layer 5 and are less likely to project to layers 2/3 and 4. Together with the analysis of input fractions, these results demonstrate that BRISC can identify layer-specific connectivity rules of excitatory neurons.
By sequencing the transcripts of cell-type marker genes alongside viral barcodes, BRISC makes it possible to relate input connectivity of individual neurons to their molecular identity. To demonstrate this, we focused on connectivity between GABAergic interneuron cell types in V1. We identified rabies-infected neurons belonging to 4 inhibitory neuron cell types: somatostatin- (Sst), parvalbumin- (Pvalb), vasoactive intestinal peptide- (Vip) and Lysosomal Associated Membrane Protein Family Member 5 (Lamp5) expressing neurons5 (Fig. 5h). We analyzed the inter-connectivity of these inhibitory cells in the same manner as for excitatory neurons by computing the input fraction onto each interneuron class (Fig. 5i, j). Pvalb interneurons were most frequently interconnected, consistent with connectivity measured using multiple patch clamp recordings40. Sst interneurons received input from Pvalb and Vip cells, the latter connection representing a well-established disinhibitory circuit motif40,43. Finally, Lamp5 and Vip interneurons received strong inputs from Sst and Pvalb cells. However, our sample size (3 Vip starter cells and 2 Lamp5 starter cells) is insufficient to make strong conclusions.
Long-range connectivity
Previous work has shown that the connections between the primary visual cortex and higher visual areas are topographically organized, linking areas representing the same part of the visual field44. Our rabies injections spanned the primary visual cortex along the mediolateral axis, which largely corresponds to the azimuth axis in retinotopic space45. Therefore, we analyzed how the spatial location of presynaptic neurons was related to the mediolateral position of their starter cell (Fig. 6a–c). Within V1, presynaptic cells tended to make connections onto starter cells at a similar mediolateral location, consistent with the spatial clustering of presynaptic cells near the starter cell. Consequently, the locations of connected presynaptic and starter cells were positively correlated within V1 (Fig. 6e). However, this relationship did not extend outside of the borders of V1. Instead, this gradient was reversed for presynaptic neurons located in cortical areas lateral to V1, where more laterally located presynaptic neurons were more likely to project to medially located starter cells. This organization reflects the reversal of the azimuth tuning gradient at the lateral boundary of V1 (Fig. 6d, f)45,46.
Fig. 6. BRISC identifies topographic organization of long-range inputs onto single neurons.

a Flatmap projection of the location of presynaptic neurons connected to V1 starter cells, color-coded by the mediolateral (ML) position of their starter cells in flatmap coordinates. Scale bar—1 mm. b Starter cells color-coded by their ML position on the flatmap projection. Gray - all presynaptic cells. c Map of average starter ML position for all cells in (a). d Visual azimuth map of cortical visual areas based on data from Waters et al.82 (see “Methods”). e Starter cell ML position as a function of the presynaptic cell position. Black - individual cells, purple—Gaussian kernel density estimate (see “Methods”). Shading indicates 95% confidence intervals computed by bootstrap resampling of starter cells. f Expected preferred receptive azimuth of presynaptic cells given their spatial location (see “Methods”). Source data are provided as a Source Data file.
Discussion
Here we describe the development of Barcoded Rabies In Situ Connectomics, BRISC, for high-throughput reconstruction of synaptic connections in the brain. Identification of individual synaptic connections using barcoded rabies viruses relies on unique labeling of starter neurons with distinct barcode sequences, which has been challenging to accomplish to date15. While previous studies have demonstrated the feasibility of applying barcoded rabies viruses for circuit tracing14,15,26, barcode collision between starter neurons has limited the throughput and scalability of these approaches.
Non-unique labeling of starter neurons can result from infection of starter neurons by rabies virions expressing the same barcode or from transmission of barcodes between them. To address the first constraint, we generated high-diversity libraries of barcoded rabies viruses that could label > 1000 starter cells while ensuring that >95% of them receive distinct barcodes. The diversity of these libraries surpasses most that have been described previously14,15,26,27. Shin et al. have recently described the generation of high complexity rabies virus libraries theoretically capable of uniquely labeling an even larger number of neurons. However, their barcode design consists of a combination of predefined index sequences, which are impractical to read out using in situ sequencing, limiting the potential applications of these libraries. Furthermore, sequence homology between these barcodes makes them susceptible to template switching during sequencing library preparation47, potentially inflating the estimates of library diversity.
Given the diversity of our library, the number of starter cells that can be uniquely labeled is primarily constrained by the probability of barcode transmission between them, which strongly depends on the density of starter cells (Fig. 1h). Previously, Zhang et al. have used retrograde AAV expressing Cre recombinase to sparsely seed starter cells projecting to a specific target. However, this approach makes it difficult to precisely control starter cell density and limits barcoded rabies tracing to mapping inputs of a specific cell population. Tan et al. have suggested that infecting the majority of starter cells by barcoded rabies viruses during the initial viral injection can reduce transsynaptic spread of barcodes between them due to superinfection exclusion38. However, confirming the effectiveness of this approach requires efficient recovery of barcoded starter neurons, which could not be accomplished in that study as only 12% of barcoded neurons were sequenced.
To reduce the frequency of barcode transmission between starter cells, we developed a strategy to control the proportion of neurons in the target area that are infected by starter AAVs, relying on stochastic infection of starter neurons by a blood-brain-barrier-permeable AAV expressing Cre recombinase. This made it possible to simultaneously map the inputs across many cell types. By applying this strategy, we mapped the inputs of 385 uniquely labeled starter neurons, identifying 7,814 putative synaptic connections in a single animal, substantially surpassing the throughput that has previously been achieved using barcoded rabies viruses15,48. The resulting connectivity matrix revealed layer- and cell-type-specific connectivity rules of V1 neurons. These rules recapitulated well-established aspects of cortical connectivity, including strong recurrent intralaminar connectivity of layer 2/3 and layer 5 neurons, feed-forward connectivity across layers 4, 2/3, and 5, strong connectivity between Pvalb-positive interneurons, and inhibition of Sst interneurons by Vip-positive cells.
By densely sequencing the sections containing the majority of starter neurons, we could identify and eliminate barcodes that were present in more than one starter cell. However, some of the barcodes detected in exactly one starter neuron may have been present in other starter cells that escaped detection due to limitations of sensitivity of in situ sequencing or low mCherry expression. Our results suggest that low mCherry expression is associated with low efficiency of barcode transmission, presumably due to low expression of the G glycoprotein. As starter cells in this category are unlikely to transmit their barcodes to a significant number of presynaptic cells, they are unlikely to substantially impact the analysis of BRISC data.
The efficiency of BRISC is challenging to estimate due to the lack of ground-truth measurements of the number of distinct presynaptic partners of pyramidal neurons. Mouse visual cortex neurons are estimated to have ~2000 dendritic spines49. However, connected pairs of neurons often make multiple synaptic contacts, with light microscopy reconstructions estimating that connected pyramidal neurons on average share ~5 synapses50. Together, these figures suggest that visual cortex cells receive synaptic inputs from ~400 distinct presynaptic neurons, although this estimate does not include inhibitory connections. As barcoded rabies tracing labels ~50 presynaptic neurons per starter cell, this likely constitutes ~10% of their presynaptic partners. Our results suggest that increasing the levels of G glycoprotein expression would increase the sensitivity of starter cell detection as well as the number of presynaptic neurons labeled by each starter, enhancing the throughput of BRISC and providing a more comprehensive sample of inputs onto each neuron.
By simultaneously reading out connectivity and gene expression patterns of individual neurons, BRISC has the potential to comprehensively characterize cell-type-specific wiring rules. In addition, BRISC makes it possible to correlate gene expression and connectivity at the single-cell level, potentially identifying connectivity rules that do not align with established transcriptomic cell types. This is particularly important as recent studies have demonstrated substantial continuous transcriptional variation between cortical neurons5,30. While mRNA abundance may not always linearly correlate with protein expression, differential mRNA expression of marker genes remains a robust proxy for defining cell-type identity, allowing connectivity rules to be mapped onto established transcriptomic taxonomies. Future studies that expand beyond gene panels selected primarily for cell-type assignment will enable targeted investigations of transcriptome-connectivity relationships as an application of BRISC. By integrating spatial and connectivity data, BRISC enables decomposition of connectivity rules into spatial and cell-type-specific components, revealing how connection probabilities vary with distance and how connectivity is organized relative to topographic functional maps, such as retinotopy. Future studies combining BRISC with proteomic readout could further validate the functional mechanisms underlying these observed connectivity patterns.
As BRISC preserves spatial information, it can be integrated with other imaging modalities, including in vivo multi-photon imaging. By registering in vivo imaging volumes to in situ sequencing cryosections30, BRISC could be applied to simultaneously determine functional properties and input connectivity of individual cells at scale, providing ground-truth data to constrain circuit models of cortical computations.
Furthermore, the scalability of BRISC enables the application of connectomics to understand neural mechanisms of neurological or psychiatric diseases by analyzing wiring patterns in disease models to identify defects in cell-type-specific wiring rules.
BRISC also enables the systematic comparison of connectivity rules across multiple brain areas or experimental subjects. Since BRISC depends entirely on viral vectors and not transgenic animals, it is straightforward to apply to other brain areas and potentially other animal species. This creates new opportunities for the use of comparative connectomics to systematically explore how microcircuit organization differs across the brain and the evolutionary tree.
Methods
Animals
All animal procedures were conducted in compliance with the guidance and regulations set forth by the UK Home Office according to the Animals Scientific Procedures Act 1986 (PPL PP4882546) and approved by the Animal Welfare Ethical Review Body at the Francis Crick Institute. Animals were housed in individually ventilated cages on a 12/12-h light-dark cycle (lights on: 22:00–10:00) at 22 ∘C ±2 ∘C and 55% humidity ±10%. Food and water were available ad libitum. Standard mouse chow (2018S Teklad Global 18% Protein Rodent Diet) was used in all experiments. Male and female C57BL/6 mice aged between 12 and 15 weeks were used for barcoded rabies experiments. Ai14-tdTomato Cre-responder mice (B6;129S6-Gt(ROSA)26Sortm14(CAG-tdTomato)Hze/J, JAX #007908) were used for AAV-PHP.eB-Cre titration experiments. Quantification of starter cell density with AAV concentration (Supplementary Fig. 2d) was replicated across n = 2-4 animals per dilution. The connectomic analysis (Figs. 3–6) used a single animal. Control experiments for direct rabies infection (Supplementary Fig. 7a,b) were replicated with n = 2 animals per condition. Mice were randomly assigned to experimental groups for different injection conditions and no animals were excluded from analyses.
AAV production
HEK-293T cells were maintained in DMEM (Invitrogen, 41965), 10% FBS (BioSera, FB-1001/500), 1xPenicillin/Streptomycin (Invitrogen, 15140). Cells were passaged the day before transfection and seeded at 6–7 × 106 cells per 10 cm dish. Cells were transduced with pHelper plasmid (Agilent AAV Free helper system, #240071), transfer plasmid (a gift from James M. Wilson, Addgene plasmid #105553) and either pAAV2/1 (a gift from James M. Wilson, Addgene plasmid #112862) or pUCmini-iCAP-PHP.eB (a gift from Viviana Gradinaru,51, Addgene plasmid #103005) plasmid in a 1:1:1.3 molar ratio using PEI-MAX (0.5 ml Opti-MEM (Invitrogen, 31985062), 6 μg pHelper, 5 μg pAAV2/1, and 3 μg transfer plasmid, and 40 μl 1 mg/ml PEI-MAX (Polysciences, 24765) per 10 cm dish). After >6 h, the media was discarded and replaced with fresh media (DMEM 2% FBS). 72 h later, the media was collected and replaced with fresh media (DMEM 2% FBS). 48 hrs later the media was again collected and cells were scraped from the dish and collected. The three collections were combined and 2.5 ml chloroform (Merck, 288306) was added and vortexed for 2 min to lyse the cells, then centrifuged at 3000 × g for 20 min. Supernatants were precipitated with 8% PEG8000 (Merck, 81268) and 82 mM NaCl overnight at 4 ∘C. Virus was pelleted by centrifugation for 20 min at 3000 × g. The pellets were resuspended in 4 ml gradient buffer containing 50 U/ml Denarase (Kerry, 20804-100K), 10 mM Tris pH 7.6, 150 mM NaCl, 10 mM MgCl2, and incubated at 37 ∘C for 45 min. 2.5 ml chloroform was added and vortexed for 2 min, then centrifuged at 3000 × g for 20 min. The supernatant was removed and layered onto an Iodixanol (StemCell Tech, 07820) step gradient and centrifuged for 2 h at 185,000 × g in a Type 70.1 rotor (Beckman Coulter). The 40% layer was removed and filtered (0.45 μm syringe filter) onto a 4 ml Amicon-100 Ultracentrifugal filter (Merck, UFC810024) pre-wetted with 0.01% Pluronic Acid (Invitrogen, 24040) at room temperature for 1 h, to concentrate and buffer exchange with storage buffer (5% sorbitol, 100 mM NaCl, 1xPBS). AAVs were titered using RT-qPCR on a QuantStudio 3 (Perkin Elmer) using PowerUp SYBRgreen master mix (Thermofisher, A25742) using linearized plasmid as a standard curve.
Barcoded rabies viral library production
Plasmid library production
A CVS-N2c-ΔG-mCherry plasmid (Addgene plasmid #73464, a gift from Dr. Andrew Murray) was used as the basis for producing barcoded rabies libraries. The extended 3’ sequence that is necessary to generate the super-cutter variant of the hepatitis delta virus antigenomic ribozyme (HDVagrz) was introduced into the plasmid using a Q5 site-directed mutagenesis kit (New England Biolabs, E0554S). An oligonucleotide was inserted containing a sequence complementary to the 5’ region of the hepatitis delta virus antigenomic ribozyme, along with 5 extra bases (ACGGA).
Barcodes were then inserted into the modified CVS-N2c-ΔG-mCherry plasmid downstream of the mCherry transgene by inverse PCR14 using a pair of forward and reverse primers (Bipartite_barcode_F and Bipartite_barcode_R for RV2, Barcode_F and Barcode_R for RV35, Supplementary Table 1) comprising a 5’ tail of six protective bases flanking an EagI restriction site, a genome complementary 3’ sequence, and random nucleotides forming the barcode (10 bases in both primers for RV2, 20 bases in the forward primer only for RV35). These random nucleotides were incorporated using IDT’s “hand-mixed” option at a final ratio of N(25:25:25:25) to account for differences in coupling rates of each nucleotide. To produce large amounts of linear barcoded plasmid DNA, PCR was performed in a 96-well PCR plate with 25 μl per well. This mix was comprised of 1250 μl Q5 Hot Start High-Fidelity 2X Master Mix, 125 μl forward primer (10 μM), 125 μl reverse primer (10 μM), 500 μl template plasmid (supercutter CVS-N2c-ΔG-mCherry, 0.4 ng/μl) and 500 μl molecular grade water. The following thermocycling conditions were used to generate the linear plasmid constructs with EagI 5’ and 3’ ends: 98 ∘C—30 s, 35 cycles of 9 8∘C for 10 s, 72 ∘C for 30 s, 72 ∘C for 450 s, followed by 72 ∘C for 2 min and 4 ∘C hold.
To size-select the resultant linear products, the PCR reaction was loaded on an agarose gel, and gel extraction was performed with a Wizard SV Gel and PCR Clean-Up kit (Promega, A9281). Secondary purification was then carried out with DNA Clean & Concentrator-5 columns (Zymo Research, D4004). Typically, around 20 μg of linear DNA was recovered from a single 96-well plate.
The purified PCR product was then digested at 37 ∘C for 1 h to expose sticky ends for ligation with the following reaction mix: 0.5 μl EagI-HF (New England Biolabs, R3505L), 0.25 μl DpnI (New England Biolabs, R0176L), 500 ng linear barcoded DNA, 5 μl CutSmart buffer (New England Biolabs, B6004S) and molecular-grade water up to 50 μl. Heat inactivation was then carried out at 80 ∘C for 20 min. The sticky-ended products were then ligated into open-circular plasmids by adding T4 ligase (New England Biolabs, M0202T) and ATP (Thermo Fisher Scientific, PV3227) to the reaction mix at a ratio of 0.1 μl ligase and 5 μl ATP per 44.9 μl of sticky-ended product and incubating at 4 ∘C for 2 h, followed by heat inactivation at 65 ∘C for 20 min. Residual linear DNA was then digested by adding Exonuclease V (New England Biolabs, M0345S) to the reaction mix (1 μl ExoV, 1.4 μl NEBuffer4 (New England Biolabs, B7004S) and 6.4 μl ATP) and incubating at 37 ∘C for 1 h, followed by heat inactivation at 70 ∘C for 30 min. The resulting product was purified using DNA Clean & Concentrator-5 columns.
Barcoded open circular plasmids were transformed into MegaX DH10B T1R Electrocompetent cells (Thermo Fisher Scientific, C640003) to amplify and supercoil them for mammalian transfection. 40 μl of electrocompetent cells were mixed with 400 ng of circularized DNA per cuvette, added to pre-chilled electroporation cuvettes on ice (BIO-RAD, 1652082), and immediately electroporated at 2.0 kV, 200 Ω, 25 μF using a GenePulser XCell (BIO-RAD, 1652662). 1 ml of pre-warmed SOC media was then added to each cuvette and placed in a round-bottomed tube in a shaking incubator for 1 h at 37 ∘C. All samples were then pooled, diluted to 20 ml with LB broth, and then 2 ml was spread evenly across each of 10 prewarmed LB Carbenicillin (100 μg/ml) 245 mm Square BioAssay plates (Corning, 431111). The plates were incubated overnight at 30 ∘C, and then all colonies were scraped from the plates. The bacteria were centrifuged to collect a pellet. ZymoPURE II maxiprep kits (Zymo Research, D4202) were used to extract endotoxin-free plasmid DNA.
Rabies packaging and pseudotyping
pCAG rabies packaging plasmids were created by performing PCR on the CVS-N2c-ΔG-mCherry plasmid (Addgene plasmid #73464) to amplify the N, P and L gene sequences, while the G gene was amplified from N2A-N2cG cells (a gift from Dr. Andrew Murray). The gene fragments were then inserted into the pCAG-T7-polymerase plasmid backbone (Addgene plasmid #59926) using a NEBuilder HiFi DNA Assembly kit (New England Biolabs, E5520). Full plasmid sequences are available in Supplementary Data 1.
Initial viral rescue attempts resulted in the RV2 library (Fig. 1f, g). Rescue from barcoded plasmids was carried out in 2 × 10 cm plates of HEK293T cells transfected with 7 μg barcoded rabies genome plasmid, 6 μg pCAG-T7-polymerase, 12 μg pCAG-N2c N, 6 μg pCAG-N2c P, 6 μg pCAG-N2c L, and 6 μg pCAG-N2c G plasmids (sequences provided in Supplementary Data 1) in 1000 μl of Opti-MEM with 130 μl PEI MAX (1 mg/ml), mixed and incubated for 20 min before adding to the cells. The following day, the media was exchanged with fresh DMEM/10% FBS. At 7 days post-transfection, cells were split in DMEM/10% FBS at a ratio of 1:3.3 into 2 × 10 cm plates and 2 × 15 cm plates. At 8 days post-transfection, the cells were re-transfected with 40 μg pCAG-N2c-G in 2000 μl of Opti-MEM and 120 μl PEI MAX (1 mg/ml). This was added to the cells and incubated for 6–8 h before replacing with fresh DMEM/10% FBS media. At 17 days post-transfection, the supernatant from the HEK293T plates was transferred to 2 × 15 cm dishes of BHK-EnvA cells, seeded at a density of 1 × 107 cells per dish for pseudotyping. Cells were trypsinized and replated with fresh media after 6 h to remove residual G-coated virus. At 21 days post-transfection, the supernatant was collected, filtered through a 0.45 μm filter, and centrifuged at 50,000 × g for 2 h at 4 ∘C. Pellets were resuspended in 300 μl PBS, and the viral titer was determined by applying serial dilutions of rabies virus to HEK293T-EnvA52 and HEK293T cells, counting mCherry+ cells.
We then optimized the rescue protocol to increase library diversity, generating library RV35. Specifically, we used a stable cell line expressing the N2c-glycoprotein (HEK293TG) to perform initial viral rescue and decreased the duration of viral amplification steps to reduce clonal amplification biases. To generate HEK293TG cells, HEK293T cells were transduced with a 3rd generation EF1a-N2cG-puromycin lentiviral vector containing the rabies glycoprotein gene flanked by long terminal repeat sequences for integration into the genome. Lentiviruses were produced by mixing a pEF1a-N2cG-IRES-Puro transfer plasmid (8.3 μg, sequence provided in Supplementary Data 1), with packaging and envelope plasmids (9.6 μg pLP1 (a gift from Georg Fritz & Thorsten Mascher,53, Addgene plasmid #209988), 9.0 μg pLP2 (a gift from Georg Fritz & Thorsten Mascher,53, Addgene plasmid #209989), 6.4 μg VSV-G (a gift from Akitsu Hotta,54, Addgene plasmid #138479) to transfect 2 × 107 HEK293T cells in a 15-cm culture dish with 100 μl Lipofectamine 2000 (Invitrogen, 11668019). Viral supernatants were collected and filtered at 2 and 3 days post-transfection, before being pooled and concentrated with a solution of 10% w/v PEG-8,000 (Merck, 81268) and NaCl (88 mM). Aliquots of lentivirus particles were titered by ddPCR55. HEK293T cells were then transduced with lentivirus at an MOI of 0.3. After 48 h, cells were maintained in media containing 2 μg/ml of puromycin (Sigma, P9620) until single colonies were isolated to select for cells that stably expressed the glycoprotein transgene. This was confirmed by infecting clonal colonies with glycoprotein-coated CVS-N2c-(ΔG)-mCherry rabies virus at low MOI. After several days, supernatant was taken from the wells and added to fresh HEK293T cells. Observation of mCherry fluorescence in the HEK293T cells was used to confirm successful packaging of glycoprotein-coated rabies virus.
HEK293TG cells were transfected with the barcoded rabies genome plasmid along with plasmids containing the rabies genes N, P, L and G (sequence provided in Supplementary Data 1), as well as T7 polymerase (a gift from Ian Wickersham, Addgene plasmid #59926). Six-well dishes were first seeded with HEK293TG cells at a density of 6 × 105 cells/well in DMEM/5% fetal bovine serum (FBS). The transfection mix was prepared containing 6 μg pTIT-N (Genbank GU299212,56), 3 μg pTIT-L (Genbank GU299213,56), 5 μg pTIT-P (Genbank GU299215,56), 6 μg pTIT-G (Genbank GU299214,57), 8.5 μg pCAGGS T7 (a gift from Benhur Lee58, Addgene #65974) and 12 μg barcoded plasmid library in 430 μl of Opti-MEM. Then, 85 μl of PEI MAX (1 mg/ml) was added to the mix, incubated at room temperature for 20 min, and 80 μl of this was added to each well. The following day, the media was exchanged with fresh DMEM/10% FBS. Three days after transfection, the cells were split in DMEM/10% FBS at a ratio of four wells to a T175 flask. When cells reached 70% confluency (6–7 days post-transfection), they were transfected with the glycoprotein plasmid in the following transfection mix: 13 μg CMV-RG, 1 ml Opti-MEM, 40 μl of PEI MAX (1 mg/ml). This was added to the cells and incubated for 6–8 h before replacing with fresh DMEM/10% FBS media. Supernatant was collected 9–10 days after the initial transfection and filtered through 0.45 μm filters. The supernatant was titered by serial dilution onto HEK293TG cells in 6-well plates, with a typical titer of 1 × 107.
This supernatant was then used to infect BHK cells stably expressing the EnvA coat protein (BHK-EnvA-GFP,52) for pseudotyping. BHK-EnvA cells were seeded in 150 mm dishes at a density of 1 × 107 cells per dish in DMEM/10% FBS. Supernatant containing barcoded G-coated rabies virus was added to each dish at an MOI of 0.3. The cells were incubated with supernatant for 6–8 h and then washed with PBS four times, then split and replated in DMEM/5% FBS at a ratio of 1:3. Supernatant containing EnvA-pseudotyped virus was collected and filtered through 0.45 μm filters 2 days after infection and fresh DMEM/10% FBS was added to the plates. The supernatant was centrifuged at 70,000 × g in an SW32.1 rotor for 2 h at 4 ∘C and the viral pellets were resuspended in approximately 250 μl PBS. This was repeated 3 days after infection. The titer of the concentrated viral prep was determined by applying serial dilutions of the virus to HEK293T-EnvA52 and HEK293T cells to quantify pseudotyped and glycoprotein-coated viral titers, respectively.
Barcoded library sequencing
The diversity of the barcoded plasmid and viral libraries was quantified using a unique molecular identifier (UMI) tagging approach. For viral libraries, viral genomic RNA was extracted using the Quick DNA/RNA Viral Kit (Zymo Research, D7020) and eluted into 15 μl of RNase-free water. Purified viral barcode RNA was then reverse transcribed using Superscript IV reverse transcriptase (Thermo Fisher Scientific, 18090050) at 50 ∘C for 10 min with 1 μl of 2 μM UMI_P5_Truseq primer (Supplementary Table 1), before heat inactivation at 80 ∘C for 10 min. RNA was subsequently digested with RNase H (New England Biolabs, M0297S) at 37 ∘C for 20 min. The primer used for reverse transcription (UMI_P5_Truseq, Supplementary Table 1) contained a 5’ 22 bp region of the P5 Truseq sequence for nested adapter PCR, a 12 bp random UMI sequence and 20 bp of rabies homologous sequence for binding upstream of the barcode.
The same UMI-P5-Truseq primer was used to produce UMI-tagged amplicons from the barcoded plasmid libraries in a two-cycle limited PCR reaction. Barcoded plasmid (5 ng) was added to 16 μl Q5 Hot Start High-Fidelity 2X Master Mix (New England Biolabs, M0494S) with 1.25 μl each of UMI_P5_Truseq and P7_universal_reverse primers (Supplementary Table 1) and PCR thermocycled with the following conditions: 98∘C—3 min, two cycles of 98 ∘C—30 s, 67 ∘C—20 s, 72 ∘C—30 s, followed by 72 ∘C—2 min and 12 ∘C hold.
The resultant cDNA from the viral samples or amplicons from barcoded plasmids was size-selected and purified using KAPA Pure Beads (Roche, KK8000) in a 1:1 ratio, eluting in 25 μl of RNase-free water. To determine the optimal cycle number for library amplification, the amplification curve inflection point was determined for each sample by qPCR. 2.5 μl of each sample was added to a master mix of 1 μl 2.5X Thiazole Green (Biotium, 40086), 1 μl 2.5X ROX reference dye (Thermo Fisher Scientific, 12223-012), 12.5 μl Q5 Hot Start High-Fidelity 2X Master Mix (New England Biolabs, M0494S), 1.25 μl 10 μM IDT_i7_1 primer (Supplementary Table 1) for plasmid amplicons or P7_universal_reverse for viral single-stranded cDNA, 1.25 μl 10 μM IDT_i5_1 primer and 5.5 μl of molecular grade water. The following thermocycler conditions were used: 98∘C - 3 mins, followed by 40 cycles of 98 ∘C—10 s, 68 ∘C—20 s, 72 ∘C—30 s.
Subsequently, the remaining 22.5 μl of each sample was added to a mix of 25 μl Q5 Hot Start High-Fidelity 2X Master Mix, 2.5 μl 10 μM IDT_i7_1-10 primer for plasmid amplicons/P7_universal_reverse for viral single-stranded cDNA, and 2.5 μl 10 μM IDT_i5_1-10 primer. The IDT_i5_X and IDT_i7_X primers each contain 8 bp index sequences derived from the rhAmpSeq index primer set (Integrated DNA Technologies) for dual-index demultiplexing alongside the Illumina P5 and P7 adapter sequences, respectively. Thermocycling conditions for this Illumina adapter PCR were: 98∘C - 3 mins followed by cycles of 98∘C—10 s, 68 ∘C—20 s, 72 ∘C–30 s, then 72 ∘C—2 min. The number of cycles was equal to the qPCR inflection point, less 3 cycles to account for the 10X (~23) increase in target concentration.
For viral amplicons, the P7-indexed adapter sequences were added in a final PCR step. The UMI-tagged viral amplicons were first gel-purified with a Wizard SV Gel and PCR Clean-Up kit (Promega, A9281) and eluted with 20 μl water. Then, the same PCR mix was used as described above for the barcoded plasmid index PCR, adding the IDT_i7_X primer and the matching IDT_i5_X for each sample. Thermocycling conditions were likewise the same as the Illumina adapter PCR, but with a fixed number of 3 cycles.
The indexed viral and plasmid amplicons were then gel-purified with a Wizard SV Gel and PCR Clean-Up kit (Promega, A9281) and eluted with 25 μl water. The concentration and size distribution of these amplicon libraries were quantified with a High Sensitivity D1000 ScreenTape kit (Agilent, 5067-5584) on an Agilent 2200 TapeStation system. Samples passing QC were sequenced on an Illumina NovaSeq 6000/NovaSeq X using Illumina TruSeq primers for paired-end 100 bp sequencing at a depth of 10–50 million reads per sample.
Quantification of barcoded library diversity
To analyze sequenced libraries, low-quality reads were first removed from raw demultiplexed .fastq files with Trimmomatic 0.36, removing reads with an average PHRED score per base of less than 20 in a 6-base sliding window and removing any reads with a length of less than 101 bp. The sequences flanking the barcode site were then matched to their expected sequences, and any mismatched sequences were discarded to remove frameshifts. Next, the UMI sequences were used to de-duplicate the remaining barcode sequence reads to account for PCR amplification bias. The remaining sequences represented individual species of barcode RNA/DNA found in the viral or plasmid samples. To account for sequencing errors and PCR-induced mutations that may be present in some of these sequences, closely related barcodes were collapsed into their most abundant “parent” sequences using a method adapted from Kebschull et al.59. First, barcode sequences were aligned to all other barcodes in the library with a maximum hamming distance of 2 using Bowtie2 (2.5.1-GCC-12.3.0,60). Related sequences were then collapsed onto the barcode with the highest UMI count, summing together all of the counts. Previously published barcode library data (Fig. 1f,g) was acquired from deposited data sources: GSM451933326, Source Data 1f 170330_pSPBN_GFP_B19EnvA14, SRR2331075715, GSM8524116/GSM852411917, and Mendeley DOI:10.17632/zrp4zjws6p.1 N2c Library CM127.
Surgical procedures
For barcoded rabies tracing experiments, Metacam (33 mg/l) was provided via drinking water or in egg custard before and for 3 days following surgery as peri- and post-operative analgesia. Prior to anesthesia, 50 μl AAV-PHP.eB-Syn-Cre (4.5 × 1013 vg/ml) diluted 1:330 in filter-sterilized PBS was administered via tail vein injection. Anesthesia was then induced and maintained with 1.5–3% isoflurane, and mice received subcutaneous injections of buprenorphine (0.1 mg/kg). Mice were then secured in a stereotactic frame, and a small craniotomy was created at the site of the injection. Virus injections were performed using a Nanoject III injector at rates not exceeding 14 nl/min. Helper viruses FLEX-H2B-mCherry-P2A-N2cG (3.1 × 1013 vg/ml) and AAV1-FLEX-H2B-EBFP2-P2A-TVA (1.8 × 1013 vg/ml, sequences provided in Supplementary Data 1), diluted in sterile PBS to 1:20 and 1:100 respectively, were delivered at three injection sites at −3.5 mm from Bregma and 3.0, 2.4 and 1.8 mm from midline in the left hemisphere, 300 and 500 μm below brain surface (60 nl per depth). Thirteen days later, barcoded CVS-N2c-mCherry (6.0 × 108 IFU/ml) was injected at the same coordinates (500 nl per depth). Seven days later, mice were euthanized via intraperitoneal injection of sodium pentobarbital (600 mg/kg). Brains were extracted and rapidly frozen in OCT compound-filled cryomolds using a bath of absolute ethanol and dry ice, and stored at −80 ∘C.
TVA leak and rabies glycoprotein-coated contamination control experiments (Supplementary Fig. 7) followed the above protocol but excluded tail vein injections and omitted either FLEX-H2B-mCherry-P2A-N2cG or both helper viruses, respectively. Seven days after rabies injection, mice were terminally anesthetized with sodium pentobarbital (600 mg/kg) and then perfused with ice-cold PBS, followed by 4% paraformaldehyde in PBS. Brains were then post-fixed overnight in 4% paraformaldehyde before imaging.
For AAV-PHP.eB-Cre titration experiments (Supplementary Fig. 2d), Ai14 mice (B6;129S6-Gt(ROSA)26Sortm14(CAG-tdTomato)Hze/J, JAX #007908) received 50 μl tail vein injections of AAV-PHP.eB-Syn-Cre (4.5 × 1013 vg/ml) at 1:100, 1:330, 1:1000, or 1:3300 dilution in sterile PBS. Two weeks after tail vein injections, mice were terminally anesthetized with sodium pentobarbital, perfused and fixed as above.
For quantification of barcoded rabies spread using serial two-photon tomography (Fig. 1i–k, Supplementary Fig. 2a–c), the procedure for barcoded rabies sequencing surgeries was also performed as described above with the following differences: a single local injection of the helper viruses diluted as above and injected at coordinates of 3.5 mm AP, 2.5 mm ML, 300 and 500 μm below brain surface (60 nl per depth) was performed either combined with AAV1-hSyn-Cre (7.6 × 1013 vg/ml) diluted 1:5000 in sterile PBS (Fig. 1i–k) or with tail vein injections of 1:330 AAV-PHP.eB-Syn-Cre (Supplementary Fig. 2a–c). Seven days later, a pair of 500 nl injections of barcoded RV2 CVS-N2c-mCherry (2.8 × 107 IFU/ml) were administered at the same stereotactic coordinates. After seven more days, mice were euthanized, perfused and fixed as detailed above.
For quantification of the spatial distribution of starter neurons in intracerbral/intravenous injections of AAV-Cre (Fig. 1l-n), the procedure for barcoded rabies sequencing surgeries was also performed as described above with the following differences: wild-type mice received either a 50 μl tail vein injection of AAV-PHP.eB-Syn-Cre (4.5 × 1013 vg/ml) at 1:330 dilution in sterile PBS (intravenous), or a single local injection of AAV1-hSyn-Cre (7.6 × 1013 vg/ml) diluted 1:5000 in sterile PBS (intracerebral) at coordinates of 3.8 mm AP, 2.4 mm ML 300 and 500 μm below brain surface (60 nl per depth). For both conditions, AAV FLEX-H2B-mCherry-P2A-N2cG (3.1 × 1013 vg/ml), diluted in sterile PBS to 1:20 was also injected at the same location on the same day. After 14 more days, mice were euthanized, perfused and fixed as detailed above.
Serial section two-photon tomography
To quantify the spread of barcoded rabies virus and determine the optimal parameters for AAV1-hSyn-Cre injections, PFA-fixed brains were imaged using a serial sectioning two-photon microscope61,62. Sections were imaged in a bath of 50 mM pH 7.4 phosphate buffer. The microscope was controlled by ScanImage Basic (MBF Bioscience), using the custom software wrapper BakingTray to control imaging parameters63. Image tiles were assembled by StitchIt64. To quantify AAV PHP.eB Cre-positive cells, images were acquired at an XY resolution of 1 or 2 μm with optical sectioning intervals of 5 or 8 μm and vibratome sections at 40 μm intervals. Cell detection throughout the brain was performed either using Cellfinder65 (Fig. 1i, k, Supplementary Fig. 2a,c, Supplementary Fig. 5b) followed by manual curation of spurious detection at the edge of the brain or manually using napari (Fig. 1m,n, Supplementary Fig. 7).
As nuclear fluorescence of starter cells could not be detected from the serial section two-photon tomography dataset directly, the slices were collected, counterstained with DAPI and imaged on a confocal microscope with either voxels of 0.2 × 0.2 × 1.6 μm on a LSM 880, Zeiss (Fig. 1j) or voxels of 0.3 × 0.3 × 1 μm on a FV4000, Olympus (Supplementary Fig. 2b). Starter cells were manually identified from their brighter nuclear H2B-mCherry signal compared to the cytoplasmic rabies mCherry expression. To display both the high-intensity nuclear staining and fainter cytoplasmic fluorescence (Fig. 1j, Supplementary Fig. 2b), RGB images were formed by collating the DAPI channel (in blue) with the mCherry data duplicated in both the red and green channels with different contrast limits (1000 and 10,000 gray values, respectively in Fig. 1j, 400 and 1500 gray values, respectively in Supplementary Fig. 2b).
In situ sequencing
Primer and padlock design
Cell type marker genes were selected using SMART-Seq2 RNA expression data from neurons in the mouse visual cortex5 as a reference. Candidate genes were selected by first filtering to remove genes with low mean expression. Then, a modified version of a greedy combinatorial search algorithm66 was used to iteratively select the top 80 genes that maximized classification accuracy across the reference cell type clusters. Additional sixteen genes were then manually added to the genes selected by the greedy algorithm, including established visual cortex cell type marker genes (Chodl, Cux2, Fezf2, Foxp2, Rorb, Vip), additional marker genes that are differentially expressed in cell types where the canonical marker is downregulated by rabies infection67 (L5 NP - Tshz2, Sst - Grin3a/Reln), and additional markers to improve the classification of neurons within clusters (L2/3 IT neurons - Rrad), or between subclasses (L5 IT/PT/NP - Etv1, Tle4, L6 IT/CT - Rasl10a, Hs3st4, Vip/Sst - Grik1, Sorcs3).
Multiple padlock probes were designed for each target gene (Supplementary Data 1). The number of probes designed for a given gene was calculated based on the expression level of each gene relative to Sst in a reference V1 SMARTseq scRNAseq dataset5:
| 1 |
where N is the number of padlock probes, XSst is the mean expression of the Sst gene from all cells in the Sst cell type subclass, and Xtarget is the mean expression of the target gene in its highest expressing cluster in the reference scRNAseq dataset. This was limited to an upper bound of 12 padlocks per gene and a lower bound of 4 padlocks per gene.
Padlock sequences were generated using a modified version of the Multi padlock design tool66. Briefly, for each target gene, the tool determined the consensus sequence from all transcript variants in the mouse RefSeq transcriptome and tested every possible binding sequence in a sliding window along the transcript. Candidate binding sequences consist of two adjacent padlock arm regions (20 bp per arm). The arms of each candidate sequence were filtered to be within a defined melting temperature range (60–75 ∘C after formamide-containing hybridization buffer correction, melting temperature calculated assuming 0.1 μM probe, 0.075 M Na+, 0.01 M Mg2+ and 20% formamide). The specificity of each candidate sequence was then tested with a BLAST search against the whole mouse transcriptome to ensure padlocks do not exhibit non-specific binding. A 4-base pair minimum distance between padlock candidates was also specified to avoid steric hindrance of bound padlocks.
All padlocks had a conserved backbone sequence containing a shared sequencing primer binding site directly upstream of a 7-base gene barcode, unique to each gene. Gene barcodes were selected from a pool of previously designed “GII codes”29 with a minimum hamming distance of 2 between each barcode. Padlock probes for the highly expressed genes Slc17a7, Gad1, Sst and Vip contained unique binding sites in place of the sequencing primer site to allow for direct readout of these genes with fluorophore-conjugated hybridization probes separately from the sequencing rounds of the other genes. Padlocks were obtained from IDT as 4 nM ultramer sequences with 5’ phosphorylation.
A reverse transcription primer was designed for each padlock by taking the reverse complement of the 5’ arm of each padlock (Supplementary Data 1). Reverse transcription primers were obtained from IDT as standard desalted oligonucleotides.
Brain cryosectioning
Serial sections were cut at 20 μm thickness with MX35 Ultra disposable microtome blades (Epredia, 3053835) at −13 ∘C specimen temperature/−15 ∘C chamber temperature using a Bright OTF5000 cryostat (Bright Instruments, R080) and mounted onto poly-l-lysine coated 25 × 75 mm #1.5H coverslips. Ten sections were mounted per coverslip and then stored at − 80∘C.
Flowcell assembly and tissue preparation
Flowcells were assembled from 26 × 76 mm microscope slides with pre-drilled 1 mm holes placed at each end for fluid flow. Ports were cast from polydimethylsiloxane, punched with 1.5 mm holes and plasma bonded over the holes drilled in the microscope slides. A laser-cut 140 μm-thick adhesive gasket (Grace Biolabs) was mounted on the other side of the microscope slide.
The protocol for in situ reverse transcription and amplification of transcripts from tissue was adapted, combining elements of BARseq229,31 and coppaFISH30. Coverslips with cryosections were removed from -80∘C and immediately immersed in 4% PFA in PBS for 30 min. They were then immersed in PBS to wash and then washed twice in PBST (PBS with 0.5% Tween20 (Sigma Aldrich, P1379)). Next, they were immersed in a series of ethanol solutions, incubating for 5 min each in 70%, 85% and 100% ethanol at room temperature. The coverslips were transferred to fresh Falcon tubes containing 100% ethanol and stored overnight at 4 ∘C. The following day, the coverslips were removed from the ethanol, and once dried, each flowcell was assembled by pressing the coverslip onto the adhesive gasket backed with the microscope slide to form an enclosed chamber. Assembled flowcells had a volume of 180 μl and were washed with PBST three times to rehydrate the tissue and remove any bubbles from within the flowcell.
Reverse transcription
A reverse transcription mix was then added to each flowcell. The mix contained pooled gene-specific reverse transcription primers (60 nM per primer), 1 μM rabies barcode reverse transcription primer (RTAB0067, Supplementary Data 1), 1 U/μl RiboLock RNase Inhibitor (Thermo Fisher Scientific, EO0381), 0.2 μg/μl non-acetylated BSA (Thermo Fisher Scientific, AM2616), 0.5 mM dNTP (Thermo Fisher Scientific, R0192), 20 U/μl SuperScript IV reverse transcriptase (Thermo Fisher Scientific, 18090200), 5 mM DTT (Thermo Scientific, 707265) in 1X SuperScript IV buffer. Samples were incubated at 45∘C overnight in a humidified chamber to reduce evaporation.
Padlock ligation
The following day, samples were washed in PBST once and the cDNA from reverse transcription was crosslinked by incubating the samples in 4% PFA in PBS for 30 min at room temperature. Samples were then washed in PBST twice to remove excess PFA. RNA template digestion, padlock hybridization to cDNA and padlock ligation were carried out in the same reaction. First, a gene padlock ligation mix was added to the samples, containing pooled gene padlocks (60 nM of each padlock, Supplementary Data 1), 0.4U/μl RNaseH (New England Biolabs, M0297L), 20% Formamide, 50 mM KCl, 0.5U/μl Ampligase (Lucigen, A0102K) in 1X Ampligase buffer. Samples were incubated for 40 min at 37 ∘C, followed by 1 h at 45 ∘C. Then, the gap-filling/ligation mix containing 1 μM rabies barcode padlock (OAB0973), 0.4U/μl RNaseH (New England Biolabs, M0297L), 20% Formamide, 50 mM KCl, 0.25 μg/μl non-acetylated BSA (Thermo Fisher Scientific, AM2616), 50 μM dNTP (Thermo Fisher Scientific, R0192), 5% glycerol, 0.001U/μl Phusion polymerase (Thermo Fisher Scientific, F530L), 0.5 U/μl Ampligase (Lucigen, A0102K) in 1X Ampligase buffer was added to the samples. The samples were incubated in the gap-filling reaction mix for 5 min at 37 ∘C, followed by 40 min at 45 ∘C. The samples were then washed twice in PBST and once in hybridization mix (10% Formamide, 2X SSC in water).
Rolling circle amplification
The rolling circle amplification (RCA) primer mix (1 μM each of PAB0010, 12, 13, 22, 33, 35, Supplementary Table 2) was then hybridized at room temperature for 15 min. The samples were washed twice in hybridization mix for 2 min each and once in PBST. The RCA mix containing 0.25 μg/μl non-acetylated BSA (Thermo Fisher Scientific, AM2616), 250 μM dNTP (Thermo Fisher Scientific, R0192), 125 μM 5-(3-Aminoallyl)-dUTP (Thermo Fisher Scientific, AM8439), 5% glycerol, 0.2U/μl EquiPhi29 DNA polymerase (Thermo Fisher Scientific, A39391) in 1X EquiPhi29 buffer was added to the samples and incubated overnight at 30∘C in humidified chambers. The following day, samples were washed once in PBST and crosslinked with 50 mM BS(PEG)9 (Thermo Fisher Scientific, 21582) in PBS for 1 h. Excess BS(PEG)9 was quenched by washing the samples twice with 1 M Tris-HCl pH 8.0 buffer and then incubating at room temperature for 30 min. The samples were then washed in PBST.
Image acquisition
All tissue imaging was performed using a Nikon Ti2-E inverted microscope, equipped with a PZ-2000 XYZ piezo stage (Applied Scientific Instrumentation) and a Cairn MultiCam beamsplitter and CellCam Kikker 100MT cameras (Cairn Research) using a multibandpass main dichroic and three beamsplitter dichroics to achieve simultaneous collection of four emission channels (see Supplementary Fig. 3a for a list of filters). Fast Z-stack acquisition was achieved using TTL triggering from the exposure out signal of one of the cameras. A 20× 0.8 NA Lambda-D air objective was used for all imaging, with illumination provided by a CoolLED pE-4000 light source. Images were captured with 0.231 μm pixel size in 23-plane Z-stacks with 1 μm spacing and tile overlap of 10%. Microscope hardware was controlled using Micromanager as a GUI interface68, using Pycromanager69 to automate the simultaneous acquisition of multiple flowcells.
mCherry imaging and photobleaching
The samples were first imaged to detect the fluorescence of mCherry-positive starter neurons using 500 nm excitation light and the same Chroma ZT405/514/635rpc dichroic and Chroma ET590/33m and Chroma ET546/22x emission filters used for sequencing rounds. After imaging, the samples were placed on an aluminum block under a white-light 10,000-lumen LED floodlamp (NATPOW, TS-F42100) overnight to photobleach the mCherry signal to avoid crosstalk with fluorophores during sequencing. A desk fan (Sealey, SFF-04) was used to maintain a consistent sample temperature of under 35 ∘C during photobleaching.
Sequencing cell type marker gene transcripts
After mCherry imaging, the samples were equilibrated in hybridization mix and 1 μM LNA endogenous gene sequencing primer (PAB0032, Supplementary Table 2) in hybridization mix was added to the sample and incubated at room temperature for 1 h. Excess sequencing primer was removed with three washes of hybridization mix at room temperature for 2 min each. The samples were then washed twice in PBST before proceeding to sequencing. Sequencing was performed manually by pipetting Illumina reagents into the flowcells, placing them in a hybridization oven for incubation at 60∘C and then aspirating the solution using a vacuum pump. The samples were cooled to room temperature each round before imaging to prevent fluctuations in focus from the infrared-based “Perfect Focus System” of the microscope. The sequencing reagents (HB2, IRM, CRM, and USM) were sourced from HiSeq SBS v4 kits (Illumina, FC-410-1003) or MiSeq Reagent v3 kits (Illumina, MS-102-3003).
For the first cycle of sequencing chemistry, the flowcell was washed twice with 200 μl HB2 buffer (3 min at 60 ∘C each). Residual thiols were then blocked with 2 × 200 μl iodoacetamide solution incubations (9.3 mg in 2 ml PBST; 3 min at 60 ∘C). The flowcell was washed once with 200 μl PBST, then washed twice more with 200 μl HB2, all at room temperature. Sequencing was then initiated by introducing 2 × 200 μl IRM (3 min at 60 ∘C each). Unincorporated dye-conjugated nucleotides were removed with 4 × 200 μl PBST washes (3 min at 60 ∘C each). Finally, 200 μl USM was applied to reduce photobleaching, and the flowcell was imaged.
Between sequencing cycles, the flowcell was washed with 3 × 200 μl HB2 at room temperature, followed by 2 × 200 μl CRM incubations (3 min at 60 ∘C each) to cleave the nucleotide terminator groups. The chemistry steps described for the first cycle were then repeated. In total, seven sequencing cycles were completed to read out the entire gene-padlock barcode, using the same wash and incubation parameters at every step.
Rabies barcode sequencing
Sequencing of the rabies barcodes took place after the endogenous gene sequencing rounds were complete. The flowcells were washed twice with a stripping buffer of 60% Formamide in 2X SSC buffer at 60 ∘C for 15 min to remove the extended gene sequencing primer. The samples were then equilibrated in hybridization mix and 1 μM rabies barcode sequencing primer (PAB0034, Supplementary Table 2) in hybridization mix was added to the samples and incubated at room temperature for 1 h. Excess sequencing primer was removed with three washes of hybridization mix at room temperature for 2 min each. The samples were then washed twice in PBST before proceeding to sequencing. The same sequencing procedure was carried out as for cell type marker genes, completing 14 rounds of sequencing. As 10 rounds were sufficient to identify unique barcodes (Supplementary Fig. 4) and the error rate of in situ sequencing increases over rounds, only the first 10 rounds were included in the analysis.
Hybridization rounds for highly expressed genes
The extended barcode sequencing primers were stripped from the samples as described above to prepare them for hybridization probe imaging. The samples were then equilibrated in the hybridization mix, and 1 μM each of a set of hybridization probes with 5’ conjugated fluorophores were hybridized to the samples in two extra rounds. Each round followed the same hybridization and stripping procedure as for the sequencing primers. First, probes designed against the highly-expressed gene padlocks Slc17a7, Sst, Gad1, and Vip were bound to the samples. These were imaged and then stripped using a solution of 60% formamide in 2X SSC buffer. Then, hybridization probes that targeted a shared sequence on the backbone of all gene padlocks and all rabies barcode padlocks were bound. After adding these ’anchor’ probes, the tissue was stained with 5 μg/μl DAPI diluted in PBST for 10 min, followed by three washes in PBST before proceeding to imaging. First, only the tiles that were imaged for all sequencing rounds were acquired. The acquisition was then repeated, covering the whole brain section to aid with registration to a reference atlas (see below).
Sensitivity of barcode detection
To determine the sensitivity of rabies barcode detection, sections of brain tissue infected with the barcoded rabies virus were prepared as detailed above with the following changes: during the reverse transcription step, RT primers for the rabies N, P, M and L genes were added (60 nM per primer, Supplementary Data 1), alongside the pool of endogenous gene RT primers (60 nM per primer) and the rabies barcode padlock (1 μM). Likewise, for the padlock ligation step, padlocks for the rabies N, P, M and L genes were added (60 nM of each padlock, Supplementary Data 1) alongside the endogenous gene padlocks. After RCA was completed, hybridization probes against the rabies gene padlocks (PAB0048, 1 μM) and the rabies barcode padlock (PAB0023, Supplementary Table 2, 1 μM) were added in hybridization mix to the sample and incubated for 1 h. The sample was washed three times with hybridization mix, then 200 μl USM was added. The samples were then imaged with the same filter set that was used for barcode and high-expressing gene probe imaging.
Rabies-infected cells were identified from the hybridization probe images using the rabies gene signal to segment cells. A difference of Gaussians filter was applied to the images, which were then binarized with a manually selected binarization threshold and binary closing was performed. Candidate rabies-positive cells were then detected on the binarized images. The masks were then filtered based on minimum and maximum area, circularity, elongation, solidity and unbinarized intensity. Each mask was then radially expanded by 5 μm. Rabies barcode spots were detected by finding peaks in the hybridization channel for the barcode probe and the number of barcode spots per rabies-positive cell mask was quantified.
In situ sequencing preprocessing
Image projection
Z-stacks were z-projected to calculate the maximum and median intensity projections. The images were flat-field corrected using the average of maximum projections across all rounds and tiles. Since the median projection largely captures diffuse tissue background, all further analyses were done by subtracting the median projection from the maximum projection.
Image registration
After projection, images were registered first across successive sequencing rounds, then across channels. A reference tile was manually selected and, for each channel, images from all rounds were median-filtered to reduce noise. Rigid registration parameters between successive rounds of imaging were estimated by performing an iterative grid search over rotation angles using phase correlation to estimate translation. The rotation angle across rounds was only a function of the slide position on the microscope and was constant across tiles. Due to stage inaccuracy, translation parameters could, however, vary from tile to tile and were therefore estimated by phase correlation for each tile independently. To identify aberrant x/y translation shifts, usually at the border of the brain, when a significant part of the image was outside of the sample, shifts across tiles were linearly fitted using a RANSAC regression, and shifts for tiles with residuals above 10 pixels were replaced by the regression value.
To register images across channels and correct chromatic aberration, we then computed the standard deviation projection across registered rounds, generating a reference image for each channel. Images from each channel were tiled into 256 × 256 pixel blocks with 50% overlap. For each block, x/y shifts to the reference channel were calculated by phase correlation. The x and y shifts for each block were then used to estimate the affine transformation between channels. Finally, for each tile, the images for each channel were registered using the affine registration parameters estimated from the reference tile and then further aligned using phase correlation to correct for any channel drift during imaging.
Hybridization acquisitions were registered between channels by calculating the affine transformation between channels on all tiles using a similar method as described above. As these rounds had less signal overlap between channels, registration was performed using blocks of 512 × 512 px with 80% overlap. Each block was binarized using a 0.7 quantile cut-off before registering channels using phase correlation. Finally, affine transform parameters were estimated first between pairs of channels with significant bleedthrough (channels 0 and 1 and channels 2 and 3) and then between the two channels of each group that are the most similar (channels 1 and 3). This procedure was repeated for each tile. Images for each channel were registered using the median affine registration parameters across tiles, and any residual uncorrected translation was estimated by aligning channels to the reference channel using phase correlation.
Channel normalization and bleedthrough estimation
Images from sequencing rounds were filtered using a difference of Hanning kernel with radii of 2 and 4 pixels (0.462 and 0.924 μm). To correct for differences in brightness between channels, normalization factors were computed as the 99.99% quantile of pixel intensities for each channel and round, and smoothed by fitting the decrease in intensity across rounds for each channel with an exponential decay. The smoothed normalization factors for round 1 were used to correct brightness across all rounds.
To estimate the expected fluorescence profile of the fluorophores associated with each base, we first detected spots on the standard deviation projection across rounds of the filtered images as local maxima crossing a manually set threshold. We then selected well-isolated spots and extracted fluorescence values of each channel and round in a 2-pixel radius. Scaled K-means clustering30 was then used to assign each spot to one of four clusters corresponding to the four dye-conjugated nucleotides. The cluster means of the four clusters were computed across rounds, generating a 4-channel × Nrounds bleedthrough matrix for each base.
Base calling rabies barcodes
Rabies barcodes have unknown sequences and must therefore be basecalled round by round. To do so, putative barcode spots were detected from the registered round/channel images by finding peaks in the mean image across rounds and channels, and the fluorescence trace across rounds and channels was extracted from a disk with a 2-pixel/0.462 μm radius.
Each spot was assigned to the base with the highest cosine similarity with the bleedthrough matrix for each round. Barcode sequences were constructed from these assignments and the following quality metrics were computed: mean fluorescence intensity across rounds, mean cosine similarity score across rounds, cosine similarity score of the whole sequence, calculated by comparing the observed fluorescence traces (after background subtraction) to synthetic traces generated from the cluster means of the bases that were assigned at each round.
To distinguish genuine barcode spots from bright background autofluorescence spots, spots were first filtered by applying thresholds for the individual quality metrics. To further filter the remaining spots, the quality metrics were fit using a Gaussian Mixture Model (GMM) with two clusters, representing low and high-quality spots. Spots assigned to the high-quality cluster were retained for further analysis, and error correction was performed by merging sequences within a maximum hamming distance of 2.
Gene barcode detection using orthogonal matching pursuit
Transcripts of cell-type marker genes were identified by a unique gene barcode sequence encoded in the backbone of gene-specific padlocks. To robustly decode gene spots while accounting for any spatial overlap between them, fluorescence images from gene sequencing rounds were unmixed using a modified version of the orthogonal matching pursuit (OMP) algorithm30,70.
First, the expected fluorescence for each gene barcode was computed by concatenating the bleedthrough vectors of the base for each round to generate a gene dictionary. In addition, a set of background vectors representing constant fluorescence across rounds for each channel were appended to the gene dictionary. Fluorescence vectors of individual pixels and elements of the gene dictionary were normalized to unit norm, yielding the normalized fluorescence vector y and gene dictionary G. OMP approximates the fluorescence y as a weighted sum of elements of the dictionary G assigned to a given pixel, defined by the support set Λ. Λ is initialized to contain the background vectors and is updated on each iteration to add the gene that best explains the residual fluorescence in the pixel:
| 2 |
To select gene jk+1 added on a given iteration, we first select the columns of the gene dictionary already included in Λk:
| 3 |
We then fit the fluorescence y to estimate the coefficients β for each selected gene and background components
| 4 |
We then compute the residual fluorescence rk
| 5 |
and select the gene jk+1, whose gene vector has the highest absolute dot product with the residual:
| 6 |
Rounds and channels containing bright signals corresponding to genes included in Λ may not be fully accounted for in the residual fluorescence rk, which could lead to false-positive detection of other genes on subsequent iterations. To control for this, the algorithm above is modified to weigh rounds and channels based on the amount of fluorescence attributed to them (see https://github.com/znamlab/iss-preprocess, based on https://github.com/jduffield65/coppafish).
The iteration continued until a maximum number of components was reached, or the dot product no longer reached a preset threshold. This resulted in a sparse approximation of the fluorescence in every pixel as a combination of a small number of gene-specific components.
The gene coefficients for each gene were then assembled into images and peaks were detected in these gene coefficient images. To distinguish genuine signals from spurious peaks, a spot shape score was assigned to each peak based on the similarity of the signal at that location to a precomputed spot shape image. Any peaks that have a spot score exceeding a manually selected threshold were retained for further analysis.
Hybridization spot detection
To detect gene spots, the bleedthrough vectors for each fluorophore were first estimated on a set of reference tiles as described above for sequencing rounds. Peaks were then detected on all tiles, and the mean fluorescence values in each channel at a disk with a 2-pixel/0.462 μm radius in each spot location were extracted. Fluorescence vectors for each spot were then compared to the bleedthrough matrix and assigned to the probe with the highest cosine similarity.
Registration between imaging tiles and cryosections
All image modalities were registered to the first gene round, aligning the gene spots, hybridization spots and DAPI fluorescence images on a tile-by-tile basis by estimating rotation and translation between the target and reference tiles as described above for registration across rounds.
The x/y shifts between adjacent tiles were estimated by phase correlation using the overlap regions. Large outlier shift values or shifts with low correlation maxima were corrected to the median shift along each tile row. These tile shifts were used to combine spot coordinates across tiles into a whole section coordinate system. To avoid duplicate spot detection in overlap regions, spots were only retained if they were closer to the center of the tile on which they were detected than the center of any other tile.
To register the spot coordinates from each section to a common coordinate system and determine their location within the brain, all sections were registered to the Allen CCFv3 10 μm coronal atlas35. First, stitched images of whole coronal sections were registered to in situ sequencing images, which contained only a part of one hemisphere, using masked phase correlation71. Coronal sections were downsampled, and cutting angles and positioning of slices along the Z-axis were estimated using Deepslice72. Affine transformation of the slices was performed using Elastix73 and non-rigid transformation was performed using BigWarp74, relying on manually selected landmarks. The stitched spot coordinates from each section were then converted to atlas coordinates. The BrainGlobeAtlas API75 was used to define brain area annotations.
The Allen CCFv3 coordinates were converted to a flattened cortical representation by using the CCF-streamlines package35. Non-cortical cells situated less than 150 μm from the cortex were projected to their closest neighboring voxel in the cortex. As the thickness of cortical layers varied across the sequenced volume, to plot the cortical depth of cells in flatmap coordinates while respecting layer borders (Fig. 4b and Fig. 5a), layer thickness was rescaled to the average layer thickness across V1.
Cell segmentation
Cell nuclei were segmented using Cellpose76. The “cyto” base model from Cellpose was fine-tuned using manually curated data, with DAPI fluorescence as the nuclei channel and the anchor hybridization probe that binds to all gene spots as a cytoplasmic channel. Cellpose was run on individual planes of DAPI Z-stacks, and the resultant masks were projected to a single plane, removing small masks or masks only found on a single plane and merging any remaining masks based on their spatial overlap.
To assign gene spots to cells, mask images from all tiles in each section were stitched together and dilated by 5 μm to expand the nuclei masks to cover the soma of each neuron. All gene spots within each dilated mask were assigned to it.
Assigning all barcode spots present within each dilated mask risks false positives, as rabies barcodes are present in the neuropil as well as in neuronal somata. Instead, barcodes were assigned to cells based on their spatial clustering using a probabilistic assignment model including a Gaussian spatial likelihood function, which considers the distance of a spot to a mask, a background component with a fixed low-density likelihood to account for spots that do not correspond to any specific mask, and a mask spot-count likelihood, which penalizes spot assignments to cells unless justified by the spatial data, encouraging sparseness. Each spot xi can be assigned to either a mask j ∈ {1, …, M} or to the background (denoted by −1). We define a spatial probability density function for a spot to originate from a specific mask or background, defined as
| 7 |
where is the 2D coordinates of spot i, is the centroid of mask j, σ is the spatial scale parameter and α is a small constant (e.g., 10−6) representing the background likelihood.
We also define a mask spot count probability function
| 8 |
where nj(z) is the number of spots assigned to mask j under the assignment vector z, m is the spot count scale factor, and β is an exponent that controls how the likelihood penalty scales with spot count. Setting β < 1 makes the log-penalty sublinear in nj, so the incremental penalty for each additional spot decreases with every added spot, favoring assigning spots to a small number of masks over splitting them across many masks. Combining the spot-wise assignment and the spot-count terms, the full likelihood for the whole assignment vector z is
| 9 |
where N is the total number of spots and M is the total number of cell masks.
Every barcode sequence is handled in isolation, such that the assignment of one barcode does not affect the assignments of other barcodes. Initially, spots falling within a specified maximum distance threshold are assigned to the nearest mask based on Euclidean distance. Spots that do not meet this criterion are assigned to the background. These initial spot assignments are then refined through an iterative optimization process. In each iteration, the algorithm explores potential reassignments of spots to masks by evaluating combinations of spots that are found close together, defined by an inter-spot distance threshold. For each valid combination of spots, the algorithm reassigned spots to a different mask or to the background to maximize the assignment likelihood. The algorithm prioritizes reassignments that yield the highest increase in overall likelihood, thereby iteratively improving the accuracy of spot-to-mask assignments. On each iteration, the algorithm evaluates two scenarios for each spot combination: moving the spots to a new mask and assigning them to the background. The optimization terminates once none of the spots are reassigned on a given iteration or the iteration limit is reached.
mCherry cell detection
To detect the nuclei of mCherry-positive starter neurons, mCherry fluorescence was first unmixed using fluorescence from the green (Chroma ET546/22x) channel. A difference of Gaussians filter was applied to the unmixed images, which were then binarized with a manually selected binarization threshold and binary closing was performed. Candidate mCherry nuclei were then detected on the binarized images. The masks were filtered based on minimum and maximum area, circularity, elongation, solidity and unbinarized intensity.
To assign mCherry masks to rabies-infected cells, the reference-aligned tile coordinates were used to make full-section stitched images of the mCherry masks and rabies spots coordinates. Each mCherry mask was first checked for any rabies spots that overlapped with it. If barcode spots were found in the mCherry mask, the cell to which the most abundant barcode belonged was checked to find all of its barcode spots. If the percentage of spots from that cell found within the mCherry mask was above a threshold (conservatively 10% of the total spots in the rabies-infected cell), and the centroid of the spots overlapped with the mCherry mask, then the mCherry mask was assigned to that cell.
Cell type classification
Single cell gene expression data was analyzed using the scanpy single-cell analysis toolkit77. First, cell-type clusters were defined for high-quality cells in a reference dataset collected from four coronal sections covering the visual cortex in a separate brain. High-quality cortical cells were selected as cells with ≥4 unique genes per cell and ≥30 gene counts per cell. Transcript counts in each cell were normalized and log1p-transformed (natural log with a pseudo-count of 1). The first 30 principal components were then used to compute the nearest-neighbors distance matrix and a neighborhood graph of the cells with the local neighborhood size set to 10. Cells were then clustered into subgroups using the Leiden algorithm78. The resulting clusters were manually annotated as cell types by referencing the expression of marker genes in the gene panel to a V1 SMARTseq scRNAseq dataset5 and by comparing the spatial location of each cell cluster with known cortical layers. Mean gene expression values were calculated per cluster.
For each cell j in the rabies in situ sequencing dataset, we calculated the Pearson correlation coefficient between the cell’s log-normalized expression vector xj and the log-mean expression vector μk of reference cluster k. For the analyses in Fig. 5a–g, excitatory rabies-infected cells were selected based on the identity of their highest correlation cluster. For the analyses in Fig. 5h-j, rabies-infected cells were classified as inhibitory if the cluster yielding their maximum correlation corresponded to one of the inhibitory reference clusters Pvalb, Sst, Vip, or Lamp5 and if they satisfied all three of the following thresholds: a Pearson correlation coefficient of 0.3, a minimum gene count of 3, and a minimum nearest-neighbor cluster label agreement of 0.3.
Clusters were visualized using Uniform Manifold Approximation and Projection (UMAP)79 with a minimum distance between embedded points of 0.05. Scanpy’s ingest function was used to project all in situ sequenced cells onto the PCA space of the high-quality cell reference data, followed by k-nearest-neighbor classification and UMAP embedding transfer for visualization of reference clusters (Fig. 2h, i).
Data analysis
Estimation of the proportion of cells present in the sequenced volume
To determine the proportion of starter cells contained in the in situ sequencing volume (Supplementary Fig. 5a), sections adjacent to the sequenced dataset were imaged and analyzed by following the mCherry imaging and mCherry cell detection steps described above.
To estimate the number of presynaptic cells included in the dataset (Supplementary Fig. 5b), the in situ sequenced volume was registered to the Allen CCFv3 reference atlas as described above. The sequenced volume was then superposed onto bulk rabies tracing data (Fig. 1i–k) by aligning the manually determined injection centers of the two experiments and the proportion of rabies-infected cells within this volume in bulk tracing data was quantified. For illustration, we plotted the medio-lateral and dorso-ventral position of cells within 400 μm of the central coronal plane over the atlas borders of this coronal plane (Supplementary Fig. 5b top) and the antero-posterior and medio-lateral position of all cells overlaid on a dorsal view of the atlas borders (Supplementary Fig. 5b bottom). The sequencing sections were not perfectly coronal and thalamic cells present in the volume (orange) appear anterior to the cortical cells.
Probability of barcode transmission between starter cells
The probability that a given starter neuron transmits its barcode to another starter cell (Fig. 1h), p, was estimated as a function of the number of neurons infected by each starter cell, n, and the proportion of neurons infected by the starter AAVs, α:
| 10 |
To convert between the proportion of starter neurons and cell density, the overall density of neurons in the visual cortex was estimated as 150,000 cells per mm380,81.
Library barcode abundance
To compare the sequences of barcodes found in situ to those found in the viral library (Fig. 3b, Supplementary Fig. 8a), we first determined the abundance distribution of barcodes in the library by grouping barcodes by their number of unique reads (sequences with the same barcode but different UMIs), and plotting the total proportion of the library represented in each of these abundance bins (Fig. 3b, black). Given that only a few barcodes have high abundance (Fig. 1d), they collectively represented only a small fraction of total reads in the library, and most reads of the library consisted of barcodes representing each about 10−5 of the library. We then matched the 2158 barcodes found in situ and the same number of randomly generated barcodes to the library barcodes and plotted the distribution of the abundance in the library of those matches (Fig. 3b, blue lines).
To determine the excess number of high abundance barcodes among those present in multiple starter cells (Supplementary Fig. 8b), the kernel density estimate of the distribution of barcode proportion of unique reads in the library (black, Supplementary Fig. 8a) was subtracted from that of barcodes present in multiple starters (pink, Supplementary Fig. 8a). Then, the area under the curve of this difference (pink, Supplementary Fig. 8b) was numerically integrated between 1.49 × 10−4 (where the difference exceeded 0) and 10−2 to obtain the proportion of excess barcodes, and multiplied by the total number of barcodes found in multiple cells (n = 122), to give the final estimate of 8/122 barcodes.
Starter cell mCherry fluorescence analysis
The H2B-mCherry intensity (Fig. 3f) was measured as the average fluorescence intensity of the red channel inside each starter cell mask. The logarithm of the intensity was then correlated to the logarithm of the number of presynaptic cells detected for each starter +1.
Quantification of multiple infection rates
To assess whether the observed distribution of unique viral barcodes per presynaptic cell was consistent with independent transsynaptic transmission events, we modeled the number of barcodes per cell as a Poisson process and tested for deviations from this null model. The injection site was defined from the spatial distribution of barcoded cells. Cell locations in Allen Reference Atlas coordinates were binned into a three-dimensional histogram with 100 μm isotropic voxels. The histogram was smoothed with a Gaussian kernel (σ = 200 μm), and the injection center was identified as the peak of the smoothed density field. We then analyzed the region including voxels where the smoothed density exceeded 50% of maximum (Supplementary Fig. 9a) and quantified the number unique barcodes (k = 1, 2, 3, 4, or ≥5) carried by each cell in that volume. Because non-neuronal cells (glia, endothelial cells) cannot be infected by the pseudotyped rabies virus, directly counting cells with zero barcodes would inflate the k = 0 bin. Instead, the total number of neurons in the region was estimated from the region volume assuming cortical neuron density of 150,000 neurons.mm−380,81, and the k = 0 count was set to Nneurons − ∑k≥1nk, where nk is the number of neurons with k barcodes. Expected counts were computed from the Poisson probability mass function with rate, λ, set to the observed sample mean. To test whether cells expressing more than 1 barcode (k ∈ {2, 3, 4}) occurred more frequently than predicted by the Poisson model, we performed a two-sided parametric bootstrap. In each of 5,000 replicates, N cells were drawn independently from Poisson(λ), and the surplus Sk = observedk − expectedk(λboot) was computed for each tested category and for the combined k ∈ {2, 3, 4} group. The p-value was calculated as , where pupper and plower are the fractions of bootstrap replicates with a S greater than or equal to 0, and less than or equal to 0, respectively.
Relative spatial location of presynaptic neurons
Position of the presynaptic cells relative to their starter cells (Fig. 4f top) were calculated using flatmap coordinates. The distribution of relative medio-lateral location (Fig. 4g) was the kernel density estimate of the difference in medio-lateral position only with a bandwidth of 50 μm. To estimate a null distribution assuming random connectivity, we shuffled the barcodes of presynaptic cells but not those of starter cells. This procedure preserves the number of presynaptic cells per starter and the spatial distribution of starter and presynaptic cells. A single example shuffled sample was used for the scatter plot of Fig. 4f (bottom). 10,000 bootstrap samples were used to calculate the confidence interval of medio-lateral distance distribution (Fig. 4g gray area). The median distance to the starter cells was computed in flatmap coordinates using the 3 dimensions and compared to that of the shuffled samples (see “Results”).
Layer- and cell-type-specific connectivity
The analysis of local excitatory connectivity in Fig. 5a–g included all putative local excitatory connections by removing cells classified as inhibitory and connections from presynaptic cells that were more than 1 mm away from their starter cell. Only starter cells with at least one local presynaptic cell were included for analysis. Input fractions (Fig. 5b–e) were calculated as the number of connections from each layer divided by the total number of local excitatory connections for each starter and averaged across starters in each layer. Output fractions (Fig. 5f, g) were computed by dividing the number of connections (Fig. 5b, left) by the sum of the number of connections per presynaptic layer.
To identify over- and under-represented connections, we shuffled the barcodes across presynaptic neurons, keeping their layer identity and spatial location unchanged, repeating the shuffling procedure 10,000 times. Effect sizes were computed as the ratio of the observed input and output fractions and the means of the shuffled samples (Fig. 5e, g, circle diameter and colormap sign). To estimate p-values, we computed the log effect size for individual shuffle samples and determined the quantile q of the effect size distribution at 0. We then calculated the uncorrected two-sided p-value as . These p-values from the bootstrap distribution were then corrected for a false discovery rate of 5% using Benjamini-Hochberg correction (Fig. 5e, colormap absolute value).
In the analysis of connectivity between inhibitory cell types (Fig. 5i), input fractions were calculated as the number of connections from each cell type divided by the total number of inhibitory connections for each starter and averaged across starters.
Confidence intervals for input fractions (Fig. 5c,d,j) were computed by bootstrap resampling starter cells with replacement 10,000 times as the [2.5–97.5] percentiles of the input fraction distributions.
Retinotopic location estimation
To relate long-range connectivity patterns to retinotopic organization of the visual cortex (Fig. 6), azimuth maps from Waters et al.82 were averaged and aligned to the top view projection. Each starter cell was assigned an azimuth location by projecting its coordinates onto the top view before querying the averaged map. To display the azimuth map in flatmap coordinates, we found the surface 3D voxel of each pixel on the top view projection (using the ‘view_lookup’ of the ccf_streamlines package) and mapped it to the closest flatmap coordinates. Missing pixels were then filled by bicubic interpolation.
The average map of starter ML position (Fig. 6c) was computed as the 2D Gaussian weighted average (σ = 200 μm) of data in Fig. 6a. This map was clipped using the concave hull of the presynaptic cells’ position to avoid extrapolation outside of the data range. A transparency mask proportional to the total weight of the 2D Gaussian was applied to indicate the number of data points at each map location.
The spatial distribution of the presynaptic cells across the mediolateral axis (Fig. 6e, purple) was computed as a locally weighted average using a one-dimensional Gaussian kernel density estimator with a sigma of 200 μm.
Statistics and reproducibility
No statistical method was used to predetermine sample size. Sample sizes were chosen according to the exploratory and technical aims of the experiments. The connectomic analysis used a single animal because it was intended as a technological demonstration rather than for population-level inference. Replicate numbers for the titration and control experiments were selected to assess reproducibility across animals and establish technically relevant differences between conditions. The experiments presented in Fig. 1h–k and Supplementary Fig. 2a–c used a single bulk sample. For Fig. 1l-n, one biological sample was analyzed for each PHP/AAV1 condition. The connectomic analyses presented in Figs. 3–6 were generated from a single animal. Supplementary Fig. 5b used one bulk-brain sample. Quantification of starter-cell density across AAV concentrations in Supplementary Fig. 2d was replicated using N = 4 mice for 6.8 × 108 vg, N = 3 mice for 2.2 × 109, 6.8 × 109 vg, N = 2 for 2.2 × 1010 vg. Control experiments examining direct rabies infection in Supplementary Fig. 7a,b were performed using two animals per condition. Mice were randomly assigned to experimental groups for experiments involving different injection conditions, including Fig. 1l–n and Supplementary Fig. 7a, b. No animals were excluded from the analyses. The Investigators were not blinded to allocation during experiments and outcome assessment. All statistical tests used for each analysis are described in the corresponding figure legends and Methods sections.
Reporting summary
Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.
Supplementary information
Description of Additional Supplementary Files
Source data
Acknowledgements
The authors would like to thank Sophie Wood for performing some of the surgical procedures, Scott Lighterness for tail vein injections, Matt Renshaw for help in designing the microscope, Andreas Schaefer, Johannes Kohl, Dinu Florin Albeanu, and James Briscoe for comments on the manuscript, Andrew Murray for providing the CVS-N2c-ΔG-mCherry rabies genomic plasmid that was used as the backbone for the barcoded rabies viral libraries (Addgene plasmid #73464) and N2A-N2cG cells used for cloning. The authors thank the staff of the Making Lab, Genomics, Light Microscopy, and Biological Research Facilities at the Francis Crick Institute for supporting this work.
Author contributions
P.Z. and A.Be. conceived the study. A.Be. and M.S. generated barcoded rabies libraries. A.Be. and A.Bl. carried out barcoded rabies tracing experiments. A.Be., A.Bl., and P.Z. analyzed the data and wrote the manuscript.
Peer review
Peer review information
Nature Communications thanks Longwen Huang and the other anonymous reviewer(s) for their contribution to the peer review of this work. A peer review file is available.
Funding
This work was supported by the Francis Crick Institute which receives its core funding from Cancer Research UK (CC2108), the UK Medical Research Council (CC2108), and the Wellcome Trust (CC2108). Open Access funding provided by The Francis Crick Institute.
Data availability
The raw and processed library sequencing data generated in this study have been deposited on the GEO database under accession code GSE302891. All other data required to reproduce the analyses, including preprocessed in situ sequencing data, have been deposited on Figshare at https://doi.org/10.25418/crick.29591696. The raw in situ sequencing image datasets are not deposited in a public repository due to their prohibitive size (~150 TB). They are available for research purposes from Petr Znamenskiy (petr.znamenskiy@crick.ac.uk). Source data are provided with this paper.
Code availability
Original code required to reproduce the analyses has been deposited on Zenodo at https://doi.org/10.5281/zenodo.21499113. Code for processing raw in situ sequencing data is available at https://github.com/znamlab/iss-preprocess and https://github.com/znamlab/iss-analysis.
Competing interests
The authors declare no competing interests.
Footnotes
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
These authors contributed equally: Alexander Becalick, Antonin Blot.
Supplementary information
The online version contains supplementary material available at https://doi.org/10.1038/s41467-026-77105-y.
References
- 1.Bae, J. A. et al. Functional connectomics spanning multiple areas of mouse visual cortex. Nature640, 435–447 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 2.Shapson-Coe, A. et al. A petavoxel fragment of human cerebral cortex reconstructed at nanoscale resolution. Science384, eadk4858 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 3.Dorkenwald, S. et al. Neuronal wiring diagram of an adult brain. Nature634, 124–138 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4.Tasic, B. et al. Adult mouse cortical cell taxonomy revealed by single cell transcriptomics. Nat. Neurosci.19, 335–346 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5.Tasic, B. et al. Shared and distinct transcriptomic cell types across neocortical areas. Nature563, 72–78 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6.Zeisel, A. et al. Molecular architecture of the mouse nervous system. Cell174, 999–1014.e22 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7.Zhang, M. et al. Spatially resolved cell atlas of the mouse primary motor cortex by MERFISH. Nature598, 137–143 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 8.Yao, S. et al. A whole-brain monosynaptic input connectome to neuron classes in mouse visual cortex. Nat. Neurosci.26, 350–364 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 9.Economo, M. N. et al. Distinct descending motor cortex pathways and their roles in movement. Nature563, 79–84 (2018). [DOI] [PubMed] [Google Scholar]
- 10.Scala, F. et al. Phenotypic variation of transcriptomic cell types in mouse motor cortex. Nature598, 144–150 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 11.Zador, A. M. et al. Sequencing the connectome. PLOS Biol.10, e1001411 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 12.Peikon, I. D. et al. Using high-throughput barcode sequencing to efficiently map connectomes. Nucleic Acids Res.45, e115–e115 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 13.Oyibo, H. et al. A computational framework for converting high-throughput DNA sequencing data into neural circuit connectivity. bioRxiv preprint. 10.1101/244079. (2018). [DOI]
- 14.Saunders, A. et al. Ascertaining cells’ synaptic connections and RNA expression simultaneously with barcoded rabies virus libraries. Nat. Commun.13, 6993 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15.Zhang, A. et al. Rabies virus-based barcoded neuroanatomy resolved by single-cell RNA and in situ sequencing. eLife12, RP87866 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 16.Lin, Z. et al. Mapping brain-wide monosynaptic inputs to single neurons with ROInet-seq. Cell Rep. Methods6, 101512 (2026). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17.Shin, D. et al. High-complexity barcoded rabies virus for scalable circuit mapping using single-cell and single-nucleus sequencing. bioRxiv preprint. 10.1101/2024.10.01.616167 (2024). [DOI]
- 18.Wickersham, I. R., Finke, S., Conzelmann, K. K. & Callaway, E. M. Retrograde neuronal tracing with a deletion-mutant rabies virus. Nat. Methods4, 47–49 (2007). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 19.Wall, N. R., Wickersham, I. R., Cetin, A., De La Parra, M. & Callaway, E. M. Monosynaptic circuit tracing in vivo through Cre-dependent targeting and complementation of modified rabies virus. Proc. Natl. Acad. Sci.107, 21848–21853 (2010). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 20.Reardon, T. R. et al. Rabies virus CVS-N2cΔG strain enhances retrograde synaptic transfer and neuronal viability. Neuron89, 711–724 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 21.Schnell, M., Mebatsion, T. & Conzelmann, K. Infectious rabies viruses from cloned cDNA. EMBO J.13, 4195–4203 (1994). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22.Pattnaik, A. K., Ball, L. A., LeGrone, A. W. & Wertz, G. W. Infectious defective interfering particles of VSV from transcripts of a cDNA clone. Cell69, 1011–1020 (1992). [DOI] [PubMed] [Google Scholar]
- 23.Conzelmann, K. K. & Schnell, M. Rescue of synthetic genomic RNA analogs of rabies virus by plasmid-encoded proteins. J. Virol.68, 713–719 (1994). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 24.Ghanem, A., Kern, A. & Conzelmann, K. K. Significantly improved rescue of rabies virus from cDNA plasmids. Eur. J. Cell Biol.91, 10–16 (2012). [DOI] [PubMed] [Google Scholar]
- 25.Kebschull, J. M. & Zador, A. M. Cellular barcoding: lineage tracing, screening and beyond. Nat. Methods15, 871–879 (2018). [DOI] [PubMed] [Google Scholar]
- 26.Clark, I. C. et al. Barcoded viral tracing of single-cell interactions in central nervous system inflammation. Science372, eabf1230 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 27.Tan, K. et al. One-step approach producing barcoded rabies virus with optimized diversity. Cell Rep. Methods5, 101245 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 28.Chatterjee, D. et al. Enhanced CNS transduction from AAV.PHP.eB infusion into the cisterna magna of older adult rats compared to AAV9. Gene Ther.29, 390–397 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 29.Sun, Y. C. et al. Integrating barcoded neuroanatomy with spatial transcriptional profiling enables identification of gene correlates of projections. Nat. Neurosci.24, 873–885 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 30.Bugeon, S. et al. A transcriptomic axis predicts state modulation of cortical interneurons. Nature607, 330–338 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 31.Yuan, L., Chen, X., Zhan, H., Henry, G. L. & Zador, A. M. Massive multiplexing of spatially resolved single neuron projections with axonal BARseq. Nat. Commun.15, 8371 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 32.Liu, Z. et al. Systematic comparison of 2A peptides for cloning multi-genes in a polycistronic vector. Sci. Rep.7, 2193 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 33.Kim, E. J., Jacobs, M. W., Ito-Cole, T. & Callaway, E. M. Improved monosynaptic neural circuit tracing using engineered rabies virus glycoproteins. Cell Rep.15, 692–699 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 34.Jia, F. et al. Development of a rabies virus-based retrograde tracer with high trans-monosynaptic efficiency by reshuffling glycoprotein. Mol. Brain14, 109 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 35.Wang, Q. et al. The Allen mouse brain Common Coordinate Framework: a 3D reference atlas. Cell181, 936–953.e20 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 36.Brown, D. et al. Deep parallel characterization of AAV tropism and AAV-mediated transcriptional changes via single-cell RNA sequencing. Front. Immunol.12, 730825 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 37.Jang, M. J. et al. Spatial transcriptomics for profiling the tropism of viral vectors in tissues. Nat. Biotechnol.41, 1272–1286 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 38.Ohara, S. et al. Dual transneuronal tracing in the rat entorhinal-hippocampal circuit by intracerebral injection of recombinant rabies virus vectors. Front. Neuroanat.3, 1 (2009). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 39.Levy, R. B. & Reyes, A. D. Spatial profile of excitatory and inhibitory synaptic connectivity in mouse primary auditory cortex. J. Neurosci.32, 5609–5619 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 40.Campagnola, L. et al. Local connectivity and synaptic dynamics in mouse and human neocortex. Science75, eabj5861 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 41.Douglas, R. J. & Martin, K. A. C. Neuronal circuits of the neocortex. Annu. Rev. Neurosci.27, 419–451 (2004). [DOI] [PubMed] [Google Scholar]
- 42.Patiño, M., Rossa, M. A., Lagos, W. N., Patne, N. S. & Callaway, E. M. Transcriptomic cell-type specificity of local cortical circuits. Neuron112, 3851–3866.e4 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 43.Pfeffer, C. K., Xue, M., He, M., Huang, Z. J. & Scanziani, M. Inhibition of inhibition in visual cortex: the logic of connections between molecularly distinct interneurons. Nat. Neurosci.16, 1068–1076 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 44.Wang, Q. & Burkhalter, A. Area map of mouse visual cortex. J. Comp. Neurol.502, 339–357 (2007). [DOI] [PubMed] [Google Scholar]
- 45.Kalatsky, V. A. & Stryker, M. P. New paradigm for optical imaging: temporally encoded maps of intrinsic signal. Neuron38, 529–545 (2003). [DOI] [PubMed] [Google Scholar]
- 46.Garrett, M. E., Nauhaus, I., Marshel, J. H. & Callaway, E. M. Topography and areal organization of mouse visual cortex. J. Neurosci.34, 12587–12600 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 47.Kebschull, J. M. & Zador, A. M. Sources of PCR-induced distortions in high-throughput sequencing data sets. Nucleic Acids Res.43, e143 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 48.Tan, K. et al. Development and application of a barcoded rabies viral tracing method for mapping brain-wide inputs to single neurons. Cell Rep. Methods5, 101244 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 49.Ballesteros-Yáñez, I., Benavides-Piccione, R., Elston, G. N., Yuste, R. & DeFelipe, J. Density and morphology of dendritic spines in mouse neocortex. Neuroscience138, 403–409 (2006). [DOI] [PubMed] [Google Scholar]
- 50.Markram, H., Lübke, J., Frotscher, M., Roth, A. & Sakmann, B. Physiology and anatomy of synaptic connections between thick tufted pyramidal neurones in the developing rat neocortex. J. Physiol.500, 409–440 (1997). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 51.Chan, K. Y. et al. Engineered AAVs for efficient noninvasive gene delivery to the central and peripheral nervous systems. Nat. Neurosci.20, 1172–1179 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 52.Osakada, F. & Callaway, E. M. Design and generation of recombinant rabies virus vectors. Nat. Protoc.8, 1583–1601 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 53.Stukenberg, D. et al. The Marburg Collection: a Golden Gate DNA assembly framework for synthetic biology applications in Vibrio natriegens. ACS Synth. Biol.10, 1904–1919 (2021). [DOI] [PubMed] [Google Scholar]
- 54.Gee, P. et al. Extracellular nanovesicles for packaging of CRISPR-Cas9 protein and sgRNA to induce therapeutic exon skipping. Nat. Commun.11, 1334 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 55.Wang, Y., Bergelson, S. & Feschenko, M. Determination of lentiviral infectious titer by a novel droplet digital PCR method. Hum. Gene Ther. Methods29, 96–103 (2018). [DOI] [PubMed] [Google Scholar]
- 56.Finke, S. & Conzelmann, K. K. Virus promoters determine interference by defective RNAs: selective amplification of mini-RNA vectors and rescue from cDNA by a 3’ copy-back ambisense rabies virus. J. Virol.73, 3818–3825 (1999). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 57.Finke, S., Mueller-Waldeck, R. & Conzelmann, K. K. Rabies virus matrix protein regulates the balance of virus transcription and replication. J. Gen. Virol.84, 1613–1621 (2003). [DOI] [PubMed] [Google Scholar]
- 58.Yun, T. et al. Efficient reverse genetics reveals genetic determinants of budding and fusogenic differences between Nipah and Hendra viruses and enables real-time monitoring of viral spread in small animal models of henipavirus infection. J. Virol.89, 1242–1253 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 59.Kebschull, J. M. et al. High-throughput mapping of single-neuron projections by sequencing of barcoded RNA. Neuron91, 975–987 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 60.Langmead, B. & Salzberg, S. L. Fast gapped-read alignment with Bowtie 2. Nat. Methods9, 357–359 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 61.Mayerich, D., Abbott, L. & McCormick, B. Knife-edge scanning microscopy for imaging and reconstruction of three-dimensional anatomical structures of the mouse brain. J. Microsc.231, 134–143 (2008). [DOI] [PubMed] [Google Scholar]
- 62.Ragan, T. et al. Nat. Methods9, 255–258 10.1038/nmeth.1854 (2012). [DOI] [PMC free article] [PubMed]
- 63.Campbell, R. et al. SainsburyWellcomeCentre/BakingTray: Jan 2020. Zenodo. 10.5281/zenodo.3631610 (2020). [DOI]
- 64.Campbell, R., Blot, A., & lguerard. SainsburyWellcomeCentre/StitchIt: Last release of stitching model 1. Zenodo. 10.5281/zenodo.3941901 (2020). [DOI]
- 65.Tyson, A. L. et al. A deep learning algorithm for 3D cell detection in whole mouse brain image datasets. PLOS Comput. Biol.17, e1009074 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 66.Qian, X. et al. Probabilistic cell typing enables fine mapping of closely related cell types in situ. Nat. Methods17, 101–106 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 67.Patiño, M. et al. Single-cell transcriptomic classification of rabies-infected cortical neurons. Proc. Natl. Acad. Sci.119, e2203677119 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 68.Edelstein, A., Amodaj, N., Hoover, K., Vale, R. & Stuurman, N. Computer control of microscopes using μManager. Curr. Protoc. Mol. Biol.92, 14.20.1–14.20.17 (2010). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 69.Pinkard, H. et al. Pycro-Manager: open-source software for customized and reproducible microscope control. Nat. Methods18, 226–228 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 70.Pati, Y., Rezaiifar, R. & Krishnaprasad, P. Orthogonal matching pursuit: recursive function approximation with applications to wavelet decomposition. In Proc. 27th Asilomar Conference on Signals, Systems and Computers, Vol. 1, 40–44. 10.1109/ACSSC.1993.342465 (1993). [DOI]
- 71.Padfield, D. et al. Masked object registration in the Fourier domain. IEEE Trans. Image Process.21, 2706–2718 (2012). [DOI] [PubMed] [Google Scholar]
- 72.Carey, H. et al. DeepSlice: rapid fully automatic registration of mouse brain imaging to a volumetric atlas. Nat. Commun.14, 5884 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 73.Klein, S., Staring, M., Murphy, K., Viergever, M. & Pluim, J. elastix: a toolbox for intensity-based medical image registration. IEEE Trans. Med. Imaging29, 196–205 (2010). [DOI] [PubMed] [Google Scholar]
- 74.Bogovic, J.A., Hanslovsky, P., Wong, A., & Saalfeld, S. Robust registration of calcium images by learned contrast synthesis. In 2016 IEEE 13th International Symposium on Biomedical Imaging (ISBI) 1123–1126. 10.1109/ISBI.2016.7493463 (2016). [DOI]
- 75.Claudi, F. et al. BrainGlobe Atlas API: a common interface for neuroanatomical atlases. J. Open Source Softw.5, 2668 (2020). [Google Scholar]
- 76.Stringer, C. & Pachitariu, M. Cellpose3: one-click image restoration for improved cellular segmentation. Nat. Methods22, 592–599 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 77.Wolf, F. A., Angerer, P. & Theis, F. J. SCANPY: large-scale single-cell gene expression data analysis. Genome Biol.19, 15 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 78.Traag, V. A., Waltman, L. & van Eck, N. J. From Louvain to Leiden: guaranteeing well-connected communities. Sci. Rep.9, 5233 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 79.McInnes, L., Healy, J., and Melville, J. UMAP: Uniform Manifold Approximation and Projection for dimension reduction. 10.48550/arXiv.1802.03426 (2018). [DOI]
- 80.Herculano-Houzel, S., Watson, C. R. & Paxinos, G. Distribution of neurons in functional areas of the mouse cerebral cortex reveals quantitatively different cortical zones. Front. Neuroanat.7, 35 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 81.Murakami, T. C. et al. A three-dimensional single-cell-resolution whole-brain atlas using CUBIC-X expansion microscopy and tissue clearing. Nat. Neurosci.21, 625–637 (2018). [DOI] [PubMed] [Google Scholar]
- 82.Waters, J. et al. Biological variation in the sizes, shapes and locations of visual cortical areas in the mouse. PLoS ONE14, e0213924 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Description of Additional Supplementary Files
Data Availability Statement
The raw and processed library sequencing data generated in this study have been deposited on the GEO database under accession code GSE302891. All other data required to reproduce the analyses, including preprocessed in situ sequencing data, have been deposited on Figshare at https://doi.org/10.25418/crick.29591696. The raw in situ sequencing image datasets are not deposited in a public repository due to their prohibitive size (~150 TB). They are available for research purposes from Petr Znamenskiy (petr.znamenskiy@crick.ac.uk). Source data are provided with this paper.
Original code required to reproduce the analyses has been deposited on Zenodo at https://doi.org/10.5281/zenodo.21499113. Code for processing raw in situ sequencing data is available at https://github.com/znamlab/iss-preprocess and https://github.com/znamlab/iss-analysis.
