WorksComputer Science
Optimal Transport Meets t-SNE: Integrated Visualization without Batch Effects in OT-tSNE
Abstract
Visual exploration is an integral step in understanding the structure of datasets. However, systematic variation between datasets collected under different conditions, known as batch effects, can obscure shared structure and complicate their joint visualization. Existing methods often rely on cross-batch nearest-neighbor relations to integrate the batches. Yet, these local correspondences can be unreliable for challenging cross-batch geometries. We propose optimal-transport t-SNE (OT-tSNE), which replaces nearest-neighbor-based matching with globally coupled affinities derived from entropic optimal transport. Controlled synthetic experiments demonstrated that nearest-neighbor-based methods can deteriorate, while optimal-transport affinities and OT-tSNE embeddings remain robust. Across seven real single-cell datasets, we benchmarked OT-tSNE against a broad range of integration and visualization methods and found that it achieves a Pareto-efficient trade-off between batch mixing and biological conservation, and integrates batches particularly well.
Introduction
As many scientific disciplines become more and more data driven, the need for large datasets increases. However, acquiring several smaller datasets is often more feasible than a single large one. Unfortunately, separately recorded datasets regularly show structural differences. Such differences can be technical nuisances like varying measurement techniques or protocols employed, or signals like donors or donor sex, that are undesirable for the task at hand. We collectively call such structural differences batch effect and the different smaller datasets batches. Many methods have been proposed to remove the batch effect and to integrate batches [37]. These typically integrate the data in the original feature space or in a relatively high-dimensional latent space.
As a result, these general-purpose batch removal methods are not directly usable when the aim is to visually explore the data. Visualizing the data as 2D scatter plots, e.g., with neighbor embedding methods like t-SNE [53], has become an important step in many exploratory data analysis pipelines [16]. General-purpose batch integration excels at producing good representations for downstream analysis, which then can be visualized with tools like t-SNE. But when visualization is the primary aim, directly producing an integrated visualization is both conceptually simpler and can yield better results. For this goal, we propose optimal-transport t-SNE (OT-tSNE), a novel approach combining optimal transport [43] and the
Preprint. popular t-SNE algorithm. Vanilla t-SNE lays the k-nearest-neighbor graph (kNN graph) out in 2D. In the presence of a strong batch effect, no kNN edge crosses from one batch to the other, leading to fully separated batches in the visualizations (Figure 1a, Figure 1c). The key idea of OT-tSNE is to augment this graph with explicit cross-batch edges before computing the layout. Many existing tools rely on cross-batch k-nearest neighbors, either mutual nearest neighbors, when both points are each other’s nearest neighbors (Haghverdi et al. (2018); Stuart et al. [48]; Hie et al. [22]; Barkas et al. [5]) or shared nearest neighbors, when at least one point is the nearest neighbor of the other (Polanski et al. [44]; Jain et al. [24]). Nearest neighbors are inherently local as each point selects nearest neighbors separately. This can lead to hubs among the cross-batch edges, especially on the fringes of the batches (Lun [38], “kissing problem”), which can deteriorate the integration in the visualization (Figure 1d,Figure 1e). Instead, optimal transport computes the overall best association between both batches, while ensuring that each point contributes equally. This allows OT-tSNE to produce very well-integrated visualizations while retaining the structure of individual batches (Figure 1b,Figure 1f).
Figure 1. a. Unintegrated t-SNE plot of the Lupus (Kang et al. [27]) data shows a clear batch effect. b. Our OT-tSNE integrates the batches. c – f. t-SNE with various affinity graphs on 2D toy data. d – f use the cross-batch edges in addition to the kNN graph. The cross-kNN variants only move the clusters close to each other (“kissing problem”), while optimal transport integrates them. g. OT-tSNE and MultiMAP achieved most top-3 ranks across all evaluation metrics and datasets.
We corroborate the strong performance of OT-tSNE with a large benchmark comparing 23 method configurations for visualizing data with batch effect in 2D across 7 datasets. We found that OT-tSNE matches the state-of-the-art combination of batch mixing and preservation of data structure, particularly outperforming the competitors in terms of batch integration (Figure 1g).
In sum, our contributions are
the first combination of optimal transport and neighbor embedding methods, OT-tSNE, for integrated visualizations of data with batch effect,
illustrating that nearest-neighbor-based methods can struggle even if the batch effect is orthogonal to the data, while OT-tSNE remains unaffected,
an extensive benchmark for visualizing batched data, highlighting the strong performance of OT-tSNE especially for batch mixing,
an open-source implementation of OT-tSNE based on the pot and optensne packages.
Our code is available at https://github.com/NDR-lab/ot-tsne.
Related work
Our work draws on two main strands of research, visualization and optimal transport. Spectral visualization approaches, such as Laplacian Eigenmaps (Belkin and Niyogi [6]) or Diffusion Maps (Coifman and Lafon [12]), lay out a graph approximation of the data via the eigenvectors of the graph’s Laplacian. Neighbor embeddings, like t-SNE [53] and UMAP [40], often produce visualizations with finer resolution and have thus become the de facto standard for non-linear visualization. Such embeddings distort distances between observations and fail to capture global data geometry [10]. However, when the high-dimensional data are well clustered, the groups visible in t-SNE plots often agree with those identified by dedicated clustering methods [28].
Optimal transport (OT) [43] computes how to transport mass from one dataset to another at minimal cost. It became popular in machine learning with Cuturi [14]’s seminal paper on the fast computation of entropically regularized optimal transport with the Sinkhorn-Knopp algorithm. SNEkhorn [51] used optimal transport maps for visualization by replacing the neighbor-based t-SNE affinities with optimal transport plans. This has some resemblance to our proposed OT-tSNE, but does not address batch integration.
The ability of optimal transport to meaningfully relate different datasets makes it well-suited to align datasets or remove batch effects. Courty et al. [13] mapped images from a source domain to the average of images in a target domain, weighted by the transport plan. Similarly, Demetci et al. [17] used optimal transport to align multimodal single-cell data. Landa et al. [31]’s entropic OT eigenmaps use an entropic OT (EOT) plan to align two datasets, thus extending Laplacian Eigenmaps and Diffusion Maps to data alignment. Like Laplacian Eigenmaps and Diffusion Maps, it struggles to compress rich information into the very low dimensionality needed for visualization.
Batch correction and integration are major topics in the analysis of single-cell RNA-sequencing (scRNA-seq) data [37]. Methods like scVI [36] and LIGER [54] learn to reconstruct cells from batch-aware encoding models. Most batch correction approaches infer cross-batch associations, often in a dimensionality-reduced space. Harmony [29] tries to infer compact cross-batch clusters. MNN (Haghverdi et al., 2018), Seurat [48], Scanorama [22] and others leverage mutual nearest neighbors (MNNs) across batches to estimate local batch-effect vectors. A few very recent methods use optimal transport as part of their batch integration pipeline to determine the integration order for multiple batches [23], to regularize adversarial integration [25], or as pre-alignment before the main contrastive VAE integration step [57]. None of them uses optimal transport as the main alignment ingredient, or produces 2D visualizations.
Some batch correction methods output a graph containing both within-batch affinities and cross-batch affinities. These methods are similar in spirit to ours, especially since the resulting graphs are often visualized with UMAP. However, their cross-batch edges are kNN- [44 BBKNN] or MNN-based [5 CONOS] and can thus lead to imbalanced cross-batch affinities and the kissing problem [38].
Closest to our work are approaches that directly produce an integrated 2D visualization. Poličar et al. [45] propose to use the t-SNE embedding of one batch as a reference for the other batch. Compound-SNE [9] relies on knowledge of shared cell types across different batches and alternates Procrustes alignment to a reference with t-SNE embedding optimization.
Other methods are symmetric in their treatment of batches. Batch-corrected t-SNE [1 BC t-SNE] first linearly integrates the input data to make it uncorrelated with the nuisance label and then restricts the t-SNE gradient updates to be orthogonal to the nuisance label. Conditional t-SNE [26] incorporates the batch information into t-SNE’s embedding affinities so that points from different batches move closer together. Revised conditional t-SNE [21 RC t-SNE] instead changes the input affinities to include inter-batch affinities. MultiMAP [24] extends UMAP to a multi-dataset visualization method, equipping a graph similar to the BBKNN graph with UMAP-like weights. Deep Visualization [55] trains a neural network to produce visualizations with a UMAP-like loss and uses the batch information in the embedding affinities, similar to conditional t-SNE. Our method OT-tSNE also adapts t-SNE for batch-corrected visualizations, but relies on optimal transport to provide cross-batch affinities.
Method
t-SNE background. t-SNE constructs a low-dimensional representation of a high-dimensional dataset , with . It does so by aligning pairwise similarity distributions in the high- and low-dimensional spaces [53]. The high-dimensional similarities are symmetrized Gaussian affinities with locally adapted bandwidths, whereas the low-dimensional similarities are defined using a normalized Cauchy kernel
Previous work has shown that replacing the Gaussian affinities with a binary shared -nearest-neighbor graph produces very similar t-SNE embeddings [4, 7, 15]. To align the similarities and thus compute the embedding coordinates , t-SNE minimizes the Kullback-Leibler divergence between and
OT-tSNE. Let for denote two batches from the same dataset. OT-tSNE modifies only t-SNE’s high-dimensional similarities, while leaving the low-dimensional Cauchy similarities and the objective unchanged. To define these similarities jointly across the two batches, we construct an affinity matrix and set . The matrix has a four-block structure, with within-batch affinities on the diagonal and cross-batch affinities in the off-diagonal blocks. Figure 2 shows the schematic of OT-tSNE, and Algorithm 1 gives the pseudocode for its default configuration.
Figure 2. OT-tSNE method overview. a. Toy dataset with batch effect and selected optimal transport cross-batch affinities shown as edges (left), with the full plan shown as matrix (right). b. Construction of the four-block joint affinity matrix for the t-SNE backend. The plans , form the off-diagonal blocks. c. Completing the on-diagonal blocks and to reflect similarity of points in the same batch. d. Batch-size-aware sparsification of the dense joint affinities to make them suitable for t-SNE optimization. e. Integrated OT-tSNE embedding obtained via t-SNE optimization.
Cross-batch affinities. The cross-batch affinity is given by the entropic optimal transport (EOT) plan between and [14, 43]. Let denote the Euclidean cross-batch cost matrix. The EOT plan is defined as
The resulting plan forms the off-diagonal blocks of the joint affinity matrix in Figure 2. The marginal constraints ensure that the cross-batch coupling is globally balanced, so that all points are equally associated with the other batch. This is in contrast to local nearest-neighbor approaches that can lead to imbalanced associations with hubs and barely connected regions (Figure 1d,Figure 1e).
The hyperparameter controls the sparsity of the transport plan, with larger (smaller) yielding more uniform (concentrated) plans. We set , with , following Landa et al. [31]. We refer to the hyperparameter as relative regularization.
Within-batch affinities. Our within-batch affinities, , , are inspired by EOT eigenmaps [31], which leverage singular value decomposition of the cross-batch transport plan
where , , , and are the left / right singular vectors, and singular values of , respectively. The EOT eigenmap coordinates are then given by the first columns of
We construct a symmetric joint affinity matrix whose eigenvectors are EOT eigenmap coordinates, while retaining as its cross-batch affinities. Specifically, we set
We use this EOT eigenmap-based completion as our default.
We consider four additional constructions of the within-batch affinities. (i) Setting the within-batch affinities to zero. (ii) Gram matrices and relate points within one batch by how many cross-batch assignments they share. From the singular value decomposition, they satisfy
Therefore, unlike the default completion above, this gives different powers of the singular values in the within- and cross-batch blocks. We refer to this method as OT-tSNE with Gram diagonals. (iii) Another optimal transport-based affinity matrix is the entropic optimal transport plan from each batch to itself. We refer to this variant as self OT. (iv) Finally, we represent within-batch affinities using a shared k-nearest-neighbor graph. This is closest to neighbor embedding methods like t-SNE and UMAP. We compare the alternative within-batch constructions empirically in § 5.
Batch-size-aware sparsification. The EOT plan, and consequently , is dense, whereas the high-dimensional t-SNE affinities are sparse in practice. We therefore remove self-edges and select neighbors per observation, using as a practical default following UMAP and NCVis [40, 4]. To avoid overrepresenting the larger batch, the neighbor budget is split according to the sizes of batches ,
Thus, for every observation, we keep its strongest affinities to batch 0 and strongest affinities to batch 1. We symmetrize the selected edges by retaining an edge whenever either endpoint selects the other. We then binarize the resulting graph and normalize its total affinity mass to one. The sparsification can introduce mild imbalance in the resulting affinity.
Initialization and optimization. By default, we initialize the 2D layout with the second and third columns of the EOT eigenmap matrix . These coordinates incorporate cross-batch affinities into the initial layout. We compare four initialization choices (random, spectral, PCA, EOT), details on which can be found in Appendix § 13.§ 1.
We then optimize the t-SNE objective using the sparse joint affinity matrix and this initial layout in openTSNE [46]. Details on t-SNE parameters and other implementation details are in Appendix § 13.§ 1.
Experimental Setup
Datasets
In addition to a synthetic version of MNIST [32] with batch effect, described in § 5.1, we benchmark OT-tSNE and competitors on seven real-world single-cell datasets with batch effect. We collected these from prior works on batch effect removal [50, 31] and added a subset of Yao et al. [56]’s mouse brain atlas. The datasets vary in size from approximately to approximately points. The batch effect ranges from replicated identical experimental conditions over varying biological signal (donor sex, treatment perturbation) to different single-cell measurement techniques. More details on the datasets can be found in Appendix § 10 and Table S1.
| Name | Description | Main batch effect | classes | ||
| Human brain | human insular cortex | technical replicates | 3145 | 6070 | 9 |
| nCov | PBMCs of COVID patient | days in hospital | 2877 | 1240 | 13 |
| Lupus | PBMCs of Lupus patients | treatment vs control | 7451 | 6548 | 13 |
| Mouse cortex | mouse entorhinal cortex | donor sex | 11352 | 15236 | 22 |
| PBMC | PBMCs | sc-technology | 8098 | 7378 | 9 |
| Mouse atlas | mouse atlas | sc-technology | 4239 | 2715 | 11 |
| Hematopoietic | mouse hematopoiesis | sc-technology | 2729 | 1920 | 7 |
Table S1. Single-cell datasets overview
Evaluation
We evaluate each joint embedding along two complementary objectives: batch mixing and conservation of biological structure, following Luecken et al. [37]. For each objective, we use two metrics, all scaled to such that higher values indicate better performance.
Batch mixing. We quantify batch mixing with the kNN batch-effect test [8 kBET] and the integration local inverse Simpson’s index [29 iLISI].
Biological conservation. We measure preservation of biological structure using neighborhood purity and the silhouette score [47]. We provide the precise metric definitions and implementation details in Appendix D.
Ranking. Following established practices for benchmark aggregation [39, 37], we aggregated metric values before ranking methods. Within each dataset, we min–max normalized each metric across methods. We ranked methods by (i) the mean of all four normalized metrics overall and (ii) by the mean of the two metrics in each category for biological conservation and batch mixing. We averaged the resulting ranks across the seven datasets. Additionally, we count how often a method obtains a top-3 rank per metric category and dataset. Appendix D.1 provides further details on the ranking procedure and its interpretation.
Compared methods
We compare OT-tSNE against prominent methods for batch integration and joint visualization, grouped according to how the final two-dimensional embedding is obtained. Table S2 summarizes the hyperparameters and configurations of the compared methods.
| Method | Selected hyperparameters | Benchmark changes |
| Integrated visualization methods | ||
| OT-tSNE | Neighborhood size (15), relative entropic regularization (1) | — |
| MultiMAP | Neighborhood size (), dataset weights (0.5 each for two batches), minimum embedding distance (0.25), embedding spread (1) | — |
| RC t-SNE | Same-batch attraction factor (), perplexity (30) | Used the recommended attraction factor |
| BC t-SNE | Batch-corrected projection rank (50), perplexity (30) | — |
| Reference t-SNE | Reference perplexities (50 and 500), query perplexity (30), distance measure (cosine) | — |
| General-purpose integration methods | ||
| Seurat v5 (CCA) | CCA dimensions (30), anchor-finding neighborhood (5), anchor filtering (disabled), anchor-scoring neighborhood (30), anchor-weighting neighborhood (100), anchor-weighting kernel width (1) | CCA dimensions: 2 for 2D, default for 50D |
| LIGER | Number of factors (20), penalty on dataset-specific factors (5), quantile-normalization neighborhood (20), number of quantiles (50) | Factors: 2 or 50 |
| Scanorama | Matching neighborhood (20), merging threshold (0.1), reduced dimension (100), correction kernel width (15) | Reduced dimension: 2 or 50 |
| scVI | Latent dimension (10), hidden-layer width (128), number of hidden layers (1), dropout rate (0.1), count likelihood (zero-inflated negative binomial), dispersion model (per gene) | Latent dimension: 2 or 50 |
| Harmony | Diversity penalty (2), ridge penalty (estimated from the data), number of clusters (), soft-assignment width (0.1) | — |
| EOT | Relative entropic regularization (1), number of singular modes (2), diffusion time (0) | Singular modes: 2 or 50 |
Table S2. Selected hyperparameters of the compared methods, with software defaults in parentheses unless otherwise stated. The last column specifies changes to the listed settings in our benchmark. denotes the number of batches and the number of cells.
Direct integration and visualization. We first consider methods dedicated to batch-corrected visualization. They directly construct a joint two-dimensional representation and therefore provide the closest comparison to OT-tSNE. These include MultiMAP [24], BC t-SNE [1], RC t-SNE [21], and Ref t-SNE [45].
General-purpose integration methods. We additionally evaluate prominent general-purpose integration and alignment methods: Scanorama [22], Seurat [48], scVI [36], LIGER [54], Harmony [29], and EOT eigenmaps [31]. We evaluate these methods in two regimes. First, we use each method to construct a higher-dimensional integrated representation, as is common for downstream analyses. We choose 50 dimensions in our experiments before visualizing them with t-SNE. Second, we construct the integrated representation directly in 2D, a more restrictive setting that tests whether it can serve as the final visualization. We denote these two regimes by the method name followed by 50D or 2D, respectively, and refer to EOT eigenmaps simply as EOT throughout the experiments.
No integration. Finally, we include joint PCA and joint t-SNE [53] as reference baselines, simply by concatenating the two batches and embedding them.
Results
Synthetic experiments
We first highlight the strength of optimal-transport-based cross-batch affinities. Nearest-neighbor affinities can become unreliable when faced with challenging batch effects. For instance, a well-known failure case is the “kissing problem”, which is most immediate when the batch effect acts along signal directions (Fig. 1c–f). In high-dimensional data, however, the structure of interest often lies on a much lower-dimensional manifold, such that batch effects are often orthogonal to the biological signal. This assumption underlies several batch correction techniques [48, 22] (Haghverdi et al. 2018). Here, we demonstrate that even in this setting, nearest-neighbor cross-batch affinities can struggle, while OT-tSNE is provably unaffected.
Balanced OT is invariant to orthogonal batch effects. Consider perturbing two datasets by nuisance vectors, and . Assume that the nuisances are orthogonal to the data and to nuisances of the other dataset, i.e., all are orthogonal to all and and also each is orthogonal to each . Then, the squared Euclidean cost used in Eq. (2) only changes by row- and column-wise offsets
because all other terms are zero due to orthogonality. For any feasible coupling in Eq. (2), the perturbed and unperturbed cost functions differ by a constant,
since the additional terms are fixed by the marginals. Hence, for fixed , the optimal EOT plan is unchanged under this perturbation model. More general orthogonal nuisance models have been theoretically analyzed by Kuang and Tabak [30] and Landa et al. [31].
In contrast, nearest-neighbor affinities are sensitive to the nuisance magnitudes in Eq. (8), which can reorder the pairwise distances and hence change the local neighborhoods.
MNIST with orthogonal class-dependent batch effects. We apply the above noise setting to two disjoint, class-balanced batches sampled from MNIST. From a joint PCA of the clean images, we use two disjoint sets of 30 trailing components to define mutually orthogonal noise subspaces (Appendix § 11.§ 1). Specifically, each digit class receives its own perturbation direction and magnitude,
where denotes the digit class of sample and controls the batch-effect strength (Figure 3a). Thus, different regions of the data experience batch effects of different directions and magnitudes. This is different from the usual orthogonality notion, where one batch is rigidly shifted relative to the other by some shared batch vector orthogonal to the signal subspace. Nevertheless, in our setup the batch effect is still confined to dimensions orthogonal to the main signal. Since we retain the original pixels as the clean signal and choose the perturbation from the trailing PCs, the orthogonal decomposition in Eq. (8) is only approximate. Projecting the images onto the leading PCA subspace before adding noise makes this orthogonality exact and yields nearly identical results (Figure S3,Figure S3).

