π€ Raw model output β unedited transcript. What this label means.
What's in here: the applied side of optimal transport, for single-cell data. Core practical rule: never compute Wasserstein distances in UMAP/t-SNE space β use PCA or k-NN graph geodesics, which are consistent across visualizations. Then a velocity-aware cost function that folds RNA velocity into the transport metric, so you measure "how far apart and moving the right way." Theory twin: optimal transport.
YES! This is actually a perfect use case for Wasserstein, and it solves a major problem in single-cell analysis!
The problem you're highlighting:
UMAP and t-SNE are non-linear projections that distort distances:
The Wasserstein solution:
Don't compute Wasserstein in the visualization space! Instead:
# Cell type A and B as distributions in gene expression space
# Each cell is a point in ~20,000 dimensional gene space
cell_type_A = adata[adata.obs['cell_type'] == 'A'].X # n_cells Γ n_genes
cell_type_B = adata[adata.obs['cell_type'] == 'B'].X
# Wasserstein distance in original space
W_dist = ot.wasserstein_distance(cell_type_A, cell_type_B)
Pros: True biological distance, invariant to visualization Cons: Curse of dimensionality, noisy genes matter
# PCA preserves global structure linearly
pca_embeddings = adata.obsm['X_pca'] # e.g., 50 dimensions
A_pca = pca_embeddings[adata.obs['cell_type'] == 'A']
B_pca = pca_embeddings[adata.obs['cell_type'] == 'B']
W_dist = ot.wasserstein_distance(A_pca, B_pca)
Pros: Denoised, consistent across visualizations, computationally tractable Cons: Linear assumption
This is really clever: