Multiplexed detection of RNA using MERFISH and branched DNA amplification

Multiplexed error-robust fluorescence in situ hybridization (MERFISH) allows simultaneous imaging of numerous RNA species in their native cellular environment and hence spatially resolved single-cell transcriptomic measurements. However, the relatively modest brightness of signals from single RNA molecules can become limiting in a number of applications, such as increasing the imaging throughput, imaging shorter RNAs, and imaging samples with high degrees of background, such as some tissue samples. Here, we report a branched DNA (bDNA) amplification approach for MERFISH measurements. This approach produces a drastic signal increase in RNA FISH samples without increasing the fluorescent spot size for individual RNAs or increasing the variation in brightness from spot to spot, properties that are important for MERFISH imaging. Using this amplification approach in combination with MERFISH, we demonstrated RNA imaging and profiling with a near 100% detection efficiency. We further demonstrated that signal amplification improves MERFISH performance when fewer FISH probes are used for each RNA species, which should allow shorter RNAs to be imaged. We anticipate that the combination of bDNA amplification with MERFISH should facilitate many other applications and extend the range of biological questions that can be addressed by this technique in both cell culture and tissues.

Single-molecule fluorescence in situ hybridization (smFISH) provides both quantitative measurements of RNA expression and information about RNA spatial localization by directly imaging individual RNA molecules in single cells 1,2 . The ability of smFISH to visualize gene expression at single-cell resolution has generated many critical insights for different biological processes, such as cell fate determination during cell division, local translation, cell migration, the establishment of cell polarity, and body patterning in development 3 . In recent years, multiplexed smFISH [4][5][6][7][8][9] and in situ sequencing [10][11][12] have been developed to increase the number of RNA species that can be simultaneously imaged within cells or tissues, with several technologies enabling the profiling of hundreds to thousands of RNAs simultaneously at single cell resolution 9,[11][12][13] . These approaches have been used to reveal the internal organization of the transcriptome within cells, discover novel cell types and identify cells based on their expression profile, and map out the organization of different cell types within tissues 9,[12][13][14] . Among these approaches, multiplexed error robust fluorescence in situ hybridization (MERFISH) massively multiplexes smFISH by assigning error-robust barcodes to individual RNA species, labeling RNAs with oligonucleotides that represent each barcode, and sequential smFISH imaging to read out these barcodes 9 , which has allowed single-cell transcriptomic profiling in both cultured cells or tissue slices 9,14,15 .
The fluorescent signal produced from a single RNA molecule in MERFISH is generated from the binding of multiple fluorescently labeled probes to each RNA. While the signal produced from these probes is sufficiently bright to allow individual RNA molecules to be identified and detected in cell culture 9,16 and cleared slices of the mouse brain 14,15 , the limited brightness of these signals makes some biological questions still challenging to address. For example, limited signal brightness requires relatively long camera exposures with high-power laser illumination sources, which in turn limits the number of cells and the volume of tissue that can be imaged in a given time. Thus, increasing the signal brightness of individual molecules in MERFISH measurements would not only increase the imaging throughput but would also allow lower power lasers or other illumination means and