Figure 3. a. Construction of class-dependent orthogonal batch effects. b. Cross-batch graph purity for OT, shared kNN, and mutual kNN affinities. c. Example embeddings at , colored by batch (top) and digit class (bottom). d–e. Embedding purity and batch mixing for the select integrated visualization methods across corruption strengths.

Figure S3. Effect of fixed and adaptive entropic regularization on original MNIST (top) and the signal-projected control (bottom). Columns show regularization strength (a,e), graph edge overlap (b,f), digit-label purity (c,g), and full-plan total variation (d,h). Edge overlap and total variation are measured relative to zero corruption. Points and error bars show means and standard deviations over three seeds.
Regularization. At each corruption strength , we recomputed our default regularization , which increased with (Figure S3). The invariance result assumes fixed . In practice, cross-batch digit-label purity remained similar under fixed and adaptive regularization (Appendix § 11.§ 2, Figure S3).
Cross-batch affinity stability. We compared sparsified EOT affinities with shared and mutual cross-batch kNN affinities using the same neighborhood size . For EOT affinities, we retained the top-15 cross-batch affinities per point, symmetrized the resulting graph and binarized it. We evaluated the affinities by the neighbor purity, defined as the fraction of retained neighbors with the same digit label, averaged over points with at least one retained edge (Figure 3b). As the strength of the batch effect increased, both shared and mutual kNN affinities progressively deteriorated. For mutual kNN, this deterioration persisted despite conservative matching, as the fraction of points retaining a reciprocal cross-batch edge fell from 98% to 11% between and . In contrast, the EOT affinities remained stable over the same corruption range.
Two-dimensional embeddings. We finally ask whether this difference in cross-batch affinities affects the resulting two-dimensional embeddings. We compare OT-tSNE with MultiMAP (Jain et al., [24]), whose integration graph uses shared cross-batch neighborhood information, and Scanorama (Hie et al., [22]) followed by t-SNE, which relies on mutual nearest-neighbor correspondences. OT-tSNE maintains nearly unchanged batch mixing and digit purity across the corruption range (Figure 3d–Figure 3e). Scanorama progressively deteriorates in batch mixing, while MultiMAP is more robust but also deteriorates as the batch effect increases. Digit purity remains high for all three methods, indicating that the dominant effect is a loss of cross-batch alignment. The visualization of embeddings at in Figure 3c qualitatively reflects these trends.
Together, these experiments show that under heterogeneous orthogonal batch effects, balanced transport yields more stable cross-batch affinities than local neighbor matching, and that this difference persists in the resulting two-dimensional visualizations.
Benchmarking on real datasets
To test whether the results in the controlled setting extend to real data, we extensively benchmarked OT-tSNE on seven single-cell datasets with diverse batch effects and varying degrees of compositional imbalance (Figure S1 and Figure S2). For instance, Mouse Atlas showed the second-largest compositional imbalance in our benchmark, with its B cells accounting for roughly 29% of one batch and 8% of the other (Figure S1). Remarkably, despite this disparity, OT-tSNE had the best trade-off in mixing and biological preservation in Mouse Atlas compared to the other methods (Figure S10 and Figure S11).
Figure S1. Batch compositions of the subset of single-cell datasets: nCoV, Hematopoietic, Mouse atlas, Human brain. Cell counts per cell type (left) and corresponding within-batch cell-type proportions (right).
Figure S2. Batch compositions of the subset of single-cell datasets: Lupus, PBMC, Mouse cortex. Cell counts per cell type (left) and corresponding within-batch cell-type proportions (right).
Figure S10. Benchmark results for all methods and datasets for the purity and kBET metrics for a. OT-tSNE variants, b. integrated visualization methods, c. general-purpose integration methods either with 50D latent spaces visualized with t-SNE (dots) or with 2D latent spaces directly used for visualization (squares), and d. baselines without integration. Reported means and standard deviations over datasets. OT-tSNE is repeated in all panels for better comparability.
Figure S11. Benchmark results for all methods and datasets for the silhouette and iLISI metrics for a. OT-tSNE variants, b. integrated visualization methods, c. general-purpose integration methods either with 50D latent spaces visualized with t-SNE (dots) or with 2D latent spaces directly used for visualization (squares), and d. baselines without integration. Reported means and standard deviations over datasets. OT-tSNE is repeated in all panels for better comparability.
Across the seven datasets, OT-tSNE overall achieved a strong balance between batch mixing and biological conservation. Its pooled scores were among the best methods for all metrics, with particularly strong batch mixing scores, kBET and iLISI (Figure 4). This performance was also consistent across datasets and metrics: OT-tSNE appears among the top three ranked methods more often than any competing method (Figure 1g). The aggregate ranking over all four metrics likewise placed OT-tSNE first (Table 1).
Figure 4. Pooled batch-mixing scores (x-axis; kBET or iLISI) versus biological-conservation scores (y-axis; purity or silhouette) across datasets for a. OT-tSNE variants, b. integrated visualization methods, c. general-purpose integration methods either with 50D latent spaces visualized with t-SNE (dots) or with 2D latent spaces directly used for visualization (squares), and d. baselines without integration. Reported means and standard deviations over datasets. OT-tSNE is repeated in all panels for better comparability.
| Method | Rank |
| OT-tSNE | 2.0 |
| OT-tSNE (self OT) | 4.0 |
| MultiMAP | 4.4 |
| Seurat 50D | 5.4 |
| LIGER 50D | 7.7 |
| OT-tSNE (zero) | 8.0 |
| Scanorama 50D | 8.6 |
| EOT 50D | 9.0 |
| scVI 50D | 9.4 |
| Harmony 50D | 9.6 |
| RC t-SNE | 10.4 |
| scVI 2D | 11.3 |
| OT-tSNE (Gram) | 11.4 |
| OT-tSNE (kNN) | 12.7 |
| Ref t-SNE | 16.1 |
| Harmony 2D | 16.3 |
| LIGER 2D | 16.7 |
| BC t-SNE | 16.9 |
| Joint t-SNE | 17.4 |
| Scanorama 2D | 17.9 |
| EOT 2D | 18.9 |
| Joint PCA | 19.4 |
| Seurat 2D | 22.4 |
Table 1. Aggregated ranks across all four metrics and all datasets, lower is better.
The construction of the within-batch affinities mostly affected batch mixing. The five OT-tSNE variants had similar pooled purity and silhouette scores, whereas the default spectral construction attains the highest kBET and iLISI scores (Figure 4a). We therefore use this construction as the default throughout the paper.
MultiMAP was the strongest competitor (Figure 4b). It was slightly better in biological conservation, while OT-tSNE mixed batches better (Figure S4). The other integrated visualization tools, BC t-SNE, RC t-SNE, and Ref t-SNE, integrated batches much worse.
Figure S4. Mean rank across seven datasets. Within each dataset, we ranked methods by the average of all four normalized metrics (left), the two biological conservation metrics (middle), or the two batch mixing metrics (right). Lower ranks indicate better performance.
General-purpose integration methods followed by t-SNE were competitive but less consistent across datasets (Figure 4c). Some 50-dimensional integrations matched or exceeded OT-tSNE on individual biological-conservation metrics, but their performance varied substantially across metrics and datasets (Figure S10 and Figure S11). Adapting the methods to output integrated embeddings in 2D generally reduced biological conservation relative to integrating in 50 dimensions followed by t-SNE, with scVI-2D as a notable exception.
Without batch integration, joint t-SNE largely preserved biological structure but left the batches separated. In contrast, joint PCA mixed the batches at the expense of biological conservation (Figure 4d).
Embeddings of the selected methods on the Lupus dataset illustrate the corresponding trade-off between batch mixing and cell-type structure (Figure 5).
Figure 5. Lupus embeddings across selected methods. Top: colored by batch. Bottom: the same embeddings colored by annotated cell type. For visualizations of the other datasets, see Figure S12.
Figure S12. Visualizations of selected methods on the remaining 6 datasets, not shown in Figure 5. Each embedding is shown twice, in the top row colored by batch, in the bottom row colored by cell type.
The main exception was the Hematopoietic dataset, where some cell types occurred in only one batch (Figure S1). Here, OT-tSNE retained comparatively strong batch mixing but lost more biological structure than on the other datasets (Figure S10 and Figure S11). However, this dataset was generally more challenging to integrate for all the methods.
Sensitivity to hyperparameters and initialization. We evaluated 25 combinations of neighborhood size and relative regularization on the seven real datasets (Appendix E.1). On average, batch mixing and biological conservation changed little near the default , with larger trade-offs at the extremes of the tested range. At fixed , lower regularization tended to favor batch mixing, while at fixed , larger neighborhoods tended to favor biological conservation (Figs. S5 and
S6). Across all five OT-tSNE variants, switching from random initialization to PCA, spectral, or EOT initialization changed each metric by less than 0.01 on average across datasets (Figure S7 and Figure S8). More details are in Appendix § 14.§ 2. On Lupus, random initialization produced different cluster arrangements across seeds, whereas each of the deterministic initializations (spectral, EOT, and PCA) reproduced the same visualization when jitter was disabled (Figure S9).

