Abstract
Data artifacts may induce errors in findings from any spatial transcriptomics platform. To provide protection from these errors, we have developed Border, Location, and edge Artifact DEtection (BLADE). BLADE is a novel collection of automated cross-platform statistical methods for detecting and removing three types of artifacts: (i) border effects, where total gene reads is modified at the border of the capture area; (ii) tissue edge effects, where total gene reads is modified at the edge of the tissue; (iii) location batch malfunctions, where there is a zone in the same location on all slides in a batch with substantially decreased sequencing depth. These artifacts are not mutually exclusive. BLADE has been applied to both Visium and CosMx data, and was used to evaluate our library of 37 10x Visium samples of liver and adipose tissue from humans and mice. Artifacts were found to be both common and impactful in those samples, indicating that artifact detection methods are critical for spatial transcriptomics quality control. Our BLADE software is publicly available.
Keywords: spatial transcriptomics, Visium, cellular senescence, modeling, quality control
Introduction
Many research labs are investing enormous resources into recently developed spatial transcriptomics technologies [1–7]. This is especially true in research areas such as cellular senescence where cell–cell interactions across space are believed to play an important biological role [8–11]. In these settings, the ability to have gene read counts for thousands of genes at or near sub-cellular resolution has obvious appeal. Data artifacts could, however, impede the use of this data to produce valid scientific findings. In this paper, we evaluate and provide tools for improving analysis of data from multiple spatial transcriptomics platforms, including Visium and CosMx.
The bioinformatics best practices for analyzing this young technology remain relatively undeveloped [12–14]. While there are numerous packages for analyzing spatial transcriptomics data, there is currently no field-accepted formal bioinformatics standard for confirming the quality of a spatial transcriptomics image. Common practices are to identify suspicious areas through visual inspection, or flagging any area that has an unusually large or small number of reads (i.e. “sequencing depth”). Suspicious areas are typically removed, and treated as locations where no data were collected. Neither practice is satisfying: visual inspection may have low reproducibility across raters, and unusually high or low reads in certain areas may reflect genuine biological processes.
This paper contributes to the field by extending the understanding of errors that can occur during the spatial transcriptomics imaging process and by providing the Border, Location, and edge Artifact DEtection (BLADE) software for minimizing the influence of these errors. The artifacts we have identified are (i) “border effects”, where total gene reads are modified in spots at the border of the capture area; (ii) “tissue edge effects”, where total gene reads are modified in spots at the edge of the tissue sample but inside of the capture area; (iii) “batch-level location malfunctions”, where there is a zone in the same location on all slides in a batch with substantially decreased sequencing depth. These artifacts do not reflect underlying biology, but are due to events during material collection and study workflow. Data analysis and interpretation that do not account for these artifacts may be biased.
In the present work, we provide novel mathematical definitions for the above artifacts, develop the novel BLADE methods for detecting them, develop novel methods for creating semi-synthetic data with no artifacts, and develop novel methods for injecting fake artifacts into data. BLADE also includes simple methods for removing artifacts, but researchers may opt to use other methods instead. Our empirical investigations also reveal that many standard analyses are significantly affected if artifacts are not removed. In our own library of 37 Visium images of mouse and human liver and adipose tissue, BLADE detected artifacts in most samples. BLADE also detected artifacts when applied to two CosMx fields of view. It is critical for the field to identify, characterize, and minimize the impact of these artifacts.
Materials & methods
All of our code is open source and publicly available at https://github.com/KummerfeldLab. BLADE is currently implemented for Visium data, but can be adapted to other technologies. See Supplemental 9 for examples of applying BLADE to CosMx data. Supplemental 8 provides a concise method label for BLADE.
Data collection
Three different workflows, widely accepted in the literature, were used to generate Visium datasets: Direct Mount FFPE, Direct Mount Fresh Frozen, and CytAssist FFPE (Table 1).
Table 1.
This table shows the number of different data sets and corresponding tissue samples that were analyzed, organized according to workflow, tissue source, and tissue type. In total, the 37 Visium data sets came from three different Visium workflows, two tissue sources (human and mouse), and two tissue types (liver and adipose).
| Workflow type | Mouse tissue | Human tissue | |
|---|---|---|---|
| Liver | Adipose | Liver | |
| Visium direct mount FFPE | 8a | 8b | |
| Visium direct mount fresh frozen | 4c | ||
| Visium CytAssist FFPE | 7d | 10d | |
a19 465 Mus musculus genes targeted by probe set (6.5 × 6.5 mm capture area, 5000 barcoded spots / area).
b17 943 Homo sapiens genes targeted by probe set (6.5 × 6.5 mm capture area, 5000 barcoded spots/area).
cPoly(dT) capture of RNA to construct cDNA libraries (6.5 × 6.5 mm capture area, 5000 barcoded spots/area).
d18 085 Homo sapiens genes targeted by probe set (two adipose libraries generated from 11 × 11 mm capture area with 14 000 barcoded spots/area; rest from 6.5 × 6.5 mm area with 5000 barcoded spots/area). FFPE, formalin-fixed paraffin-embedded.
Biospecimen procurement
Human tissues were obtained using the University of Minnesota Clinical and Translational Science Institute Biorepository and Laboratory Services. Tissues were obtained according to IRB approved protocols (IRB# 00013764, 00009134) with informed consent. Formalin-fixed paraffin-embedded (FFPE) and frozen tissues were prepared according to standard histological procedures at the Biorepository and Laboratory Services core. All animal tissues were collected in compliance with regulations and approved protocols at the University of Minnesota. The mice used in this study were generated by breeding C57BL/6 J and FVB/n backgrounds resulting in an F1 hybrid background yet genetically identical. The mice were housed in the specific pathogen-free barrier facility at University of Minnesota until they reached the desired age for tissue collection. Mice were sacrificed using CO2 euthanization method, and the liver tissue was excised and immediately fixed with 10% formalin for 24 h, briefly washed twice with ddH2O then stored in 70% Ethanol at 4°C and processed to paraffin embedding.
Tissue sectioning
For Direct Mount workflows, tissues were sectioned and mounted directly onto the Visium slide (10x Genomics Part Number 2000233), while tissues for the CytAssist Visium workflow were mounted on standard frosted glass slides. Fresh frozen human adipose tissues were sectioned by cryostat at 16 μm thickness, while FFPE human adipose tissues were sectioned by microtome at 10 μm. All other FFPE tissues were sectioned at 5 μm.
Tissue staining & preparation
Staining and processing of tissues was carried out per manufacturer’s instructions within 1–5 days of sectioning. Current revisions for all 10x Genomics Protocol Documents, which contain detailed information on the manner in which the datasets were generated, are available within the 10x Genomics User Guide library (10xgenomics.com/support/user-guides). Fresh frozen tissues were prepared following 10x Genomics Protocol CG000160 to fix tissues with 100% methanol and stain with hematoxylin and eosin (H&E). Tissue preparation for FFPE samples mounted directly onto the Visium slide followed 10x Genomics Protocol CG000409, while processing of FFPE tissues via the CytAssist workflow followed 10x Genomics Protocol Document CG000520. Briefly, each FFPE workflow consists of baking slides (typically 2 h at 60°C); deparaffinization of tissues in xylenes; rehydration with a gradient series of ethanol washes; H&E staining and destaining; and decrosslinking of tissues to expose RNA targets.
Imaging. Stained slides were mounted with 85% glycerol and coverslipped (FFPE) or imaged dry (fresh frozen) on a Huron Digital Pathology TissueScope LE. Slides run with the CytAssist workflow were imaged once more at low resolution concurrent with analyte transfer to the CytAssist capture slide (10x Genomics Part Number 2000550) on the CytAssist instrument. More information on library construction and sequencing is available in Supplemental 1 of the Supplementary files.
Space Ranger Pipeline Processing. FASTQ sequence files were aligned to either a probe sequence list (for probe-based libraries) or to human reference genome assembly GRCh38 (for cDNA-based libraries) using the 10x Genomics Space Ranger pipeline (v1.3.1 to v2.0.0) with workflow-specific parameters. From the sequence files and the tissue images—which contain fiducials for spatial alignment—the Space Ranger pipeline compiled transcript counts on a per-spot basis into a feature-barcode matrix used for subsequent analysis and artifact detection.
Edge effect artifact detection method
BLADE detects tissue edge effect artifacts in two steps: (i) identify “edge spots” that are on or near the edge of the tissue sample; (ii) perform a two-sample test to compare the distribution of gene read counts in the edge spots to the interior spots. Figure 1 provides a visual example of edge spots (blue and purple) and interior spots (yellow).
Figure 1.
Tissue sample color-coded to indicate which spots are on the interior (yellow), tissue edge (blue), capture area border (red), or on both the edge and border (purple), or have no or insufficient tissue (gray).
Edge spots and interior spots are identified by first labeling all spots with the shortest taxicab distance from that spot to the nearest spot without tissue. On Visium slides, the taxicab distance serves as an efficient and close approximation of the Euclidian distance from the nearest spot with no tissue. The user stipulates a distance threshold for identifying edge and interior spots. Based on observations of the gene read counts at different edge distances, we define edge spots as having distance 1 and interior spots as having distance 2 or more from the tissue edge.
After identifying edge and interior spots, BLADE performs a two-sample unpaired t-test to compare their gene read counts. The P-value output by this test is the value returned by the detection method.
Throughout this paper we considered P-values below 0.05 to be significant. All P-values reported in this paper were corrected for multiple comparisons using the Bonferroni method [15].
Border effect artifact detection method
BLADE detects the presence of capture area border effects similarly to how it detects tissue edge effects: it first identifies spots near the border, and then compares the distribution of gene reads in those spots to the distribution of gene reads in the nonborder spots. Figure 1 provides a visual example of border spots (red and purple) and interior spots (yellow). Border distances are measured from the image border rather than from spots without tissue. Based on observations from our library of tissue images, we define border spots as having border distance 1, and interior spots as having distance 2 or more from the border. A two-sample unpaired t-test is used to compare the two populations of spots. The detection method outputs the P-value from that test.
Location malfunction artifact detection method
BLADE detects location malfunctions in three steps: (i) detect outlier spots in each slide, (ii) identify batch outlier spots, i.e. outliers shared by all slides in the batch that have tissue detected in that area, (iii) test whether the largest cluster of adjacent batch outlier spots has more spots than is plausible by chance.
Since the malfunction areas consist of spots with either extremely high or low reads, an outlier detection method is used first. Gene counts across the tissue are skewed but did not match any distribution we tested, so we used the skewed outlier detection method of Hubert and Vandervieren [16].
We provide pseudocode for this detection method in Supplemental 2.
Simulation methods for slides with and without artifacts
Our process of evaluating the impact of these artifacts on commonly used and important statistics is to (i) produce a control set of realistic tissue images without artifacts by cleaning sample images from our collection; (ii) produce test images by copying images from the control set and modifying them to include specific artifacts under the evaluators’ control; (iii) apply a selection of common and important bioinformatic/statistical methods to each control image and its corresponding test images with added artifacts; (iv) compare the results between each control image to its corresponding test images.
Control images
We created eight high quality artifact-free control images. This was accomplished by selecting eight samples from our collection, which had overall high quality and relatively few edge artifacts, border artifacts, or location malfunctions. We then removed all spots, which had an edge distance or border distance of 1 or 2. The spot locations were then shifted horizontally and vertically until we had at least 10 spots on the border at each of two sides of the capture window.
Test images
From each control image we created four test images: one with edge artifacts, one with border artifacts, one with both edge and border artifacts, and one with location malfunctions. We include technical details on how these artifacts were added to the control images in Supplemental 3.
Bioinformatic and statistical analysis methods tested on simulated data
We evaluated the statistical importance of these artifacts on five widely-used bioinformatic statistics: Uniform Manifold Approximation and Projection (UMAP), gene–gene correlation, gene–gene conditional correlation, entropy of spots, and Moran’s I. These are important on their own and in some analysis settings they are components of more complex algorithms and pipelines. Our analysis focuses on testing whether and the degree by which the above statistics degrade after injecting synthetic artifacts into cleaned samples.
UMAP
UMAP is a widely used nonparametric and nonlinear dimensionality reduction technique [17]. Many existing research papers and projects analyzing single-cell data use UMAP for dimension reduction on a tissue sample, often for visualization purposes. Since a direct comparison of two dimension reduction results is challenging, we instead compare the clustering of tissue spots in UMAP space, as it is a good representation of the dimension reduction results. We compare UMAP clusterings using the Adjusted Rand Index (ARI). The similarity of two clusterings on the same data is considered “poor” if the ARI is below 0.65 [18, 19].
Gene–gene correlation and conditional correlation
Correlation and conditional correlation are fundamental statistics, which are important by themselves and are also used by many more complex statistical and bioinformatics procedures. For example, state of the art causal pathway discovery algorithms often use tests of conditional independence. Classic predictive modeling (e.g. logistic regression and random forests) also often use conditional correlation. Gene–gene correlations and conditional correlations were tested using paired t-tests. For each gene, we tested if its correlation and conditional correlation with other genes are significantly different between the samples with and without artifacts. Then the fraction of tests with P-values below 0.05 is computed and recorded. The larger the proportion, the more correlation or conditional correlations are affected. Because of this procedure, a fraction of approximately 0.05 would be expected if the artifact has no effect.
Entropy of genes on spots
Shannon entropy is a classical way of representing the amount of information in a random variable [20]. We calculated the total gene expression reads on each spot as a representation of information captured from a sample tissue. A paired t-test is used to test if the total entropy will change before and after adding artifacts.
Moran’s I
The Moran’s I statistic captures a notion of spatial autocorrelation or “spatial clustering” [21]. Moran’s I is widely used as a filtering method for finding spatial variational genes across a tissue sample. It is of particular relevance for spatial transcriptomics studies of cellular senescence, e.g. since secretions that affect senescence biological programs in neighboring cells is one of the core features of senescence. For each gene, we calculated Moran’s I value for both the cleaned and artifact-injected slide and used Bland–Altman statistics and a paired t-test to determine whether the Moran’s I value of the slide with the artifact injection was significantly different from that of the cleaned slide. We then calculated and recorded the fraction of genes that had a difference at P value of 0.05 or less.
Gene lists
Aside from the tests involving UMAP, we performed all tests on two gene lists: a senescence gene list (senlist) and a list of genes that have high reads on the analyzed slide (this is tissue-sample specific). The details of the senescence gene list are in Supplemental 4, and the sample-specific list of high read genes can be reproduced from our shared analysis code. We tested both sets of genes because senescence-related genes often have substantially lower counts across the tissue sample than most other genes, which can affect the testing performance. The high reads genes illustrate the effect of the artifacts when more information (more reads) is available. To better illustrate how different kinds of artifacts affect the results of commonly used spatial transcriptomic tools, our analysis utilized functions from R package “Seurat” for data reading, data preprocessing, and calculation of essential statistics.
Results
Artifact definitions
In this paper we focus on these three specific types of artifacts because in our collection of samples they were (i) common, being present in at least a substantial percentage of our samples; (ii) large, having an effect on more than just one or two spots when they occur; (iii) strong, resulting in a large change to the gene reads on the spots they affect.
Tissue edge effects
An image has tissue edge effects if the total count of gene reads in spots that are near empty space (spots without tissue present) within the image’s capture area are significantly different than would be expected based on the total count of gene reads from spots that are not near empty space.
In our experience these usually take the form of reduced gene read counts at the edges, but rarely they can be increased instead. Figure 2 shows heatmaps of slides that have tissue edge effects. More examples are available in Supplemental 5. The physical and biochemical processes of tissue acquisition, fixation, histologic processing, and slide preparation cause anomalous characteristics of the tissue edge in comparison to other areas of the sample, which impacts nucleic acid probe binding/capture efficiency.
Figure 2.
Two heatmaps of the sequencing depth of two of our tissue samples. Sequencing depth ranges from red (most) to blue (least). Border effects and edge effects are present in both tissue samples. Border effects can be seen where spots along the image border have elevated sequencing depth. Edge effects can be seen where spots along the tissue edges have reduced sequencing depth.
Capture area border effects
An image has capture area border effects if the total count of gene reads in spots that are near the border of the image’s capture area are significantly different than would be expected based on the total count of gene reads from spots that are not near the capture area.
In our experience this has always resulted in increased gene read counts at the affected spots. Figure 2 shows heatmaps of slides that have capture area border effects. More examples are available in Supplemental 5.
Location malfunctions
A batch of tissue images has a location malfunction if a connected set of spots of substantial size have anomalous gene read counts for all tissue images captured on the batch.
Batches can be all capture areas on a single physical slide, or can be all capture areas from slides from the same manufacture lot. In our limited experience these spots have always had substantially reduced numbers of reads relative to the rest of the image. Figure 3 shows examples of batches of slides that have location malfunctions. We are unsure what causes these artifacts to occur, and the specific reasons may vary from one batch to another.
Figure 3.
Three visualizations of tissue images with the same batch location malfunction artifact. Each image has a red arrow pointing towards a group of spots at the bottom center area of the image. Those spots are in the same location in all three images. These spots always stand out from the surrounding spots because of their extremely low number of gene reads.
Prevalence of the three artifacts across our 37 samples
Table 2 shows whether a border effect was detected, whether an edge effect was detected, whether a location malfunction was detected, what organ the tissue was taken from, what species the tissue was taken from, what workflow was used to produce the image from the tissue sample, and the mean reads from the border, edge, and interior, in 6 of 37 tissue samples. The full table for all 37 samples is available in Supplemental 6. P-values are shown in bold and italics if they are below 0.05. Overall, border effects were detected in 81% (25/31) of slides where there were enough spots along the border of the capture area to run the test (six slides had insufficient border area spots). Edge effects were detected in 76% (28/37) of slides. Location malfunctions were detected in 22% (8/37) of slides. In particular, they were detected in two different batches, each of which had four slides in the batch. All artifacts were detected in samples from both mice and humans, and in samples from both liver and adipose tissues.
Table 2.
This table shows a portion of the results from using BLADE to detect artifacts among our 37 Visium tissue samples. Only six of the 37 data sets are shown here, the full table with results from all 37 data sets is available in Supplemental 6. This table also displays the mean number of reads that occur in each of the three regions of tissue: border, edge, and interior. This makes it clear that when artifacts are present, the difference in number of reads is large. Overall, significant artifacts are common across the data sets, but which artifacts are present can vary.
| Sample | Border (P) | Edge (P) | Malfunction (P) | Organ | Animal | Workflow | Mean (95% CI) Border | Mean (95% CI) Edge | Mean (95% CI) Interior |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 0.461 | 0.010 | 0.000 | Liver | Human | Direct mount FFPE | 4379 (+/−577) | 3622 (+/−376) | 4599 (+/−176) |
| 11 | 0.000 | 0.534 | 0.860 | Adipose | Human | Direct mount FF | 17,407 (+/−1629) | 12,536 (+/−1405) | 11,648 (+/−834) |
| 15 | 0.001 | 0.000 | 0.092 | Liver | Human | CytAssist FFPE | 27,184 (+/−2387) | 16,534 (+/−1177) | 23,079 (+/−742) |
| 27 | 0.000 | 0.000 | 1.000 | Adipose | Human | CytAssist FFPE | 34,852 (+/−2575) | 23,776 (+/−1122) | 29,410 (+/−866) |
| 32 | NA | 0.002 | 0.860 | Liver | Mouse | Direct mount FFPE | NA | 19,635 (+/−1361) | 15,166 (+/−442) |
| 37 | 0.000 | 0.000 | 0.000 | Liver | Mouse | Direct mount FFPE | 15,442 (+/−1029) | 13,146 (+/−606) | 8953 (+/−285) |
Impact of the artifacts on bioinformatics and statistics
Table 3 shows six examples of simulation results evaluating the impact of artifacts on common and important statistics and bioinformatics methods. The table of results from all simulations is available in Supplemental 7. Each simulation is based on a real imaged tissue sample, which is cleaned and modified to serve as a control case, and then has either a border effect, edge effect, both border and edge effect, or malfunction artifact injected into it to form a second simulated tissue image. Statistical bioinformatics procedures were then performed on both the cleaned sample and the artifact-injected sample, and the results were compared against each other with statistical tests.
Table 3.
This table shows the results of our simulations for evaluating the effect of border, edge, and location malfunction artifacts on common and foundational statistics and related data analysis results. In this simulations, real Visium data sets were first cleaned to remove artifacts, and then had artifacts artificially injected into them. Various analyses were performed on both the cleaned data and the data after artifacts were injected, and then statistical tests were used to determine whether the analysis results were significantly different. This table shows only a small portion of the simulation results. The complete table is available in Supplemental 7. Overall, most statistics and analyses were significantly impacted by the artifacts. Conditional correlation tests were relatively more robust against the artifacts than other analyses or statistics.
| Cleaned slide source | Plus artifact (s) | Comparison stats | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Original tissue | b | e | m | UMAP ARI (all genes) | cor test (HCG) | cor test (senlist) | Cond. cor test (HCG) | Cond. cor test (senlist) | Moran’s I test (HCG) | Moran’s I test (senlist) | Entropy test |
| V12F28_066_A1 | ✓ | 0.559 | 93.4% | 91.1% | 10.8% | 0.0% | 0.008 | 0.614 | 0.000 | ||
| V42L29-055_D1 | ✓ | 0.353 | 100.0% | 100.0% | 0.8% | 0.0% | 0.000 | 0.000 | 0.000 | ||
| V12F28_066_B1 | ✓ | 0.303 | 98.4% | 85.2% | 0.0% | 14.1% | 0.002 | 0.006 | 0.000 | ||
| V42L29-055_A1 | ✓ | ✓ | 0.577 | 99.4% | 97.9% | 2.0% | 0.0% | 0.682 | 0.000 | 0.000 | |
| V12M15_110_A1 | ✓ | 0.466 | 95.8% | 98.5% | 1.2% | 4.4% | 0.099 | 0.381 | 0.000 | ||
| V42L29-055_D1 | ✓ | 0.579 | 98.6% | 98.6% | 0.2% | 3.6% | 0.073 | 0.180 | 0.000 | ||
The UMAP ARI shows how similar the UMAP clustering results are for the two images, and in general ARI < 0.65 is considered “poor” or not similar. See Fig. 4a and b for visualizations of dissimilar UMAPs. We find that the ARI is always below 0.65 when border or edge effects are present, and sometimes much lower. UMAP ARI is sometimes above 0.65 in the presence of a small machine location artifact, potentially because the simulated machine artifacts are small and the vast majority of spots are unaffected.
Figure 4.
This figure contains visualizations illustrating how artifacts influence data analysis. (a) and (b) show two visualizations of the spatial distribution of UMAP clusters on the same tissue sample. (a) Shows the results when artifacts were injected into the image. (b) Shows the results when artifacts were not injected into the image. While there are some similarities, there are also substantial differences, such as the number of clusters that were identified. (c), (d), and (e) show the same Visium tissue image: (c) without modification, with visible border artifacts; (d) with the border spots removed; (e) after removing the border spots and then rescaling the remaining read counts (using z-scores) based on their values in the remaining spots. Note that the variability in reads across space is much more visually apparent in (e). The extreme values that occurred due to border artifacts in (c) are compressing the information in the rest of the tissue image, thereby suppressing the substantial amount of potentially informative spatial variation in gene expression visible in (e).
Correlation tests were used to compare the gene–gene correlation values between the two slides, either over the set of all high count genes (HCG) or between genes associated with cellular senescence (senlist). We evaluated both raw correlations and conditional (partial) correlations. The reported value is the percentage of such gene–gene pairs whose correlations were significantly different between the sample with the artifact compared to the sample without the artifact (see Materials & Methods: Bioinformatic and statistical analysis methods tested on simulated data). If the artifact has little or no effect, then ~5% of the gene–gene correlations would still reject that null hypothesis by chance. For raw correlations, at least 50% reject the null hypothesis, and in the majority of cases over 90% reject the null hypothesis. For partial correlations, the null hypothesis is most often rejected <5% of the time, and in only one sample did the rejection rate exceed 25%.
The Moran’s I test was used to compare the level of spatial autocorrelation between the samples with and without artifacts. This test rejected the null hypothesis that the Moran’s I value for the clean and artifact samples were equal to each other for more than half of the test samples, both for HCG and for senlist. Moran’s I test appears somewhat less affected by our simulated machine location artifacts. This is likely because our simulated location artifacts were small, and so the spatial autocorrelation of only a small region of spots would be affected.
The entropy test was used to determine if the entropy (Shannon information) of the distribution of total reads across all spots on the slide was significantly different between the clean and artifact injected samples. The null hypothesis is that they are the same. All test samples strongly rejected the null hypothesis for all simulated artifacts.
To help illustrate a lower UMAP ARI, Fig. 4a and b shows two UMAP solutions, along with the corresponding locations for each clustered spot. Fig. 4a shows the UMAP and clustermap for a tissue sample with injected border artifacts and edge artifacts. Figure 4b shows the UMAP and clustermap for the same tissue sample without the injected border artifacts and edge artifacts. These two UMAPs do share some similarities, however the clean sample has one more cluster identified than the sample with artifacts. Differences occur throughout the clustermaps, but are primarily located in the upper half of the tissue.
Figure 4c–e illustrate another way that artifacts can influence results. A sample containing border artifacts is shown in Fig. 4c and d shows the same sample, unadjusted, after the border is removed. Then in Fig. 4e the reads in the sample have been rescaled using z-scores based only on the remaining spots. Notice how the spatial variation of total reads is quite apparent in Fig. 4e, while in Fig. 4c and d the spatial variation is less apparent due to being compressed by the more extreme spots in the artifact-influenced border region. Another example of this compression is shown in Supplemental 10.
Discussion
Summary
Data artifacts in spatial transcriptomics can lead to both false positives and false negatives, but many artifacts have not been previously defined or systematically detected or characterized. We have presented and made publicly available the BLADE methods for detecting artifacts in spatial omics data. BLADE found artifacts in most of our spatial omics data. Our simulation study indicated that these artifacts have substantial impacts on a wide variety of basic statistics. Investigators using spatial omics data should use BLADE or other methods to mitigate the impact of these artifacts. Using BLADE will reduce reliance on laborious and less reproducible manual quality control methods.
Removing artifacts
BLADE can remove detected artifacts. In most of our tissue samples, spots with artifacts are only a small percentage. A simple approach is to remove the data in those spots, treating the sample as if there is no tissue present at those locations. This may result in greater information loss than necessary, however, and users may want to consider more sophisticated methods, such as imputation or model-based adjustments, to clean-detected artifacts.
Edge spots, border spots, or location malfunction spots can optionally be automatically removed by BLADE. Information loss may occur when using this option since removal of all edge spots or all border spots may also include spots that actually have high quality data. For location malfunction spots, however, BLADE identifies the specific affected spots, and can ensure that only those spots are removed.
After removing regions with artifacts one can re-run BLADE to confirm that no artifacts remain. The removal step can be repeated as necessary.
Where do edge artifacts come from?
Edge artifacts can come in two forms: artificially increased sequencing depth and artificially decreased sequencing depth. It is plausible that these two forms are consequences of distinct mechanisms. Increased reads could be the result of tissue folding, which leads to the capture of material through multiple layers of tissue. Decreased counts could be the result of: (i) tissue lifting or loss of adherence to the tissue edges; or (ii) the effects of fixation during tissue processing. Fixative contacts the outside of a tissue sample first and then permeates inward. Differential fixation may cause differential obscuring of ribonucleic acid (RNA) targets, leading to reduced efficiency of probe binding on the outside edges of tissue.
Where do border artifacts come from?
We have multiple hypotheses about possible mechanisms for border artifacts. First, if the tissue is only partially covered by the silicone gasket, such that the portion of tissue on the slide beneath the gasket border is not exposed to reagents, it is possible that a misalignment of the reagent-exposed area and the capture area could lead to a border artifact. Alignment of tissues to capture areas in CytAssist experiments is done manually and largely with an unaided eye, which can be prone to alignment errors. Second, incomplete removal of buffer, reagent, or probe from the corners and sides of the gasket between steps could lead to increased reads at the borders. Third, a slight shifting of the gasket between steps could expose or obscure tissue on either side of the gasket border.
Where do location malfunctions come from?
Location artifacts, when present on a slide, appear to affect all of that slide’s capture areas, so we hypothesize that such artifacts originate in manufacturing. Spatial transcriptomics methods involving surface-immobilized, barcoded capture oligonucleotides often rely on stamping or other patterning methods to fabricate arrays in a repeatable, scalable manner [22–24]. In the case that a stamping or printing component becomes compromised, such as damage to the elastomeric stamp used to copy a deoxyribonucleic acid (DNA) array from one capture area to another, the printing error that arises may also be copied between capture areas. Although specific details of Visium slide production are largely proprietary, it is unlikely that another postproduction event could create identical location-specific artifacts across multiple capture areas.
Limitations
There may be other types of artifacts not identified in this paper or detected by BLADE. Also, BLADE’s edge and border effect detection methods only indicate whether an image has such effects, but do not locate which specific spots are problematic. We have anecdotally observed that many Visium images only have artifacts in specific areas along the borders or edges, while other borders and edges may be fine. BLADE’s current methods for removing detected artifacts are simplistic, and do not take these location nuances into account. Having detection methods localize the artifacts to specific spots would be a key step in creating an improved automated artifact removal method.
Future work
In future work we will analyze other types of spatial omics data, in order to determine the prevalence and severity of these artifacts across different platforms. We would also like to apply BLADE to more Visium samples produced using different protocols, in order to better identify protocols that reduce or eliminate artifacts. As part of those efforts, we will develop improved methods and best practices for removing artifacts from spatial omics data.
Key Points
We developed and made publicly available the Border, Location, and edge Artifact DEtection (BLADE) software package for detecting and removing spatial transcriptomics measurement artifacts.
BLADE is a cross-platform analysis method, and we demonstrated this by applying it to both Visium and CosMx data.
We evaluated and reported the prevalence of these artifacts across our library of 37 tissue slides, and found that they are very common.
We showed that these artifacts, if not removed, have a strong effect on common data analysis methods and statistics, such as UMAP, gene–gene correlations, spatial autocorrelation, and entropy.
Supplementary Material
Acknowledgements
We thank the following groups, people, and entities for supporting this work: the SenNet Working group on Good Practices: Analytical Methods and Modeling (GP-AMM); the Clinical and Translational Science Institute (BLS Histology); the University of Minnesota Genomics Center; the resources and staff at the University of Minnesota University Imaging Centers (UIC) SCR_020997.
Biographical note: This paper addresses fundamental QC issues with spatial omics assays in the context of work conducted in two tissue mapping centers funded by the NIH senate consortium on cellular senescence.
Contributor Information
Erich Kummerfeld, Institute for Health Informatics, University of Minnesota, 8-101 Phillips-Wangensteen Building, 516 Delaware St. SE, Minneapolis, MN 55455, United States.
Leland Williams, Institute for Health Informatics, University of Minnesota, 8-101 Phillips-Wangensteen Building, 516 Delaware St. SE, Minneapolis, MN 55455, United States.
Yinzhao Wang, Institute for Health Informatics, University of Minnesota, 8-101 Phillips-Wangensteen Building, 516 Delaware St. SE, Minneapolis, MN 55455, United States.
Samuel T Peters, Biochemistry, Molecular Biology and Biophysics, University of Minnesota, 140 Gortner Laboratory, 1479 Gortner Ave, St Paul, MN 55108, United States; Masonic Institute on the Biology of Aging and Metabolism, University of Minnesota, 312 Church Street SE, 1035 University Drive, Minneapolis, MN 55455, United States; University Imaging Centers, University of Minnesota, 1-151 Jackson Hall, 321 Church Street SE, Minneapolis, MN 55455, United States.
Elizabeth Schmidt, Biochemistry, Molecular Biology and Biophysics, University of Minnesota, 140 Gortner Laboratory, 1479 Gortner Ave, St Paul, MN 55108, United States; Masonic Institute on the Biology of Aging and Metabolism, University of Minnesota, 312 Church Street SE, 1035 University Drive, Minneapolis, MN 55455, United States.
Mickayla DuFresne-To, Biochemistry, Molecular Biology and Biophysics, University of Minnesota, 140 Gortner Laboratory, 1479 Gortner Ave, St Paul, MN 55108, United States; Masonic Institute on the Biology of Aging and Metabolism, University of Minnesota, 312 Church Street SE, 1035 University Drive, Minneapolis, MN 55455, United States.
David Bernlohr, Biochemistry, Molecular Biology and Biophysics, University of Minnesota, 140 Gortner Laboratory, 1479 Gortner Ave, St Paul, MN 55108, United States.
Paul Robbins, Biochemistry, Molecular Biology and Biophysics, University of Minnesota, 140 Gortner Laboratory, 1479 Gortner Ave, St Paul, MN 55108, United States; Masonic Institute on the Biology of Aging and Metabolism, University of Minnesota, 312 Church Street SE, 1035 University Drive, Minneapolis, MN 55455, United States.
Sayeed Ikramuddin, Department of Surgery, University of Minnesota, 11-132 Phillips-Wangensteen Bldg, 516 Delaware Street SE, Minneapolis, MN 55455, United States.
Oyedele Adeyi, Laboratory Medicine & Pathology, University of Minnesota, Mayo Memorial Building, 420 Delaware Street SE, Minneapolis, MN 55455, United States.
Linshan Laux, Biochemistry, Molecular Biology and Biophysics, University of Minnesota, 140 Gortner Laboratory, 1479 Gortner Ave, St Paul, MN 55108, United States; Masonic Institute on the Biology of Aging and Metabolism, University of Minnesota, 312 Church Street SE, 1035 University Drive, Minneapolis, MN 55455, United States.
Grant Barthel, Bruker Spatial Biology, 530 Fairview Ave N, Seattle, WA 98109, United States.
Steven Johnson, Institute for Health Informatics, University of Minnesota, 8-101 Phillips-Wangensteen Building, 516 Delaware St. SE, Minneapolis, MN 55455, United States.
Jinhua Wang, Institute for Health Informatics, University of Minnesota, 8-101 Phillips-Wangensteen Building, 516 Delaware St. SE, Minneapolis, MN 55455, United States; Masonic Cancer Center, University of Minnesota, 425 E River Pkwy, Minneapolis, MN 55455, United States.
Laura Niedernhofer, Biochemistry, Molecular Biology and Biophysics, University of Minnesota, 140 Gortner Laboratory, 1479 Gortner Ave, St Paul, MN 55108, United States; Masonic Institute on the Biology of Aging and Metabolism, University of Minnesota, 312 Church Street SE, 1035 University Drive, Minneapolis, MN 55455, United States.
Andrew Nelson, Laboratory Medicine & Pathology, University of Minnesota, Mayo Memorial Building, 420 Delaware Street SE, Minneapolis, MN 55455, United States.
Constantin Aliferis, Institute for Health Informatics, University of Minnesota, 8-101 Phillips-Wangensteen Building, 516 Delaware St. SE, Minneapolis, MN 55455, United States; Masonic Cancer Center, University of Minnesota, 425 E River Pkwy, Minneapolis, MN 55455, United States; Medical School, University of Minnesota, 420 Delaware St SE, Minneapolis, MN 55455, United States; Clinical and Translational Science Institute, University of Minnesota, 717 Delaware Street SE, Second Floor, Minneapolis, MN 55414, United States.
Funding
The work reported here received financial support from NIH grants U54 AG079754 and U54 AG076041.
Data availability
Integrated, harmonized, and raw datasets will be made available through the SenNet data portal.
References
- 1. Yue L, Liu F, Hu J. et al. A guidebook of spatial transcriptomic technologies, data resources and analysis approaches. Comput Struct Biotechnol J 2023;21:940–55. 10.1016/j.csbj.2023.01.016 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 2. Du J, Yang Y-C, An Z-J. et al. Advances in spatial transcriptomics and related data analysis strategies. J Transl Med 2023;21:330. 10.1186/s12967-023-04150-2 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 3. Chen T-Y, You L, Hardillo JAU. et al. Spatial transcriptomic technologies. Cells 2023;12:12. 10.3390/cells12162042 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4. Moses L, Pachter L. Museum of spatial transcriptomics. Nat Methods 2022;19:534–46. 10.1038/s41592-022-01409-2 [DOI] [PubMed] [Google Scholar]
- 5. Marx V. Method of the year: spatially resolved transcriptomics. Nat Methods 2021;18:9–14. 10.1038/s41592-020-01033-y [DOI] [PubMed] [Google Scholar]
- 6. Williams CG, Lee HJ, Asatsuma T. et al. An introduction to spatial transcriptomics for biomedical research. Genome Med 2022;14:68. 10.1186/s13073-022-01075-1 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7. Maynard KR, Collado-Torres L, Weber LM. et al. Transcriptome-scale spatial gene expression in the human dorsolateral prefrontal cortex. Nat Neurosci 2021;24:425–36. 10.1038/s41593-020-00787-0 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 8. Liu Y, Schwam J, Chen Q. Senescence-associated cell transition and interaction (SACTAI): a proposed mechanism for tissue aging, repair, and degeneration. Cells 2022;11:11. 10.3390/cells11071089 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 9. Huang W, Hickson LJ, Eirin A. et al. Cellular senescence: the good, the bad and the unknown. Nat Rev Nephrol 2022;18:611–27. 10.1038/s41581-022-00601-z [DOI] [PMC free article] [PubMed] [Google Scholar]
- 10. Gorgoulis V, Adams PD, Alimonti A. et al. Cellular senescence: defining a path forward. Cell 2019;179:813–27. 10.1016/j.cell.2019.10.005 [DOI] [PubMed] [Google Scholar]
- 11. Marin I, Serrano M, Pietrocola F. Recent insights into the crosstalk between senescent cells and CD8 T lymphocytes. NPJ Aging 2023;9:8. 10.1038/s41514-023-00105-5 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 12. Noel T, Wang QS, Greka A. et al. Principles of spatial Transcriptomics analysis: a practical walk-through in kidney tissue. Front Physiol 2021;12:809346. 10.3389/fphys.2021.809346 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 13. Li H, Zhou J, Li Z. et al. A comprehensive benchmarking with practical guidelines for cellular deconvolution of spatial transcriptomics. Nat Commun 2023;14:1548. 10.1038/s41467-023-37168-7 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 14. Kleino I, Frolovaitė P, Suomi T. et al. Computational solutions for spatial transcriptomics. Comput Struct Biotechnol J 2022;20:4870–84. 10.1016/j.csbj.2022.08.043 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15. Bonferroni CE. Il calcolo delle assicurazioni su gruppi di teste. In: Studi in Onore del Professore Salvatore Ortu Carboni. Rome: Italy, 1935, 13–60. [Google Scholar]
- 16. Hubert M, Vandervieren E. An adjusted boxplot for skewed distributions. Comput Stat Data Anal 2008;52:5186–201. 10.1016/j.csda.2007.11.008 [DOI] [Google Scholar]
- 17. McInnes L, Healy J, Melville J. UMAP: uniform manifold approximation and projection for dimension reduction. arXiv [stat.ML]. 2018. http://arxiv.org/abs/1802.03426
- 18. Steinley D. Properties of the Hubert-Arabie adjusted Rand index. Psychol Methods 2004;9:386–96. [DOI] [PubMed] [Google Scholar]
- 19. Steinley D, Brusco MJ, Hubert L. The variance of the adjusted Rand index. Psychol Methods 2016;21:261–72. 10.1037/met0000049 [DOI] [PubMed] [Google Scholar]
- 20. Shannon CE. A mathematical theory of communication. Bell Syst Tech J 1948;27:379–423. [Google Scholar]
- 21. Moran PAP. Notes on continuous stochastic phenomena. Biometrika 1950;37:17–23. [PubMed] [Google Scholar]
- 22. Thibault C, Le Berre V, Casimirius S. et al. Direct microcontact printing of oligonucleotides for biochip applications. J Nanobiotechnology 2005;3:7. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 23. Della Giustina G, Zambon A, Lamberti F. et al. Straightforward micropatterning of oligonucleotides in microfluidics by novel spin-on ZrO₂ surfaces. ACS Appl Mater Interfaces 2015;7:13280–8. 10.1021/acsami.5b01058 [DOI] [PubMed] [Google Scholar]
- 24. Fu X, Sun L, Dong R. et al. Polony gels enable amplifiable DNA stamping and spatial transcriptomics of chronic pain. Cell 2022;185:4621–4633.e17. 10.1016/j.cell.2022.10.021 [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
Data Availability Statement
Integrated, harmonized, and raw datasets will be made available through the SenNet data portal.