Results
The design of a bDNA amplification scheme for MERFISH measurements. To perform MERFISH measurements, we assign each RNA of interest a unique barcode drawn from a barcoding scheme that enables error detection and, when needed, error correction. The sample is then stained with a complex library of oligonucleotide probes, termed encoding probes, which effectively imprint the desired barcode onto each RNA species 9,16 . Each encoding probe contains a 30-mer 'target region' , whose sequence is complimentary to a region of the target RNA, and multiple 20-mer 'readout' sequences ( Fig. 1a). For binary barcodes, we assign one unique readout sequence to each bit in the barcode, and the encoding probe set corresponding to a given RNA contains the readout sequences for the bits at which the barcode assigned to that RNA reads '1' . The value ('1' or '0') of a given bit is then determined by hybridizing a fluorescently labeled 'readout probe' complementary to the corresponding readout sequence.
Our strategy to incorporate bDNA amplification with MERFISH is summarized in Fig. 1. First, we bind to the sample MERFISH encoding probes as described above. We then bind a set of primary amplifier oligonucleotides, in which a unique primary amplifier is targeted to each readout sequence (Fig. 1b). Each primary amplifier contains N repeats of a unique 20-mer binding site. A set of secondary amplifier oligonucleotides are then added to the sample (Fig. 1c). Each unique secondary amplifier is targeted to the binding site on one corresponding primary amplifier and contains N repeats of another unique 20-mer binding site (Fig. 1c). To readout the bit associated with a given readout sequence on the encoding probes, we then hybridize to the sample a www.nature.com/scientificreports www.nature.com/scientificreports/ fluorescently labeled probe targeting the binding site on the secondary amplifier associated with that readout sequence (Fig. 1d). In this fashion, each original readout sequence would be amplified into N 2 copies of another binding sequence that allows the binding of N 2 fluorescent probes. Thus, the effective readout signal would be theoretically amplified N 2 fold. We term this process N × N amplification.
In addition, we made one modification in our design of the bDNA amplifiers as compared to those previously reported 24,30 to potentially improve the performance of these amplifiers. Specifically, we designed the amplifiers sequences using only three of the four nucleotides with the primary amplifiers comprising only A, T, and C and the secondary amplifiers comprising only A, T, and G. It has been shown previously that FISH probe sequences comprising only three of the four nucleotides are substantially less likely to form secondary structures than sequences comprising all four nucleotides 31 . In addition, we have previously shown that MERFISH readout probes designed using this reduced nucleotide alphabet strategy have higher hybridization rates and binding specificity, likely because of the reduced probability in forming secondary structures 16 . Thus, we anticipate that amplifiers comprising only three of the four nucleotides will also have a lower probability to form undesired secondary structures, which should in turn lead to higher hybridization rates and higher probabilities of assembling correctly.
Properties of bDNA amplification. To test this strategy and quantify the performance of bDNA amplification on readout sequences, we first designed one pair of three-letter bDNA amplifiers and performed Each encoding probe has a 30-mer target sequence (black line) and multiple readout sequences (yellow, green, purple, and blue lines represent different readout sequences). (b) Schematic depiction of the binding of two primary amplifier oligonucleotides to their corresponding readout sequences for the encoding probe in the dashed box in (a). The primary amplifiers have a complimentary sequence to the readout sequence on encoding probes (blue or purple lines) and N 20-mer repeating sequences unique to each primary amplifier (tan or red lines). (c) Schematic depiction of the binding of secondary amplifiers to the primary amplifier's repeating regions. The secondary amplifiers have a complimentary sequence to one of the 20-mer repeating sequences on the primary amplifiers (tan or red lines) and N 20-mer repeating sequences unique to each secondary amplifier (orange or green lines). (d) Schematic depiction of the binding of a fluorescently labeled readout probe in a N × N amplified specimen after the first round of MERFISH readout. There is a one-to-one correspondence between the readout sequence on the encoding probe and the repeated binding site on the secondary amplifier in the bDNA structure bound to that readout sequence. (e) Schematic depiction of the first round of MERFISH readout staining without amplification.
www.nature.com/scientificreports www.nature.com/scientificreports/ amplification on smFISH probes targeting a single RNA. The smFISH probes were designed in a similar way to MERFISH encoding probes: each smFISH probe contains a 30-mer target sequence complimentary to the target RNA template and four different 20-mer readout sequences used in MERFISH measurements. We only used one of these readout sequences for this smFISH measurement. We designed 48 encoding probes targeting different regions of the filamin A (FLNA) mRNA. We then stained a culture of human osteosarcoma cells (U-2 OS) with these probes. To reduce background, we utilized a matrix imprinting and clearing approach in which these samples were also stained with an acrydite-modified poly(dT) locked nucleic acid (LNA) oligonucleotide 'anchor probe' that targets the poly(A) tail of mRNAs 15 . We then embedded these samples in a thin film of polyacrylamide to which the anchor probes were covalently incorporated, followed by detergent and proteinase K treatment to clear the sample of lipids and proteins.
Following the clearing, we stained these samples with the primary amplifier for 15 minutes. We then washed the sample for 15 minutes in the same conditions to remove excess primary amplifier and repeated this process with the secondary amplifier. Each amplifier contained 5 binding sites in this 5 × 5 amplification scheme. We then measured the average FLNA smFISH spot brightness of samples either directly labeled with readout probes on the encoding probes (unamplified) or labeled with readout probes targeting the amplified bDNA (amplified) (Fig. 2a,b). We observed a 10.5-fold signal increase averaged across ~10,000 molecules in the amplified scheme versus the unamplified detection scheme (Fig. 2c). This increase represents 42% of the theoretical maximum amplification value.
To test whether the lower than theoretical maximum amplification factor was due to an insufficient staining time, we conducted a time series of the same 5 × 5 amplification, with increasing amplifier staining time. We found that the amplified signal was already saturated when we hybridized amplifiers with 15 minutes each round (Fig. 2c).
Next, we asked whether the number of repeating sequences on each amplifier could change the amplification performance. We designed a pair of 4 × 4 amplifiers and 9 × 9 amplifiers using the same binding sequences in the 5 × 5 amplifiers described above and repeated the amplification with FLNA smFISH probes (Fig. 2d). We observed a 5.5-fold and a 30.6-fold signal increase with 4 × 4 amplification and 9 × 9 amplification, respectively. Thus, the degree of amplification can be tuned with the number of binding sites, and for all amplification schemes tested we observed ~40% of the theoretical amplification values.
One potential, undesired consequence of amplification is the increase of FISH spot sizes, which could limit the density of RNAs that can be imaged and identified due to an increased chance of signal overlap between neighboring molecules. As a rough estimate of the potential spot size increase due to bDNA amplification, we considered the length of a fully extended 9 × 9 amplifier scaffold which is expected to be 132 nm. This length is within the diffraction limit; thus, we did not anticipate a measurable increase in the spot size with even the largest amplification considered. Indeed, the measured spot sizes of unamplified, 4 × 4 amplified, 5 × 5 amplified, and 9 × 9 amplified samples were identical (Fig. 2e).
Another concern for amplification approaches is the potential to increase the variability in brightness from one molecule to another based on differential amplification. In principle, the finite amplification provided by the defined assembly of the bDNA structures should limit this variability, as the assembly reaction can be run to completion or saturation. To determine any potential increase in the variation in spot brightness due to amplification, we measured the coefficient of variation in spot brightness for unamplified, 4 × 4 amplified, 5 × 5 amplified, and 9 × 9 amplified samples. Notably, we found that the coefficient of variation is similar for all degrees of bDNA amplification, indicating that this approach does not increase the variation in spot brightness beyond that observed for unamplified samples (Fig. 2f).
Amplifier screening for MERFISH imaging. To extend bDNA amplification to MERFISH measurements, it is necessary to have a unique primary and secondary amplifier pair for each readout sequence used in the measurement. For example, with a previously published 16-bit, modified Hamming distance-4 (MHD4) encoding scheme 9 , 16 pairs of primary and secondary amplifiers are needed. However, previous applications of bDNA have only reported a few amplifier pairs 24,26,30 and the reported pairs did not utilize the three letter alphabet; thus, it was necessary for us to design a large set of new amplifier pairs. To this end, we anticipated that the lower probability of secondary structure formation provided by the use of three-letter sequences would be beneficial.
We designed random 20-mer, three-letter repeating sequences with a per-base probability of 25% for A, 25% for T, and 50% for C (for primary amplifiers) or 25% for A, 25% for T, and 50% for G (for secondary amplifiers). We selected from these sequences a set of orthogonal sequences with limited cross homology using a previously described algorithm 32 and then blasted these sequences to the human transcriptome to avoid homology regions longer than 11 nucleotides, as described previously 16 . We designed a set of orthogonal 5 × 5 amplifier pairs with 20-mer, three-letter sequences and screened each of these pairs for its ability to amplify smFISH signals. We found that 80% of the amplifier pairs designed worked as predicted, producing uniform, bright signals. The remaining 20% of the amplifiers revealed two types of defects (Fig. 3). First, we observed that a small number of secondary amplifiers bound to other cellular components than RNA targets (i.e. the binding of these amplifiers did not require encoding probes or primary amplifiers) (Fig. 3a,b). These signals were RNase-dependent indicating that these amplifiers were binding non-specifically to cellular RNA (Fig. 3c). Given the cellular distribution of this binding, we suspected these guanine-rich secondary amplifier sequences might form G-quadruplex structures with mitochondrial RNAs 33 . In parallel, we observed a small number of amplifier pairs that assembled with much lower efficiency, producing only small degrees of amplification (Fig. 3e), perhaps due to low melting temperature or the formation of G-quadruplex structures that inhibit proper amplifier assembly. When we replaced these amplifiers with new pairs containing different sequences, both the high background problem (Fig. 3d) and the low amplification efficiency problem were solved (Fig. 3f). Thus, from 20 pairs of 5 × 5 amplifiers, we identified 16 suitable for MERFISH imaging (Table S1). We chose the 5 × 5 amplification scheme for this purpose because (2019) 9:7721 | https://doi.org/10.1038/s41598-019-43943-8 www.nature.com/scientificreports www.nature.com/scientificreports/ www.nature.com/scientificreports www.nature.com/scientificreports/ the amplifier oligos used in this scheme (130-nt long) appeared to be more robustly synthesized by solid-phase synthesis, whereas the length of 9 × 9 amplifiers (200 nt) sometimes posed challenge for robust solid-phase synthesis -the successful delivery rates of the 130-nt and 200-nt amplifiers by the company that we order the oligos from were 100% and ~60% respectively.

