TITLE: No Title
AUTHORS: 

[DESCRIPTION]
<p>The basic decoding of MERFISH data—the identification of specific RNA species for each spot in the sample—consists of three basic steps. First, fluorescent spots must be identified in all images. Second, slight changes in the stage position between images of the same region from different hybridization rounds must be corrected. Finally, sets of fluorescent spots that occupy the same location in the sample must be decoded into binary barcodes, which, in turn, are decoded into the specific RNA species. After these RNAs have been decoded, there are a series of simple calculations that can often be performed on the measured barcodes to determine important parameters associated with the performance of the measurements, such as estimates of the binary errors made at each bit or the relative confidence that can be ascribed to the counts for each RNA species. In this section, we provide protocols for performing these basic computational tasks. Example software and data can be found at:</p>
<p> <a href="http://zhuang.harvard.edu/merfish/ " target="_blank">http://zhuang.harvard.edu/merfish/</a>.</p>

[GUIDELINES]
<p style="text-align: justify;"><strong>Identification of Fluorescent Spots</strong></p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">There are a variety of software packages and approaches to identifying the location and brightness of fluorescent spots in images. In principle, any of these approaches should work reasonably well for this initial stage of the analysis of MERFISH data. However, some of the more advanced algorithms for the identification of fluorescent spots have been developed in the context of localization-based super-resolution microscopy. In these measurements, there is a desire to be able to properly localize molecules that are close enough together that their fluorescent spots partially overlap. Depending on the local density of RNAs within the cell, the signal from different RNAs does occasionally overlap, necessitating the use of these more advanced spot finders. The algorithm we use—3D-daoSTORM—was developed in our laboratory (Babcock et al., 2012) and is an extension of the daoPHOT algorithm original developed for the analysis of astronomy data (Holden et al., 2011). 3D-daoSTORM is open source and can be found with documentation here:</p>
<p style="text-align: justify;"><a href="https://github.com/ZhuangLab/stormanalysis" target="_blank">https://github.com/ZhuangLab/stormanalysis</a>.</p>
<p style="text-align: justify;">In this Section, we describe the basic steps for the use of this software for finding fluorescent spots in MERFISH data.</p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"><strong>Correction of Image Offsets</strong></p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Every time the microscopy stage returns to a given location there will be a slight offset, often no more than a single pixel or two. Nonetheless, this small offset can significantly degrade the ability to align fluorescent spots within images of the same sample stained with different readout probes. For this reason, in each round of hybridization, we collect an image of small fluorescent beads stuck to the surface of the sample. Because the location of these beads are fixed with respect to the sample, apparent differences between the position of these beads between different rounds of hybridization can be used to correct these small stage offsets. We perform this correction by using the positions of these beads to create affine transformations that map the position of each spot in each round of hybridization back to the coordinate system defined by the image collected in the first round of hybridization.</p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"><strong>Decoding Barcodes</strong></p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Once all spots have been transformed to the same coordinate system, spots in different rounds of hybridization that occupy the same or similar physical locations within the sample should be associated to create the specific binary barcode associated with the putative RNA at that location in the cell. We have explored several different approaches to performing this association. Here we present the algorithm that has performed best in our hands. One advantage of this algorithm is that it requires only one parameter: the maximum distance between spots in different rounds of hybridization. Figure 3A–C illustrates the decoding of an example MERFISH data set.</p>
<p style="text-align: justify;"> </p>
<p style="text-align: center;"><img id="s-mce-img" class="s-mce-img" src="https://s3.amazonaws.com/pr-journal/rxbfw26.png" width="581" height="326" data-src="https://s3.amazonaws.com/pr-journal/rxafw26.png" data-ofn="Screen Shot 2017-12-29 at 5.49.59 PM.png" /></p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"><strong>Calculate MERFISH Performance</strong></p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">The basic performance of a MERFISH measurement can be quickly assessed from several quantities that can be calculated from the barcodes decoded in the Decoding Barcodes Section. Here we describe the calculation of these quantities and their interpretation.</p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"><strong>The Per-Bit Error Rate</strong>—If the encoding scheme has the capacity to correct errors, then it will also have the ability to determine the bit at which the corrected errors occurred. Using this ability, it is possible to compute the average `1'➔`0' or `0'➔`1' error rates associated with each round of hybridization. These quantities can be very useful in diagnosing the performance of a MERFISH run. For example, a high `1'➔`0' error rate for one round of hybridization may indicate poor staining in that round or perhaps an inappropriately high threshold for spot fitting. Alternatively, a high `0'➔`1' error rate may suggest that the spot fitting threshold is too low for that round of hybridization. To calculate this quantity, compute the number of times each RNA species was measured correctly N<sub>C </sub>and the number of times it was measured with a word that contains a single-bit error at each possible position N<span style="font-size: 10.8333px;">i</span>. Figure 5A illustrates these counts for two example barcodes. These two quantities can then be used to estimate the probability of flipping the ith bit via N<sub>i</sub>/(N<sub>i</sub> + N<sub>C</sub>). (See the Materials and Methods of Chen et al. for a derivation of this expression.) Once the probability of flipping each bit is calculated for each RNA, an estimate of the bit flipping probability for each round is calculated from the average across all genes. See Figure 5B for an example of these per-bit error rates.</p>
<p style="text-align: justify;"> </p>
<p style="text-align: center;"><img id="s-mce-img" class="s-mce-img" src="https://s3.amazonaws.com/pr-journal/rw9fw26.png" width="511" height="335" data-src="https://s3.amazonaws.com/pr-journal/rw8fw26.png" data-ofn="Screen Shot 2017-12-29 at 5.41.19 PM.png" /></p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"><strong>Background Counts and the Confidence Ratio</strong>—We recommend leaving a few percent of the possible barcodes unassigned. Measurements of these `blank' or `control' barcodes can then serve as a simple measure of the background count rate in MERFISH and can be used to assign a qualitative degree of confidence to the observed counts for different RNAs.</p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Perhaps the most obvious use of these `blank' barcodes is to set a lower limit on the number of counts that can be trusted. For example, if an RNA-encoding barcode is counted fewer times than a `blank' barcode, then it might be reasonable to assume that the counts for this RNA are dominated by background counts and should not be trusted. However, this use of the `blank' barcodes provides an overly cautious measure of the rate of background counts because it does not properly take into consideration the way in which different binary barcodes are related to one another. For example, imagine that one `blank' word is counted more frequently than a barcode representing a low abundance RNA. If these two barcodes are separated by a large HD, i.e. these barcodes have very few `1' bits in common, then it is possible that the errors that produced observations of this `blank' barcode may not be relevant for the measurement of the barcode associated with the low abundance RNA.</p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">To partially capture the relationship between different barcodes and improve estimates of the accuracy of different barcode measurements, we have developed a metric that we term the confidence ratio. This ratio is defined as the number of measured binary barcodes that exactly match the binary barcode for a given RNA over the sum of this number and the number of counts for all binary words that differ from this barcode in only one bit, i.e. the ratio of the blue bars to the sum of the blue bar and all red bars in Figure 5A. For an errorcorrecting encoding scheme, this quantity is simply the ratio of the number of times an RNA was observed without the application of error correction to the number that was observed with error correction applied. However, error-correction is not required to compute the confidence ratio. All that is required is that all barcodes are separated by at least a HD of 2.</p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">To illustrate the usefulness of this ratio, consider the following scenario. Imagine that one specific hybridization round is particularly problematic, and the `1'➔ `0' error rate for that round is higher than others. (As Figure 5B illustrates, there can be variation between errors rates in different rounds of hybridization). Then RNAs encoded with binary barcodes that contain a `1' in that bit will tend to have more single-bit errors. This will decrease the confidence ratio for these words by generating a larger proportion of counts for these singlebit errors. However, RNAs encoded with binary words that do not contain a `1' in that bit will not see an increase in the number of single-bit errors in this round, and the confidence ratio for these RNAs will not be lowered.</p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Finally, a word of caution: the confidence ratio does not imply a quantitative level of confidence in the counts for a RNA. For example, a ratio of 0.3 does not imply that 30% of the measured counts are correct. The proper interpretation of this ratio is more qualitative: one should trust the counts for a RNA with a confidence ratio of 0.5 more than those for a value of 0.3. To provide a heuristic cut-off on the confidence ratio, we use the measured confidence ratios for the `blank' barcodes. If an RNA-encoding barcode has a confidence ratio larger than the largest confidence ratio observed for the `blank' barcodes then we generally trust the counts associated with this RNA. See Figure 5C. Of course, this cut-off is still somewhat arbitrary, and we only recommend using it as a rule of thumb. The confidence ratio is one of the simplest quantities one could compute in an effort to exploit the natural geometric connectivity of the different measured binary barcodes. In the future, we expect that more complicated calculations could be performed to exploit this connectivity and further improve both the accuracy of the measured counts with MERFISH and our metrics of the performance of a given measurement.</p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"><strong>(Optional) Iterative Identification of Optimal Thresholds</strong></p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">As discussed in the Section of Identification of Fluorescent Spots, we observe that different rounds of hybridization produce somewhat different levels of background and spot brightness. Thus, it is typically advisable to tune the spot-finding threshold for each round of hybridization. To further improve this process, it is possible to automate this threshold search by using some of the performance metrics discussed in the Section of Calculate MERFISH Performance to determine the optimal threshold for each hybridization round.</p>

[STEPS]
?. 
?. 
?. 
?. 
?. 
?. 
?. 
?. 
?. 
?. 
?. 
?. 
?. 
?. 
?.