Figure S7. Mean change from random initialization across seven datasets, multiplied by 100. Each panel shows one metric and the mean of the four metrics, with OT-tSNE variants in rows and alternative initializations in columns. All values fall below the magnitude threshold of 1.

Figure S8. Effect of initialization on individual datasets. Each row corresponds to one dataset, and each column corresponds to one metric. For each OT-tSNE variant, mean scores over three seeds for random, spectral, EOT, and PCA initialization are displayed.

Figure S9. OT-tSNE embeddings of the Lupus dataset across three seeds and four initializations. Columns show initialization methods. Each pair of rows shows the embeddings for one seed, colored by batch (top) and cell type (bottom). With jitter disabled, spectral, EOT, and PCA initialization each reproduced its own layout across seeds. With random initialization, the relative positions of the major clusters varied.
Limitations and Future Work
OT-tSNE uses balanced optimal transport with uniform marginals. When a cell type is more abundant in one batch than in the other, some of its mass must be transported to other cell types. This can be problematic when batches contain strongly different cell-type proportions or non-overlapping cell types. Therefore, we assume that this constraint may have contributed to the weaker cell-type preservation we observed on the Hematopoietic dataset, where some cell types occur in only one batch (see Figure S1 for batch composition, Figure S10 and S11). Unbalanced optimal transport ([11]) provides a possible extension by relaxing the marginal constraints and thereby avoiding forced correspondences between populations that are absent from the other batch. Density-reweighted EOT ([33]) offers another possible extension by reducing the influence of sampling-density differences on cross-batch correspondences.
OT-tSNE is currently formulated for two batches. An easy multi-batch extension would compute pairwise transport plans between batches as off-diagonal blocks of a larger joint affinity matrix.
Runtime is another limitation. In our CPU-only benchmark, default OT-tSNE was comparable to several competing methods on smaller datasets, but the affinity matrix creation increasingly dominated as dataset size grew, whereas the other OT-tSNE variants were faster on larger datasets (Figure S13). The SVD and construction of within-batch affinities were the main computational bottlenecks in the default OT-tSNE, which can be easily sped up with approximate versions. Appendix § 15 analyzes these costs and summarizes the computational complexity of the benchmarked methods. We therefore tested randomized SVD truncated to 200 components, which substantially reduced runtime and made OT-tSNE comparable to several competing methods also on larger datasets (Figure S13), while preserving its first-place aggregate ranking. Beyond that, EOT’s Sinkhorn iterations ([14]) can be accelerated on GPU. Landmark approximations ([2]) could further reduce the size of the transport problem.

Figure S13. Median runtimes of all methods on all datasets over three random seeds. For OT-tSNE variants, we separate the creation of the affinity matrix from the t-SNE optimization. Similarly, for the general-purpose methods with subsequent t-SNE, we separate both phases. For the default OT-tSNE affinity construction, we report runtimes using both full SVD and randomized SVD truncated to 200 components (rSVD 200).
Finally, unlike general-purpose integration methods, OT-tSNE produces a two-dimensional visualization rather than a reusable integrated representation for downstream analysis. A promising extension is to use OT-derived cross-batch correspondences as supervision for high-dimensional representation learning, for example through a contrastive objective.
Conclusion
We presented OT-tSNE for visualization of datasets with batch effects. Rather than using local cross-batch nearest-neighbor relations, OT-tSNE uses entropic optimal transport to construct high-dimensional cross-batch affinities directly visualized by t-SNE. Our controlled experiments showed that these affinities were robust under heterogeneous orthogonal batch effects, where nearest-neighbor affinities deteriorate. In a benchmark on seven real single-cell datasets, OT-tSNE was fairly robust even when datasets with shared classes had unbalanced distributions. In this benchmark, OT-tSNE consistently achieved strong batch mixing while preserving biological structure well.
Acknowledgments
This work was supported by the Gemeinnützige Hertie-Stiftung. We thank the International Max Planck Research School for Intelligent Systems (IMPRS-IS) for supporting Azhar Akhmetova.
We thank Florian Beier and Stephan Eckstein for productive discussions on unbalanced optimal transport.
AI use statement
In this work, we used generative AI tools for generating synthetic datasets (Appendix § 11.§ 1), designing or providing feedback on research methodology and experiments, implementing methods, cleaning and reformatting datasets (esp. joint preprocessing in Appendix § 10.§ 1). We did not use generative AI tools to develop theoretical models or conceptual frameworks, formulate mathematical claims, propose or refine hypotheses, interpret results, or provide critical ingredients for proving mathematical claims. Assistance with writing proofs, qualitative or thematic data analysis, and translation were not applicable to this work.
Additionally, we used generative AI tools for creating and editing software code, drafting and editing parts of the manuscript, and formatting references. We manually edited all text afterwards. Similarly, all AI-assisted code and analyses were reviewed by the authors. We take responsibility for the final content of this work, including text, claims, code, analyses, and artifacts produced with the aid of generative AI.
Reproducibility statement
We ensure reproducibility by clearly describing our method (§ 3) and experiment setup, including datasets, metrics and competitors (§ 4) in the main paper. Additionally, we give further details on the single-cell datasets and preprocessing in Appendix § 10 and describe the synthetic dataset construction in Appendix § 11.§ 1. We dedicate Appendix § 13 to implementation details of the benchmarked methods. Overall, we stuck to default hyperparameters as far as possible. We give full details on the evaluation metrics in Appendix D. Finally, we include our code as supplementary and will make it open source upon acceptance.
Appendix
Single-cell dataset descriptions
All but the Human brain datasets contain single-cell RNA-sequencing data.
Human brain contains single-nucleus RNA-seq data for cells from the same human postmortem insular-cortex sample, profiled using 10x Chromium v3 snRNA-seq [3]. The two batches correspond to replicates 1 and 4 and the batch effect is only due to technical artifacts of measuring both batches independently with the same protocol. It is therefore quite small. We downloaded the data from https://zenodo.org/records/17167270.
nCov contains peripheral blood mononuclear cells (PBMCs) from a longitudinal study of a COVID-19 patient 5 of Zhu et al. [59]. The batches were sampled at days 1 and 13 after hospitalization and so that the batch effect is mainly due to the disease progression.
Lupus contains PBMCs from lupus patients [27]. The batches correspond to the control and treatment cohorts.
Mouse Cortex contains the layer 2/3 intratelencephalic-projecting glutamatergic neurons of the entorhinal mouse cortex in Yao et al. [56], i.e., subclasses L2 IT ENTl, L2 IT ENTm, L3 IT ENT, L2/3 IT ENTl. The batch effect corresponds to the sex of the mouse.
PBMC contains peripheral blood mononuclear cells of healthy donors recorded either with the 10x Chromium 3’ or 5’ chemistry from Zheng et al. [58]. The batch effect is thus due to measurement technology.
Mouse atlas contains cells from the two whole mouse atlases of Han et al. [20] and Tabula Muris Consortium [49]. Only 11 shared cell types are used following Tran et al. [50]. This dataset contains a strong batch effect since Han et al. [20] acquired the data via the Microwell-seq technology, while the Tabula Muris Consortium [49] used SMART-seq22.
Hematopoietic contains differentiating hematopoietic stem and progenitor cells from mouse bone marrow. Again, the two batches come from different studies. The first batch is from Paul et al. [42] who used the MARS-seq protocol. The second is from Nestorowa et al. [41] who used SMART-seq2. We used the same subsets as Tran et al. [50]. In addition to the different measurement technologies, the two batches contain different cell types and even the shared ones have very different proportions (Figure S1 and Figure S2), making this a challenging dataset with strong batch effects.
The last three datasets (PBMC, mouse atlas, and hematopoietic) were used in Tran et al. [50] and we downloaded them from the author’s Docker image https://hub.docker.com/r/jimiaochenlab/batch-effect-removal-benchmarking.
Preprocessing
We used scanpy to apply a unified preprocessing pipeline to all datasets. Our aim was to standardize the input across methods as much as possible and thereby disentangle the effects of preprocessing from those of the integration methods themselves. First, we concatenated the batches and removed cells with fewer than 10 detected genes and genes detected in fewer than three cells. We selected 1 000 highly variable genes using the seurat_v3 flavor. Feature selection was performed on raw counts.
We retained the raw counts for the selected genes as input to methods that require count data: scVI [36], Seurat [48], LIGER [54], and Ref tSNE [45]. For these methods, internal feature selection was disabled so that all methods used the same 1,000-gene panel, while other method-specific preprocessing of the input was retained.
For the remaining methods, we normalized each cell to a total count of 10 000 and applied the natural-log transformation . Scanorama [22], MultiMAP [24], and BC tSNE [1] operated directly on this common log-normalized 1 000-gene representation, as these methods apply their own preprocessing in feature space. Finally, we fitted a single 50-dimensional PCA jointly to the concatenated batches to obtain a common PCA representation. OT-tSNE, EOT eigenmaps [31], joint t-SNE, Harmony [29], and RC tSNE [21] operated on the corresponding batches in this 50-dimensional representation. Overall, all methods used the same cells and selected genes while receiving the representation appropriate for their input requirements.
Batch compositions
The datasets vary in their cell-type composition across batches (Figure S1 and S2). All datasets except hematopoietic contain shared cell types across batches, whereas hematopoietic additionally contains batch-specific cell types. Cell-type proportions are relatively balanced across batches in some datasets (Lupus, Human Brain, Mouse cortex, PBMC), but are rather imbalanced in the other datasets (nCov, Hematopoietic, Mouse atlas). Consequently, batch effects can be entangled with biological composition, making integration particularly challenging for datasets with imbalanced or non-overlapping cell types.
Synthetic experiment
We used the default configurations for MultiMAP and Scanorama. For the reported OT-tSNE embeddings, we used random initialization and kept all other settings at their default values.
Synthetic orthogonal batch effect construction
We sample two disjoint, class-balanced MNIST batches with 100 images per digit and fit PCA jointly to both batches. We take the last 60 numerically resolved PCs (explained variance times that of the first PC) and split them into two disjoint 30-dimensional nuisance subspaces, one per batch. For each class and batch , we sample a unit nuisance direction
where are the corresponding PCA basis vectors. The class scales are independent permutations, for each batch, of ten values equally spaced between 0.35 and 2.60. We define
so that the average nuisance within each batch is zero. The corrupted samples are , with .
Fixed and adaptive regularization in the MNIST experiment
In Figure 3, we used our default entropic regularization, , where is the cross-batch squared Euclidean cost matrix at corruption strength . This regularization increased with corruption strength, whereas the invariance result in § 5.1 assumes fixed regularization and fixed marginals. We therefore repeated the experiment with held fixed across corruption strengths (Figure S3,Figure S3).
We compared fixed and adaptive regularization on the original MNIST data used in Figure 3 and on a signal-projected control. For the control, we projected the clean images onto the leading principal components explaining at least 90% of their pooled variance before adding the class-dependent corruption. This makes the corruption exactly orthogonal to the retained signal. On original MNIST, the clean images also contain variation outside this subspace, so orthogonality holds only approximately.
To assess whether these changes affected the selected neighbors, we constructed a cross-batch graph by retaining the 15 largest entries in each row and each column of the plan. A pair forms an edge if either observation selects the other. We measured edge stability by the Jaccard overlap with the uncorrupted graph: the number of shared edges divided by the number of edges in their union. We also measured digit-label purity by computing the fraction of each observation’s graph neighbors with the same digit label, averaging first within each batch and then equally across batches. We also measured changes in the dense transport plan by its total variation from the uncorrupted plan, i.e., the fraction of transport mass reassigned.
At fixed , the projected control behaved as predicted by § 5.1. The full plan remained unchanged up to numerical precision, so the top-15 selections also remained unchanged and edge overlap was one at every corruption strength (Figure S3,Figure S3). On original MNIST, we observed small changes in both the plan and the selected edges (Figure S3,Figure S3).
With adaptive regularization, total variation at the strongest corruption () reached 0.068 on original MNIST and 0.076 on the projected control (Figure S3,Figure S3). Even at this strength, the respective graphs had Jaccard overlaps of 0.929 and 0.937 with their uncorrupted references (Figure S3,Figure S3). Digit-label purity decreased by only about half a percentage point in both settings from to (Figure S3,Figure S3).
Implementation details
Implementation details
OT-tSNE algorithm
Algorithm 1 OT-tSNE with spectral within-batch affinities and EOT initialization
Input: Batches for , relative regularization (default 1), neighbor budget (default 15), seed
Output: Joint embedding
Cross-batch transport
,
Joint affinities
Compute the SVD
, ▷ cross-batch blocks are and
Set negative entries of to zero
Batch-size-aware sparsification
Split into integer budgets with
for each observation and each batch do
Select the observations in batch with the largest , excluding itself
end for
Construct the binary adjacency matrix : set if selects or selects , and otherwise
Normalize the graph affinities:
Initialization and optimization
Form from columns 2 and 3 of ▷ skip the constant first mode
Fix column signs, rescale , and add Gaussian jitter using seed
return
The self-OT, Gram, kNN, and zero variants use the same cross-batch plan and replace the two within-batch blocks of as described in § 3.
Affinity construction. We used neighbors, a commonly used neighborhood size in nearest-neighbor graph methods and the default in UMAP and NCVis [40 Artemenkov] and Panov, 2020). We set the entropic regularization hyperparameter to the median of the Euclidean cross-batch cost, following Landa et al. [31]. Therefore, relative regularization hyperparameter by default. We computed the transport plan using Sinkhorn iterations with a convergence tolerance of and a maximum of iterations.
For spectral within-batch affinities, any negative entries are explicitly set to zero. At the default regularization, they are rare and extremely small: all datasets except nCoV do not have negative entries, while nCoV has fewer than 30, with the largest .
Initialization The t-SNE optimization requires an initial 2D layout. We considered four initializations. (1) Random initialization draws each coordinate independently from a zero-mean Gaussian with standard deviation , following openTSNE (Poličar et al. [46]). (2) As in openTSNE, spectral initialization computes a diffusion map of the OT-tSNE affinity graph using the two leading nontrivial eigenvectors of its random-walk transition matrix, each weighted by its eigenvalue. (3) PCA initialization projects the concatenated batches onto their first two joint principal components. (4) EOT initialization uses the second and third left singular vectors of the cross-batch transport plan for the first batch and the corresponding right singular vectors for the second.
We use EOT initialization by default. For the spectral, PCA, and EOT initializations, we rescale both coordinates by a common factor so that the first has standard deviation .
By default, openTSNE adds a small jitter to deterministic initializations such as PCA, so that no two points sit on the same spot. Therefore, following openTSNE, by default, we add independent Gaussian noise with standard deviation to each coordinate to separate coincident points. We use the run’s random seed to generate the noise.
t-SNE parameters. We supplied the sparse OT-tSNE affinity matrix and initial layout to openTSNE and used its default settings for all optimization parameters. These include 250 iterations with early exaggeration followed by 500 iterations without exaggeration.
Benchmark setup
t-SNE parameters for two-step embedding methods. For general-purpose integration methods that first construct a 50-dimensional representation and subsequently use t-SNE for visualization, we applied the default openTSNE configuration. Specifically, EOT 50D, PCA 50D, Harmony 50D, Scanorama 50D, scVI 50D, Seurat 50D, and LIGER 50D were embedded with perplexity 30, PCA initialization, 250 early-exaggeration iterations, and 500 post-exaggeration iterations.
Benchmarked methods. All competitors (EOT, Harmony, Scanorama, scVI, BC t-SNE, RC t-SNE, MultiMAP, Seurat, LIGER, and Ref t-SNE) used their default hyperparameters, except for the specified target dimensionalities (2 and 50) and random seed. Additionally, Seurat, LIGER, and Ref t-SNE required modifications to their standard input preprocessing to ensure consistent feature selection across methods, as detailed below.
Input formats. Different methods require different input representations. However, to minimize differences due to preprocessing and enable a more direct comparison of the integration methods, all methods used the same cells and the same set of 1 000 selected genes.
OT-tSNE, EOT, joint t-SNE, Harmony, and RC t-SNE received the batches in the 50-dimensional PCA representation computed from the log-normalized 1 000-gene features.
PCA, Scanorama, MultiMAP, and BC t-SNE received the log-normalized 1 000-gene representation, as these methods work directly in feature space.
scVI, Seurat, LIGER, and Ref t-SNE normally receive raw counts and perform additional preprocessing internally. To maintain the same feature set across methods, we provided raw counts restricted to the common 1 000-gene panel. For Seurat, LIGER, and Ref t-SNE, we therefore disabled their internal gene-selection procedures while retaining the remainder of their standard workflows.
Computational environment. All methods were run on the same computing cluster with Intel Xeon Gold 6240 processors, with four CPUs allocated per run and no GPU. Thread counts were set to four where supported. For some benchmarked methods, some stages (MultiMAP layout optimization, Scanorama’s exact neighbor search, and BC t-SNE optimization) used fewer cores due to parallelization limitations in the original implementations. We report median runtimes over three seeds per dataset. Timing covers the algorithm, excluding data loading, result writing, metric evaluation, and interpreter startup and imports. For 50-dimensional integrations, runtimes include the subsequent t-SNE visualization. Shared PCA preprocessing is excluded for methods receiving principal components, whereas dimensionality reduction performed internally by methods receiving gene expression is included.
Hyperparameters of the compared methods
We summarize selected hyperparameters governing affinity construction, batch correction, and representation learning in the compared methods (Tab. S2). These include neighborhood sizes, regularization strengths, representation dimensions, and model architecture. The table provides a descriptive overview rather than an exhaustive list or a measure of the tuning effort required by each method. We omit optimization and numerical settings, shared preprocessing, and hyperparameters of the subsequent t-SNE visualization of 50-dimensional integrations. We evaluated all methods without dataset-specific hyperparameter tuning.
kBET. k-nearest neighbor batch effect test [8 kBET] tests whether a cell’s neighborhood has the expected batch composition. We evaluate each cell type separately and retain types with at least 45 cells in each batch. For every retained cell, we find its 15 nearest neighbors within the same type, excluding the query cell, and count from which batches they are. The expected count for each batch is 15 times its proportion within that cell type. We compare the observed batch counts with the expected counts using a Pearson chi-square test with one degree of freedom, since our datasets contain two batches. We calculate the fraction of tests with within each type, then average these fractions equally across types. A higher score means fewer neighborhoods show a significant difference from the expected batch composition.
iLISI. Integration local inverse Simpson’s index [29 iLISI] measures the effective number of batches in a cell’s neighborhood. We use nearest neighbors in the joint embedding with a perplexity of 30. Let denote these neighbors, excluding cell , and let be the Euclidean distance between cells and . We compute neighbor weights and local batch proportions as
where is the batch of cell , and is adjusted to achieve the target perplexity. With batches, we compute
As in the original iLISI implementation, the weights use unsquared Euclidean distances.
Neighborhood purity. Neighborhood purity measures the fraction of neighbors that share a cell’s type. Let be the set of cells of type . We evaluate types with at least five cells, , using neighbors:
Here, is the type of cell . Neighbors are selected from the entire embedding, excluding the query cell. Cells from types with fewer than five cells remain candidate neighbors. We average first within each evaluated type and then across types, giving each type equal weight.
Silhouette score. The silhouette score measures cell-type separation [47]. For cell , let be its mean Euclidean distance to other cells of the same type. Let be the smallest of its mean Euclidean distances to each of the other types. We use scikit-learn to compute silhouette widths for all cells and rescale their mean to :
Each cell has equal weight, so larger cell types contribute more to the final score.
Ranking procedure
For each dataset and regularization setting, we first average every metric across random seeds. Higher values indicate better performance for all four scores. We min–max normalize each metric across methods,
Within each dataset, each method gets an overall score , defined as the average over all four normalized metrics. Then we rank the methods by within each dataset, with rank 1 denoting the best method. The final aggregate rank of a method is the mean of its dataset-level ranks (Tab. 1).
We also average the normalized metrics within the biological conservation and batch mixing groups to obtain scores and , respectively. For the top-3 finish ranking (Figure 1g), we rank the methods separately by and within each dataset, and we count how often each method attains a top-3 rank across the seven datasets and these two scores.
For and , we likewise averaged the within-dataset ranks across the seven datasets (Figure S4). These ranks summarize biological conservation and batch mixing separately. A method that excels at biological conservation may rank lower overall if it mixes batches poorly, and vice versa. A method that performs well on both objectives can therefore rank highly overall even with few top-three finishes in either category. For example, OT-tSNE (self OT) ranked second overall with a mean rank of 4.0 (Figure S4), yet its only category-specific top-three finish was for biological conservation on Mouse Atlas (Figure 1g).
Sensitivity analysis
Sensitivity to neighborhood size and entropic regularization
We evaluated OT-tSNE with random initialization on 25 combinations of neighborhood size and relative regularization for 3 random seeds across the seven real datasets. For each dataset, we averaged each metric across seeds and measured its change from the default setting . We then averaged these changes across datasets.
The overall score changed little near the default, although individual metrics showed a trade-off between batch mixing and biological conservation. At fixed , weaker regularization generally favored batch mixing, particularly iLISI, at the expense of biological conservation. At , increasing tended to improve biological conservation, with smaller average gains beyond (Figure S6). These trade-offs largely offset each other near the default setting.