MERFISH measurements with bDNA amplification.
To determine if the 16 pairs of amplifiers we identified work with MERFISH measurements, we performed 5 × 5 amplification on a 130-RNA library that has been previously measuring using MERFISH without amplification and which showed both high accuracy and high detection efficiency 16 . We performed MERFISH imaging in U-2 OS cells, and used 8 rounds of two-color imaging to read out 16 bits, as well as reductive cleavage of disulfide bonds to remove the fluorophores linked to the readout probes between consecutive rounds of imaging for both amplified and unamplified samples, as described previously 16 . Figure 4a-c shows that individual RNA molecules could be clearly detected in each of the eight hybridization and imaging rounds of 5 × 5 amplified samples, allowing their identities to be decoded.
To determine the performance of MERFISH in amplified samples, we considered several performance metrics. First, we examined the average count per cell of the 10 barcodes not assigned to any RNAs, i.e. 'blank' barcodes. We found that 121 of the 130 RNA species in the 5 × 5 amplified MERFISH measurement had a higher copy number per cell than the maximum copy number per cell observed with the blank barcodes (Fig. 4d). A similar rate of 'blank' barcode detection was observed previously in unamplified samples 16 , indicating that amplification does not increase RNA misidentification rates. Next, we investigated the average 1-to-0 error and 0-to-1 error rate for each bit (Fig. 4e). We observed an average 1-to-0 error rate of ∼1.7% and a 0-to-1 error rate of ∼0.6%, comparable to the values observed previously with unamplified data 15 .
In addition, we found that the copy number per cell results were highly reproducible between replicates of MERFISH experiments with amplification (Fig. 4f). Next, to determine if amplification resulted in a decreased ability to detect RNAs, we compared the average copy number per cell from 5 × 5 amplified data with that from previously unamplified MERFISH data 15 , with the measured values per gene averaged across three replicates of amplified and unamplified samples. We found that these values correlated strongly with a Pearson correlation coefficient of 0.98 ( Fig. 4g; ρ10 = 0.98 for the 123 RNA species whose measured copy numbers were larger than that observed for the largest blank barcode count) and that the average ratio was 1.04 ± 0.03 (SEM, n = 123 RNAs). Thus, we conclude that amplification maintained the high detection efficiency (>90%) previously reported for MERFISH 15 .
In addition, we compared the average copy number per cell detected for these RNAs by 5 × 5 amplified MERFISH measurements with the RNA abundance measured by RNA-seq (Fig. 4h). We observed a Pearson correlation coefficient of 0.91, comparable to our previously published data from unamplified samples 16 . Thus, based on each of these performance metrics, we conclude that bDNA amplification substantially increases the brightness of individual molecules measured with MERFISH without introducing additional noise. www.nature.com/scientificreports www.nature.com/scientificreports/ Amplification improves the performance of MERFISH for measurements with fewer encoding probes. The brightness of RNA signals in unamplified MERFISH measurements is set by the number of unique encoding probes targeted to each RNA; thus, amplification of MERFISH signals should allow the number of encoding probes per RNA to be reduced, which in turn would allow shorter genes to be targeted with MERFISH. However, it is worth noting that decreasing the number of encoding probes per gene will both decrease the average brightness of individual RNAs and increase the probability that a given RNA will, stochastically, not bind any encoding probes. Both of these effects are expected to decrease the efficiency of RNA detection with MERFISH; however, signal amplification is expected to only overcome the challenges introduced with the decrease in average signal brightness. Thus, we anticipate that the use of amplification will increase the detection efficiency in these cases but may not increase it to 100%. www.nature.com/scientificreports www.nature.com/scientificreports/ To test the ability of bDNA amplification to improve the performance of MERFISH in circumstances where fewer encoding probes are used per gene, we designed an encoding probe library targeting the same 130 genes utilized above but in which we included only 16 encoding probes for each gene as opposed to the 92 utilized above. We have previously shown that the detection efficiency of MERFISH experiments is nearly 100% when 92 encoding probes are used per gene. This experimental design thus allowed us to compare the results with the 92-probe experiments to quantify detection efficiency. We first performed MERFISH measurements with 16 encoding probes per gene in U-2 OS cells (Fig. 5a,b) without bDNA amplification. As expected, we observed that the signals from individual RNA molecules in each round of staining and imaging were indeed substantially dimmer than the signals observed when 92 encoding probes were used per gene. Nonetheless, we found that the average copy number per cell for individual RNAs correlated well with that measured using 92 encoding probes per gene (Fig. 5c), with a Pearson correlation coefficient of 0.8. However, we detected fewer RNA molecules per cell in these measurements: the ratio of the total RNA copy number per cell measured with 16 encoding probes www.nature.com/scientificreports www.nature.com/scientificreports/ relative to 92 encoding probes was 0.32. Across three independent replicates, this ratio was 0.33 ± 0.02 (SEM) (Fig. 5g), confirming that the dimmer signals from individual RNA molecules led to fewer RNAs being detected.
To then determine the improvement provided with bDNA amplification, we repeat the MERFISH measurements with 16 encoding probes per gene in combination with the 5 × 5 bDNA amplification scheme (Fig. 5d,e). As expected, amplification increased the brightness of these signals relative to the unamplified measurements. This increased brightness produced an increase in the correlation between the average copy number per cell determined with amplification to that determined with 92 encoding probes per gene but no amplification (Fig. 5f). In addition, the total RNA copy number measured with 16 encoding probes increased substantially after amplification -the ratio of the total RNA copy number measured with the amplified 16-encoding-probe measurement relative to the unamplified 92-encoding-probe measurement was measured to be 0.61 ± 0.03 (SEM, 3 replicates) (Fig. 5g), indicating that amplification improved the detection efficiency of the 16-encoding-probe measurements by about 2-fold.
Because a minimum RNA length is required to accommodate a given number of encoding probes per gene, the ability to use fewer encoding probes per gene will allow MERFISH to target shorter genes, and bDNA amplification is likely to be highly beneficial for these measurements. Moreover, we anticipate that with improved encoding probe design, hybridization conditions, and other advances, it should be possible to increase the efficiency of encoding probe binding and further increase the detection efficiency of MERFISH for shorter genes.