Figure S6. Dataset-level changes when varying at (left) or at (right). From top to bottom, rows show the overall score (mean of all four metrics), biological conservation (mean of neighborhood purity and silhouette), and batch mixing (mean of iLISI and kBET). Changes are relative to the default setting and multiplied by 100. Colored lines show individual datasets and the black line shows their mean. Filled and open colored markers indicate whether a change met both thresholds defined in Figure S5.
Across the full grid, no alternative improved the mean overall score by even one point on the scale (Figure S5). We therefore retained the literature-based defaults , which provided a stable balance between batch mixing and biological conservation. Competing methods were likewise evaluated without dataset-specific hyperparameter tuning, using the configurations described in Appendix § 13.§ 3.

Figure S5. Sensitivity of OT-tSNE to neighborhood size and relative regularization . Values show the mean change from the boxed default setting across seven datasets, multiplied by 100. The overall score is the mean of the four metrics. Black labels indicate changes of at least 0.01 in absolute value on the original scale that also exceed twice their estimated standard error.
Sensitivity to initialization
We compared random, PCA, spectral, and EOT initialization for all five OT-tSNE variants on the seven real datasets. For each dataset and variant, we averaged each metric over three seeds and computed its difference from the random-initialization baseline. We then averaged these differences across datasets.
The pooled changes were small for all four metrics and all five variants (Figure S7). The largest absolute change was approximately 0.0065 in silhouette score for the self-OT variant. Some differences were larger on individual datasets (Figure S8).
Stability of the embedding across seeds. Because OT-tSNE is designed for visual exploration, we examined whether the same cell-type clusters appeared across runs and whether their relative positions were reproducible. We compared Lupus embeddings across three seeds. OT-tSNE constructs its affinity matrix deterministically, and given the same affinities and initial coordinates, the openTSNE optimizer is deterministic in the same computing environment. For this comparison, we disabled the Gaussian jitter normally added to the spectral, EOT, and PCA initializations. Each of these initializations then reproduced the same layout across all three seeds (Figure S9). With random initialization, the major clusters remained recognizable by their cell-type composition, although their relative positions varied across seeds.
Computational complexity
OT-tSNE
Let , be the batch sizes, the total number of cells, the input dimension, and . We analyze the dense transport plan and spectral within-batch construction used by default. Table S3 summarizes the costs before t-SNE optimization. Here, is the number of Sinkhorn iterations, the retained SVD rank, the oversampling parameter, the number of power iterations, and .
| Step | Time complexity | |
| Distances and median | ||
| Sinkhorn iterations | ||
| Full SVD | ||
| Randomized SVD | ||
| Full reconstruction | ||
| Truncated reconstruction | ||
| Sparsification |
Table S3. Time complexity of OT-tSNE affinity construction using full or randomized SVD. The last column gives the scaling for comparable batch sizes, holding , , , , , fixed in the truncated case. Full reconstruction uses all singular directions.
Transport and spectral construction. Each Sinkhorn iteration involves matrix–vector products with the dense cross-batch kernel [14]. The number of iterations depends on the data, regularization, and convergence tolerance; at our default regularization, convergence required only 11–21 iterations across the benchmarked datasets. For comparable batch sizes, both computing the full SVD of the transport plan and constructing the within-batch affinity matrices from all singular directions have cubic cost in . Randomized SVD computes an approximate decomposition using fewer singular directions [19]. Truncated SVD reduces affinity construction to quadratic cost for fixed approximation rank and other parameters.
Sparsification and optimization. We retain the largest affinities in each block using top- selection, which costs for fixed . Symmetrizing the selected edges leaves nonzero affinities. The attractive forces therefore cost per t-SNE iteration. We use the default automatic selection in openTSNE, which evaluates repulsive forces using Barnes–Hut for and FFT interpolation for larger datasets [46]. Barnes–Hut approximates the repulsive forces with a typical cost of per iteration [52]. FFT interpolation has linear dependence on when the interpolation grid and order are fixed [34]. These per-iteration costs are multiplied by the number of optimization iterations.
Memory and practical runtime. Affinity construction requires memory because it stores dense cross-batch costs and transport weights, as well as dense within-batch affinities. Truncated SVD reduces the storage needed for singular vectors, but these dense matrices remain. After sparsification, the graph requires storage. Barnes–Hut t-SNE has linear memory requirements for fixed neighborhood size [52]. FFT interpolation additionally stores the interpolation grid and associated working arrays [34].
Figure S13 compares full SVD with randomized SVD truncated to 200 components. This approximation reduced total runtime by up to a factor of five, while seed-averaged metric scores changed by at most 0.012 in absolute value across the benchmarked datasets. The other OT-tSNE variants avoid SVD and were also faster than the full-SVD OT-tSNE (Figure S13).
Benchmarked methods
Table S4 broadly summarizes the main computational steps of the compared methods, published scaling results, and operation counts for the benchmarked implementations. Since this summary concerns specific steps or experimental settings, Figure S13 compares measured runtimes under our benchmark settings.
| Method | Main computation | Cost and assumptions |
| MultiMAP | Find neighbors within and across datasets. | The published estimate relies on empirical scaling of approximate neighbor search [24]. |
| MultiMAP | Optimize a UMAP-based objective on the MultiMAP graph using negative sampling. | per epoch for a fixed number of negative samples per edge [24]. |
| RC t-SNE | Optimize the embedding using FFT-accelerated t-SNE. | Combining sparse attraction and FFT repulsion gives per iteration for fixed interpolation order. This excludes affinity construction [21, 34]. |
| Ref t-SNE | Build and optimize a reference embedding. | Uses accelerated t-SNE, with the optimization costs described above [45, 46]. |
| Ref t-SNE | Place query cells into the fixed reference embedding. | per iteration for query cells with fixed neighborhood size and FFT interpolation grid. This excludes query neighbor search [45, 46]. |
| BC t-SNE | Compute a batch-corrected projection, then apply t-SNE. | The projection cost is described as comparable to PCA [1]. The benchmarked implementation evaluates the exact t-SNE gradient on a single thread, costing per iteration. |
| Seurat | Compute CCA, find anchors, and correct the data. | In the benchmarked implementation (Seurat 5.5.1), this matrix requires memory. |
| LIGER | Jointly factorize the datasets, then align the factors by quantile normalization. | Factorization time was empirically linear in at fixed gene count and rank. The reported scaling concerns factorization, not the subsequent alignment [35]. |
| Scanorama | Reduce dimensionality using randomized SVD. | for genes when the retained rank, oversampling, and number of power iterations are fixed [22, 19]. |
| Scanorama | Find cross-batch neighbors and identify matching cells. | The published approach accelerates neighbor search using locality-sensitive hashing [22]. |
| Scanorama | Correct the data using matched cell pairs. | per merge for corrected dimensions, and matched pairs [22]. |
| scVI | Train a variational autoencoder using minibatches. | For fixed network architecture and gene count, the cost is per epoch [36]. |
| Harmony | Alternate between clustering and batch correction. | Runtime depends on the number of clusters and optimization iterations [29]. |
| EOT | Compute cross-batch distances and the transport plan. | for distance computation and Sinkhorn iterations, as in OT-t-SNE [14, 31]. |
| EOT | Compute the leading singular vectors. |
Table S4. Main computational steps of the benchmarked methods with costs. denotes the number of cells, the neighborhood size, and the number of interpolation-grid points. The notation follows the preceding subsection.
Additional figures
References
- [1]Emanuele Aliverti, Jeffrey L Tilson, Dayne L Filer, Benjamin Babcock, Alejandro Colaneri, Jennifer Ocasio, Timothy R Gershon, Kirk C Wilhelmsen, and David B Dunson. Projected t-SNE for batch correction. Bioinformatics, 36(11):3522–3527, 2020.DOI
- [2]Jason Altschuler, Francis Bach, Alessandro Rudi, and Jonathan Niles-Weed. Massively scalable Sinkhorn distances via the Nyström method. In Advances in Neural Information Processing Systems, volume 32, 2019.
- [3]Seth A Ament, Rianne R Campbell, Mary Kay Lobo, Joseph P Receveur, Kriti Agrawal, Alejandra Borjabad, Siddappa N Byrareddy, Linda Chang, Declan Clarke, Prashant Emani, et al. The single-cell opioid responses in the context of HIV (SCORCH) consortium. Molecular Psychiatry, 29(12):3950–3961, 2024.
- [4]Aleksandr Artemenkov and Maxim Panov. NCVis: noise contrastive approach for scalable visualization. In Proceedings of The Web Conference 2020, pages 2941–2947, 2020.
- [5]Nikolas Barkas, Viktor Petukhov, Daria Nikolaeva, Yaroslav Lozinsky, Samuel Demharter, Konstantin Khodosevich, and Peter V Kharchenko. Joint analysis of heterogeneous single-cell RNA-seq dataset collections. Nature Methods, 16(8):695–698, 2019.
- [6]Mikhail Belkin and Partha Niyogi. Laplacian Eigenmaps for dimensionality reduction and data representation. Neural Computation, 15(6):1373–1396, 2003.
- [7]Jan Niklas Böhm, Philipp Berens, and Dmitry Kobak. Attraction–repulsion spectrum in neighbor embeddings. Journal of Machine Learning Research, 23(95):1–32, 2022.
- [8]Maren Büttner, Zhichao Miao, F Alexander Wolf, Sarah A Teichmann, and Fabian J Theis. A test metric for assessing single-cell RNA-seq batch correction. Nature Methods, 16(1):43–49, 2019. doi: 10.1038/s41592-018-0254-1. URL https://doi.org/10.1038/s41592-018-0254-1.
- [9]Colin G Cess and Laleh Haghverdi. Compound-SNE: comparative alignment of t-SNEs for multiple single-cell omics data visualization. Bioinformatics, 40(7), 2024. doi: 10.1093/bioinformatics/btae471.
- [10]Tara Chari and Lior Pachter. The specious art of single-cell genomics. PLOS Computational Biology, 19(8):e1011288, 2023. doi: 10.1371/journal.pcbi.1011288.DOI
- [11]Lenaic Chizat, Gabriel Peyré, Bernhard Schmitzer, and François-Xavier Vialard. Scaling algorithms for unbalanced optimal transport problems. Mathematics of Computation, 87(314):2563–2609, 2018.DOI
- [12]Ronald R Coifman and Stéphane Lafon. Diffusion maps. Applied and Computational Harmonic Analysis, 21(1):5–30, 2006.DOI
- [13]Nicolas Courty, Rémi Flamary, Devis Tuia, and Alain Rakotomamonjy. Optimal transport for domain adaptation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(9):1853–1865, 2016.DOI
- [14]Marco Cuturi. Sinkhorn Distances: Lightspeed Computation of Optimal Transport. In Advances in Neural Information Processing Systems, volume 26, pages 2292–2300, 2013.
- [15]Sebastian Damrich, Niklas Böhm, Fred A Hamprecht, and Dmitry Kobak. From t-SNE to UMAP with contrastive learning. In The Eleventh International Conference on Learning Representations, 2023.arxiv.org/abs/2206.01816
- [16]Cyril de Bodt, Alex Diaz-Papkovich, Michael Bleher, Kerstin Bunte, Corinna Coupette, Sebastian Damrich, Enrique Fita Sanmartin, Fred A Hamprecht, Emőke-Ágnes Horvát, Dhruv Kohli, et al. Low-dimensional embeddings of high-dimensional data. arXiv preprint arXiv:2508.15929, 2025.arxiv.org/abs/2508.15929
- [17]Pinar Demetci, Rebecca Santorella, Björn Sandstede, William S. Noble, and Ritambhara Singh. SCOT: Single-cell multi-omics alignment with optimal transport. Journal of Computational Biology, 29(1):3–18, 2022. doi: 10.1089/cmb.2021.0446.DOI
- [19]Nathan Halko, Per-Gunnar Martinsson, and Joel A. Tropp. Finding structure with randomness: Probabilistic algorithms for constructing approximate matrix decompositions. SIAM Review, 53 (2):217–288, 2011. doi: 10.1137/090771806.DOI
- [20]Xiaoping Han, Renying Wang, Yincong Zhou, Lijiang Fei, Huiyu Sun, Shujing Lai, Assieh Saadatpour, Ziming Zhou, Haide Chen, Fang Ye, et al. Mapping the mouse cell atlas by microwell-seq. Cell, 172(5):1091–1107, 2018.
- [21]Edith Heiter, Bo Kang, Ruth Seurinck, and Jefrey Lijffijt. Revised conditional t-SNE: Looking beyond the nearest neighbors. In Advances in Intelligent Data Analysis XXI, pages 169–181. Springer Nature Switzerland, 2023.DOI
- [22]Brian Hie, Bryan Bryson, and Bonnie Berger. Efficient integration of heterogeneous single-cell transcriptomes using Scanorama. Nature Biotechnology, 37(6):685–691, 2019.DOI
- [23]Aissa Houdjedj, Yacine Marouf, Mekan Myradov, Süleyman Onur Doğan, Burak Onur Erten, Oznur Tастan, Cesim Erten, and Hilal Kazan. SCITUNA: single-cell data integration tool using network alignment. BMC Bioinformatics, 26(1):92, 2025.DOI
- [24]Mika Sarkin Jain, Krzysztof Polanski, Cecilia Dominguez Conde, Xi Chen, Jongeun Park, Lira Mamanova, Andrew Knights, Rachel A Botting, Emily Stephenson, Muzlifah Haniffa, et al. MultiMAP: dimensionality reduction and integration of multimodal data. Genome Biology, 22(1):346, 2021.
- [25]Chenghan Jiang, Ren Zheng, Yongle Ji, Shubin Cao, Yanhua Fang, Zhe Wang, Ruoyu Wang, Shanshan Liang, and Shuai Tao. Geometric-aware and interpretable deep learning for single-cell batch correction via explicit disentanglement and optimal transport. bioRxiv, 2026. doi: 10.64898/2026.02.17.706490.DOI
- [26]Bo Kang, Dario Garcia Garcia, Jefrey Lijffijt, Raúl Santos-Rodríguez, and Tijl De Bie. Conditional t-SNE: More informative t-SNE embeddings. Machine Learning, 110(10):2905–2940, 2021. doi: 10.1007/s10994-020-05917-0.DOI
- [27]Hyun Min Kang, Meena Subramaniam, Sasha Targ, Michelle Nguyen, Lenka Maliskova, Elizabeth McCarthy, Eunice Wan, Simon Wong, Lauren Byrnes, Cristina M Lanata, et al. Multiplexed droplet single-cell RNA-sequencing using natural genetic variation. Nature Biotechnology, 36(1):89–94, 2018.DOI
- [28]Dmitry Kobak and Philipp Berens. The art of using t-SNE for single-cell transcriptomics. Nature Communications, 10(1):5416, 2019.DOI
- [29]Ilya Korsunsky, Nghia Millard, Jean Fan, Kamil Slowikowski, Fan Zhang, Kevin Wei, Yuriy Baglaenko, Michael Brenner, Po-ru Loh, and Soumya Raychaudhuri. Fast, sensitive and accurate integration of single-cell data with Harmony. Nature Methods, 16(12):1289–1296, 2019.DOI
- [30]Max Kuang and Esteban G Tabak. Preconditioning of optimal transport. SIAM Journal on Scientific Computing, 39(4):A1793–A1810, 2017.DOI
- [31]Boris Landa, Yuval Kluger, and Rong Ma. Entropic optimal transport eigenmaps for nonlinear alignment and joint embedding of high-dimensional datasets. SIAM Journal on Mathematics of Data Science, 8(4):1091–1119, 2026. doi: 10.1137/24M171381.arxiv.org/abs/2407.01718
- [32]Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998. doi: 10.1109/5.726791.
- [33]Keyi Li, Yuval Kluger, and Boris Landa. Density-reweighted entropic optimal transport: Decoupling geometry from sampling density. arXiv preprint arXiv:2608.16506, 2026. doi: 10.48550/arXiv.2608.16506. URL https://arxiv.org/abs/2608.16506.
- [34]George C Linderman, Manas Rachh, Jeremy G Hoskins, Stefan Steinerberger, and Yuval Kluger. Fast interpolation-based t-SNE for improved visualization of single-cell RNA-seq data. Nature Methods, 16(3):243–245, 2019.DOI
- [35]Jialin Liu, Chao Gao, Joshua Sodicoff, Velina Kozareva, Evan Z. Macosko, and Joshua D. Welch. Jointly defining cell types from multiple single-cell datasets using LIGER. Nature Protocols, 15(11):3632–3662, 2020. doi: 10.1038/s41596-020-0391-8.DOI
- [36]Romain Lopez, Jeffrey Regier, Michael B Cole, Michael I Jordan, and Nir Yosef. Deep generative modeling for single-cell transcriptomics. Nature Methods, 15(12):1053–1058, 2018.DOI
- [37]Malte D Luecken, Maren Büttner, Kridsadakorn Chichoompu, Anna Danese, Marta Interlandi, Michaela F Müller, Daniel C Strobl, Luke Zappia, Martin Dugas, Maria Colomé-Tatché, et al. Benchmarking atlas-level data integration in single-cell genomics. Nature Methods, 19(1):41–50, 2022.DOI
- [38]Aaron Lun. A description of the theory behind the fastMNN algorithm. https://marionilab.github.io/FurtherMNN2018/theory/description.html, 2019.
- [39]Lena Maier-Hein, Matthias Eisenmann, Annika Reinke, Sinan Onogur, Marko Stankovic, Patrick Scholz, Tal Arbel, Hrvoje Bogunovic, Andrew P. Bradley, Aaron Carass, et al. Why rankings of biomedical image analysis competitions should be interpreted with care. Nature Communications, 9(1):5217, 2018. doi: 10.1038/s41467-018-07619-7.
- [40]Leland McInnes, John Healy, and James Melville. UMAP: Uniform manifold approximation and projection for dimension reduction. arXiv preprint arXiv:1802.03426, 2018.arxiv.org/abs/1802.03426
- [41]Sonia Nestorowa, Fiona K Hamey, Blanca Pijuan Sala, Evangelia Diamanti, Mairi Shepherd, Elisa Laurenti, Nicola K Wilson, David G Kent, and Berthold Göttgens. A single-cell resolution map of mouse hematopoietic stem and progenitor cell differentiation. Blood, 128(8):e20–e31, 2016.DOI
- [42]Franziska Paul, Ya’ara Arkin, Amir Giladi, Diego Adhemar Jaitin, Ephraim Kenigsberg, Hadas Keren-Shaul, Deborah Winter, David Lara-Astiaso, Meital Gury, Assaf Weiner, et al. Transcriptional heterogeneity and lineage commitment in myeloid progenitors. Cell, 163(7):1663–1677, 2015.
- [43]Gabriel Peyré and Marco Cuturi. Computational optimal transport with applications to data sciences. Foundations and Trends® in Machine Learning, 11(5-6):355–607, 2019.DOI
- [44]Krzysztof Polański, Matthew D Young, Zichao Miao, Kerstin B Meyer, Sarah A Teichmann, and Jong-Eun Park. BBKNN: fast batch alignment of single cell transcriptomes. Bioinformatics, 36(3):964–965, 2020.DOI
- [45]Pavlin G Poličar, Martin Stražar, and Blaž Zupan. Embedding to reference t-SNE space addresses batch effects in single-cell classification. Machine Learning, 112(2):721–740, 2023. doi: 10.1007/s10994-021-06043-1.
- [46]Pavlin G Poličar, Martin Stražar, and Blaž Zupan. openTSNE: a modular Python library for t-SNE dimensionality reduction and embedding. Journal of Statistical Software, 109:1–30, 2024.DOI
- [47]Peter J Rousseeuw. Silhouettes: a graphical aid to the interpretation and validation of cluster analysis. Journal of Computational and Applied Mathematics, 20:53–65, 1987.DOI
- [48]Tim Stuart, Andrew Butler, Paul Hoffman, Christoph Hafemeister, Efthymia Papalexi, William M Mauck, Yuhan Hao, Marlon Stoeckius, Peter Smibert, and Rahul Satija. Comprehensive integration of single-cell data. Cell, 177(7):1888–1902, 2019.DOI
- [49]Tabula Muris Consortium. Single-cell transcriptomics of 20 mouse organs creates a Tabula Muris. Nature, 562(7727):367–372, 2018.DOI
- [50]Hoa Thi Nhu Tran, Kok Siong Ang, Marion Chevrier, Xiaomeng Zhang, Nicole Yee Shin Lee, Michelle Goh, and Jinmiao Chen. A benchmark of batch-effect correction methods for single-cell RNA sequencing data. Genome Biology, 21(1):12, 2020.
- [51]Hugues Van Assel, Titouan Vayer, Rémi Flamary, and Nicolas Courty. SNEkhorn: Dimension reduction with symmetric entropic affinities. In Advances in Neural Information Processing Systems, volume 37, 2023.arxiv.org/abs/2305.13797
- [52]Laurens van der Maaten. Accelerating t-SNE using tree-based algorithms. Journal of Machine Learning Research, 15(93):3221–3245, 2014.
- [53]Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-SNE. Journal of Machine Learning Research, 9(Nov):2579–2605, 2008.
- [54]Joshua D Welch, Velina Kozareva, Ashley Ferreira, Charles Vanderburg, Carly Martin, and Evan Z Macosko. Single-cell multi-omic integration compares and contrasts features of brain cell identity. Cell, 177(7):1873–1887, 2019.DOI
- [55]Yongjie Xu, Zelin Zang, Jun Xia, Cheng Tan, Yulan Geng, and Stan Z. Li. Structure-preserving visualization for single-cell RNA-Seq profiles using deep manifold transformation with batch-correction. Communications Biology, 6:369, 2023. doi: 10.1038/s42003-023-04662-z.DOI
- [56]Zizhen Yao, Cindy TJ Van Velthoven, Thuc Nghi Nguyen, Jeff Goldy, Adriana E Sedeno-Cortes, Fahimeh Baftizadeh, Darren Bertagnolli, Tamara Casper, Megan Chiang, Kirsten Crichton, et al. A taxonomy of transcriptomic cell types across the isocortex and hippocampal formation. Cell, 184(12):3222–3241, 2021.DOI
- [57]Haihui Zhang and Peiwu Qin. Accurate, scalable, and unified single-cell atlas integration with scBIOT. bioRxiv, 2026. doi: 10.64898/2026.01.02.697395. Version 1.
- [58]Grace XY Zheng, Jessica M Terry, Philip Belgrader, Paul Ryvkin, Zachary W Bent, Ryan Wilson, Solongo B Ziraldo, Tobias D Wheeler, Geoff P McDermott, Junjie Zhu, et al. Massively parallel digital transcriptional profiling of single cells. Nature Communications, 8(1):14049, 2017.DOI
- [59]Linnan Zhu, Penghui Yang, Yingze Zhao, Zhenkun Zhuang, Zhifeng Wang, Rui Song, Jie Zhang, Chuanyu Liu, Qianqian Gao, Qumiao Xu, et al. Single-cell sequencing of peripheral mononuclear cells reveals distinct immune response landscapes of COVID-19 and influenza patients. Immunity, 53(3):685–696, 2020.DOI