Discussion
We have presented here a combination of MERFISH and bDNA amplification. We showed that the bDNA amplifiers composed of three of the four nucleotides bind to targets rapidly, reaching saturated binding within 15 minutes. We demonstrated that this approach amplified RNA smFISH signals by 5.5-fold, 10.5-fold, and 30.6-fold using 4 × 4 amplification, 5 × 5 amplification and 9 × 9 amplification, respectively, without increasing the size of fluorescent spots or increasing the variation in brightness from molecule to molecule, properties that are important for MERFISH performance. We also demonstrated that with bDNA amplification MERFISH maintained the ability to accurately identify and count RNAs with a near 100% detection efficiency with 92 encoding probes per gene. Finally, we showed that bDNA amplification substantially improved the detection efficiency of MERFISH (from ~30% to ~60%) when only 16 encoding probes were used per gene.
Notably, we observed a maximum amplification around 40% of the theoretical maximum for all amplifier designs (4 × 4, 5 × 5, and 9 × 9) tested. Thus, the binding efficiencies of the amplifiers were not 100%. If we assume that the binding efficiencies were equal for each round of amplifier staining, the average binding efficiency per round would have been ~65%. In addition, we found that, of the screened amplifier sequences, 20% of the amplifiers had either a high RNA-dependent background or a low amplification efficiency. In particular, the RNA-dependent background was unexpected because the sequences were blasted to avoid homology with the human transcriptome. We suspect that these specific amplifiers, containing a relatively large number of guanine nucleotides in the 20-mer repeating sequences, might form hybrid G-quadruplex structures, which have been reported to bind to mitochondrial RNA 33 . The specific spatial distribution observed with the staining of these amplifiers (Fig. 3a,b) was consistent with the distribution of mitochondria, supporting this hypothesis. In parallel, the low amplification efficiency of a few amplifiers could have arisen for a few reasons. One reason could be that the melting temperatures of amplifier sequences were unexpectedly low, inhibiting the assembly of these amplifiers or promoting their disassembly in the hybridization and wash conditions used. Alternatively, it is possible that these amplifiers also formed stable G-quadruplex structures, which inhibited the binding of those secondary amplifiers to primary amplifiers. Despite these few failures, the vast majority of the designed amplifiers worked as anticipated, indicating that this bDNA approach could be readily extended to the amplification of more readout sequences and hence to MERFISH measurement with longer barcodes, detecting more RNAs. We also anticipate that it is possible to design amplifiers to allow a third or fourth round of amplification and, thus, produce signal intensities ~100-1000-fold larger. When the signal amplification requirement is not high, it should also be possible to perform experiments with just a single round of amplification. While our manuscript was in preparation, a preprint was posted on bioRxiv reporting a method for the enzymatic production of long bDNA amplifiers and simultaneous imaging of ~10 RNA species using these amplifiers 34 . Unlike the solid-phase synthesized bDNA amplifiers used here, which have a well-defined length and can be purchased ready-to-use, this enzymatic production method generates amplifier molecules with a distribution (albeit likely narrow) of lengths and requires some hands-on work to produce amplifiers, but can produce longer amplifier molecules at a potentially lower cost.
The substantial increase in signal brightness generated by bDNA amplification should facilitate several areas of applications of MERFISH. First, with amplification, we have performed MERFISH measurements using 16 encoding probes per RNA, which gave substantially higher detection efficiency than the unamplified case. Thus, this amplification approach should allow shorter RNAs to be probed. Since our encoding probes target 30-nt-long regions of each RNA, RNAs as short as 480 nt could be targeted with the 16 encoding probe design. Furthermore, because only a fraction of the designed encoding probes actually bind to each RNA, encoding probes can be designed such that they target overlapping regions of the same RNA in order to increase the number of probes that could be designed for a fixed length of RNA, thereby increasing the signal 14,35 . Indeed, we have successfully used MERFISH encoding probes that overlap by as much as 20-nt to reduce the RNA length requirement by 3 fold, as compared to the non-overlapping probe design, with no obvious reduction in signal brightness 14,35 . Thus, with this overlapping probe design, we anticipate that RNAs as short as ~160 nt could potentially be detected. With additional improvements in encoding probe design and hybridization conditions, it may be possible to use even few probes and detect even shorter genes. Moreover, the ability to detect RNA molecules with relatively few probes would also improve RNA isoforms discrimination. The need to use fewer encoding probes per gene will also reduce the cost of encoding probes. Because encoding probes differ for different gene sets, but the same (2019) 9:7721 | https://doi.org/10.1038/s41598-019-43943-8 www.nature.com/scientificreports www.nature.com/scientificreports/ set of amplifiers can be used for different gene sets, and because the per-sample costs for amplifiers are low (see Materials and Methods), this amplification scheme could thus potentially reduce the cost of MERFISH measurements when multiple different gene sets are probed. Second, with signal amplification, it should be possible to substantially reduce the imaging duration by using shorter exposure times. As the imaging time is typically a sizeable portion of the total time required to perform a MERFISH measurement, it should be possible to substantially improve MERFISH imaging throughput with amplification. Likewise, signal amplification will also allow lower power illumination sources to be used, which will reduce the cost of the MERFISH instrument setup and allow a wider set of commercial microscopies to be used for MERFISH measurements. Third, bDNA amplification could increase MERFISH performance for high background samples, for example, samples in which background fluorescence is difficult to remove even with tissue clearing approaches (such as samples containing lipofuscin) 17 . Thus, bDNA amplification should greatly facilitate imaging of tissues with high autofluorescence background. Thus, we anticipate that the improved MERFISH performance and versatility provided by this amplification method should facilitate the application of spatially resolved single-cell transcriptomics to a wide array of biological questions.

Materials and Methods
Design of the encoding probes. MERFISH measurements in human osteosarcoma cells (U-2 OS) (ATCC) were performed with a previously described MERFISH-encoding probe set 16 . Briefly, a 16-bit MHD4 code was used to encode the RNAs. In this specific encoding scheme, each of the 140 possible barcodes has a constant Hamming weight (i.e., the number of "1" bits in each barcode) of 4 to avoid potential bias in the measurement of different barcodes due to a differential rate of "1" to "0" and "0" to "1" errors. In addition, all barcodes have a Hamming distance of at least 4 to enable error detection and error correction. We used 130 of the 140 possible barcodes to encode cellular RNAs and the remaining 10 barcodes were not assigned to an RNA and served as blank controls. In the first encoding probe library, each RNA species had 92 encoding probes, with each encoding probe containing three of the four readout sequences assigned to each RNA. Our second encoding probe library was designed identically to the first with the distinction that each RNA species had 16 encoding probes. The encoding probe set targeting FLNA (Biosearch) was described previously 16 .
Encoding probe construction, coverslip silanization, cell culture and fixation, encoding probe staining, and gel embedding and clearing were performed as previously described 15 . Amplifier staining. Amplifiers were purchased as PAGE-purified oligonucleotides from Integrated DNA Technologies (IDT). With this degree of purification, each 5 × 5 amplifier oligonucleotide cost ~$85 while the 9 × 9 amplifiers each cost $200. However, this synthesis method produced sufficient amplifier oligo for staining ~40,000 samples; thus, the per-sample cost for the 16 amplifier pairs required to amplify 16 different readout sequences was low (~$0.07/sample for the 5 × 5 amplification scheme and would have been $0.16/sample for the 9 × 9 amplification scheme). In addition, we note that by placing the target-binding region of each amplifier at the 3′ end of the oligo, our amplifiers were designed such that truncated oligos cannot bind to the encoding probes. Thus, it may be possible to utilize our approach without the expensive PAGE purification step and further lower the cost amplifiers. Alternatively, it may also be possible to lower the cost of the amplifiers by using the same oligopool-based synthesis and amplification method we utilize for generating MERFISH encoding probes 15 . The recently developed Primer Exchange Reaction approach, which allows long oligos with repeating sequence to be made enzymatically 36 , could also potentially reduce the cost for generating branched DNA amplifiers and could make longer amplifiers than possible by solid-phase synthesis, although this approach produces amplifiers with a distribution of the number of repeating sequences (i.e. binding sites).
To label the gel embedded and cleared samples with primary and secondary amplifiers, samples were first incubated for 5 min in a 10% formamide wash buffer, containing 2 × SSC (ThermoFisher) and 10% (vol/vol) formamide (ThermoFisher) in nuclease-free water. Next, 50 μL of 5 nM each of the primary amplifiers (IDT) in amplifier hybridization buffer, containing 2 × SSC, 10% (vol/vol) formamide, 0.1% (wt/vol) yeast tRNA (Life Technologies), 1% (vol/vol) murine RNase inhibitor (New England Biolabs), and 10% (wt/vol) dextran sulfate (Sigma), was added to a Parafilm-coated surface to form droplets. Samples were inverted onto these 50 μL droplets after removing extra 10% formamide wash buffer with Kimwipes and incubated in a humidity-controlled 37 °C incubator for 30 minutes (for all MERFISH measurements) or for 15 minutes, 30 minutes, 60 minutes and 180 minutes for the binding rate measurements. Then the samples were washed three times in 10% formamide wash buffer at room temperature in Petri dishes for 5 minutes each. To bind the secondary amplifiers, 50 μL of 5 nM each of the secondary amplifiers (IDT) in the same amplifier hybridization buffer described above was placed on a fresh parafilm-coated surface, the samples were inverted onto these droplets, and the hybridization was performed as described for the primary amplifiers. Then the samples were washed twice in 10% formamide wash buffer at room temperature for 5 minutes each followed by a third wash in 10% formamide wash buffer in 37 °C incubator for 15 minutes.
The samples were either imaged immediately or stored in 2 × SSC supplemented with 0.1% (vol/vol) murine RNase inhibitor at 4 °C for no longer than 48 h. Readout probes were hybridized to these samples as described previously 15 .
MeRFIsH imaging platforms. The samples were imaged on a home-built high-throughput imaging platform at the Center for Advanced Imaging, Harvard University. Briefly, this microscope was constructed around a Nikon Ti Eclipse microscope body and a Nikon, CFI Plan Apo Lambda 60x oil objective. Illuminations in 750, 647, 560, 488 and 405 nm were provided using solid-state lasers (MBP Communications, 2RU-VFL-P-500-750-B1R; MBP Communications, 2RU-VFL-P-2000-647-B1R; MBP Communications, 2RU-VFL-P-2000-560-B1R; MBP Communications, 2RU-VFL-P-500-488-B1R; Coherent, Cube 405). These laser lines were www.nature.com/scientificreports www.nature.com/scientificreports/ used to excite readout probes labeled with Alexa750 and Cy5, orange fiducial beads, a Poly dT readout probe (Alexa 488) and DAPI, respectively. The illumination profile was flattened with a πShaper (Pishaper). The fluorescence emission from the sample was separated from the laser illumination using a penta-band dichroic (Chroma, zy405/488/561/647/752RP-UF1) and imaged with a scientific CMOS camera (sCMOS; Hamamatsu, C11440-22CU) after passing through two duplicate custom penta-notch filters (Chroma, ZET405/488/561/647-656/752 m) to remove stray excitation light. The pixel size for the sCMOS camera corresponded to 109 nm in the sample plane. The exposure time was 500 ms for each imaging frame. Sample X/Y position was controlled via a motorized microscope stage (Ludl). Sample focus was maintained by feedback on the reflection of an IR laser (Thorlabs, LP980-SF15) off the sample coverslip interface. The reflected IR signal was detected by a CMOS camera (Thorlabs, DCC1545M) and the sample to objective distance was controlled by an objective nanopositioner (Mad City Labs, Nano-F100S).
Image processing and decoding. For FLNA smFISH data, the brightness and PSF sizes of unamplified and amplified FISH spots were calculated via a Gaussian fitting routine previously described 37 .
For the MERFISH data, registration of images of the same FOV across different imaging rounds as well as decoding of the RNA barcodes was conducted using a previous analysis pipeline 16 . Briefly, the drift between images in each imaging round was corrected using the localizations of the fiducial beads in each round of imaging. Next, background in the images were removed via a high-pass filter, and RNA spots were tightened by deconvolution. We have previously found that the signal from the same RNA can vary slightly in position (<100 nm) from round to round. To address this small variation, we then low-pass filtered each image to ensure the signal from the same RNA overlapped in different imaging rounds. To remove the natural variation in brightness between color channels and different imaging rounds, we normalized the intensity measured for each color channel in each imaging round via the 95% quantile of the corresponding brightness histogram, effectively equalizing the brightness histograms observed for different bits. We then compared the normalized intensity for a given pixel in each of the 16 images to the expected intensity produced by each barcode for each of the 16 bits, and we selected the barcode that best matched the observed intensity pattern for that pixel. However, if the Euclidean distance between this pixel intensity pattern and the expected intensity pattern from the closest barcode was larger than a maximum threshold value, the pixel was not assigned to a barcode. This threshold distance was set by the maximum Euclidean distance between a correct barcode and each of the incorrect barcodes generated by flipping a single bit in that correct barcode. Finally, adjacent pixels assigned to the same barcode were then combined to form a putative RNA.
This pipeline was run on a desktop server that contained two 10-core Intel Xeon E5-2680 2.8-GHz CPUs and 256 GB of RAM.

Data Availability
The datasets that support the findings of this paper are available from the corresponding authors upon request.

Code Availability
The software used to analyze the datasets are available from the corresponding authors upon request.