What is t-SNE? A Practical Guide for Bioinformatics and Precision Medicine
10 min read · Updated June 2026
Key Takeaways
- t-SNE is a non-linear dimensionality reduction algorithm that excels at revealing local cluster structure in high-dimensional data - particularly single-cell transcriptomics, DNA methylation, and proteomics
- Unlike PCA, t-SNE preserves local relationships over global structure, making it ideal for exploratory analysis but not for downstream model training on unseen data
- UMAP has emerged as a popular alternative - faster and better at preserving global structure, but t-SNE often produces cleaner local cluster separation and is still widely used in bioinformatics
Jump to section
What is t-SNE?
T-distributed Stochastic Neighbourhood Embedding (t-SNE) is an unsupervised machine learning algorithm developed in 2008 by Laurens van der Maaten and Geoffrey Hinton. It has become widely used in bioinformatics and more generally in data science to visualize the structure of high dimensional data in 2 or 3 dimensions. It is the best known of a group of algorithms called Manifold Learning which are used for non-linear dimensionality reduction. It is sometimes contrasted with Principal Component Analysis (PCA) and, more recently, with UMAP.
The technique is particularly well suited to the complex, high-dimensional data found across precision medicine data modalities - from single-cell transcriptomics to DNA methylation profiles and proteomics datasets where thousands of features must be collapsed into an interpretable visual structure.
What Data Can I Use It For?
t-SNE is incredibly versatile. A Google tech talk demonstrated excellent results on the MNIST handwritten digit dataset, complex images in CIFAR-10, audio of speech, and word clusters generated from natural language processing. The technique has since been used to visualize structure in a range of bioinformatics data sources, including Single-Cell Transcriptomics [1], RNA/DNA-Sequencing [2], DNA methylation [3], and Proteomics [4].
t-SNE can be used to give visual feedback on whether there is a sufficient signal in the features available to train an ML model before embarking on the training cycle. This can be seen in our AI biomarker discovery workflow, where it was used to determine whether bladder cancer patients were distinguishable from a control group prior to training with XGBoost.
t-SNE can also be used with imaging data, working best when features are extracted with Convolutional Neural Networks such as ResNet. This allows images to be clustered based on their similarity - as seen in our case study on grouping compounds with a similar mechanism of action for high content screening.
In the context of AI-powered single-cell analysis, t-SNE is frequently used alongside tools like Scanpy and Seurat to visualize cell populations and identify meaningful clusters prior to downstream annotation and biomarker analysis.
Curse of Dimensionality
A phenomenon well known within the data science community is the so-called Curse of Dimensionality. Dimensionality here refers to the number of features for a given observation. This particularly pertains to bioinformatics data where features (e.g. variants in a VCF file, methylation scores in a DNA methylation profile) can number in the hundreds of thousands whilst the observations typically number in the tens or hundreds.
Visualizing this data is near impossible. Furthermore, training machine learning models on high-dimensional data is prone to overfitting - the model performs well on the training data but does not generalize well to new data.
Dimensionality Reduction Techniques
Dimensionality reduction techniques reduce the effects of the Curse of Dimensionality. There are several ways to reduce a dataset's dimensionality, including Isomap, Multi-Dimensional Scaling (MDS), Locally Linear Embedding, Spectral Embedding, and t-SNE, which is the focus of this article.
These algorithms belong to an overarching class of algorithms known as Manifold Learning, predominantly stochastic - meaning the same algorithm and data will result in different embeddings given different initialisations.
Matrix decomposition is another group of dimensionality reduction algorithms with PCA being the best known. These are deterministic - they produce the same result given the same data, have few parameters to tune, and often process in much shorter time. Another useful clustering technique in this context is K-Means clustering, which helps identify and group similar data points based on feature similarity.
How Does t-SNE Work?
t-SNE allows the visualization of the underlying local structure of high-dimensional data in 2 or 3 dimensions, allowing results to be plotted in a simple scatter plot. It builds upon SNE, which was introduced in 2002. The 't' prefix was introduced to distinguish the algorithm using the T-distribution as opposed to the Gaussian distribution to compute the similarity between points in the low-dimensional space.
The T-distribution has longer tails than the Gaussian distribution, which alleviates the 'crowding problem' present in the original algorithm - where the euclidean distance between clusters is large compared to the distance between intra-cluster points, resulting in lost distinguishing detail.
t-SNE optimizes over a set number of iterations, using gradient descent with Kullback-Leibler divergence as the cost function. The algorithm is stochastic, so multiple executions with different random seeds will yield different results. It is acceptable to run the algorithm several times and pick the embedding with the lowest KL divergence.
The K-L divergence is defined as:
Where pij and qij are the pairwise probabilities in the high dimensional space and low dimensional space respectively. The cost function is proportional to the pairwise probability in the high dimensional space, meaning points that are relatively distant have a much lower impact - which is why t-SNE is more accurate at resolving local structure.
Example: Breast Cancer Wisconsin (Diagnostic) Data Set [5] - features computed from cell nuclei in images from fine needle aspirates of breast masses. The embedding shows significant differences between benign (blue) and malignant masses (orange), with PCA used prior to t-SNE embedding.
Parameters
To get the best out of t-SNE there are a number of tuneable hyperparameters, the optimum values of which are data-dependent. Understanding these at a high level will help you make informed choices when experimenting with values.
Perplexity
Arguably the most significant hyperparameter, this roughly translates to the number of nearest neighbors in other manifold techniques and effectively changes the width of the Gaussian for calculating pairwise probabilities. Higher perplexities increase the weighting of more distant data in the calculated embedding. Consider the number of clusters expected and the number of observations when setting this value. The original paper suggests a perplexity between 5 and 50.
Initialisation
Earlier implementations used random initialisation, which contributed to inconsistent results across runs. Current best practice - and the default in scikit-learn 1.2 and later - is to use PCA-based initialisation. This produces significantly more consistent, reproducible embeddings and typically converges faster. If you are using an older implementation and getting unstable results, switching to PCA initialisation is the first thing to try.
Iterations
Generally a high number of iterations will allow the algorithm to converge on an embedding with a lower loss. As with all ML algorithms, there are diminishing returns on extra iterations.
Method
An exact implementation of the original algorithm is possible but can take orders of magnitude more time to complete with larger datasets. The Barnes-Hut approximation speeds computation immensely and should be used in the vast majority of cases.
Learning Rate
A scalar that affects the scale of the updates to the embedded values in each iteration. A higher learning rate will generally converge to a solution faster - too high however and the embedding may not converge, manifesting as a ball of equidistant points.
Interpreting t-SNE Results
The embeddings produced by t-SNE are useful for exploratory data analysis and as an indication of whether there is a sufficient signal in the features of a dataset for supervised methods to make successful predictions. Because it is non-linear, it may show class separation when linear models fail to make accurate predictions - in which case, non-linear supervised models should be considered as an alternative.
The embeddings produced by t-SNE can be used for downstream analysis and model training but should be used with caution: for additional data cannot easily be added to an embedding without recalculating. If using a train/test split to evaluate a model, it is not possible to 'calculate' the embeddings of the test data. Another useful interpretation approach is to identify outliers in the embedding and analyze those points to identify potential causes.
Important interpretation note
Recent research (2024-2025) has demonstrated that t-SNE can artificially tighten clusters, making groups appear more distinct than they truly are in the original high-dimensional space. This is a known limitation - t-SNE embeddings should always be treated as exploratory visualizations rather than definitive evidence of cluster separation. Confirm findings with additional statistical methods before drawing biological conclusions.
Translational Analytics
See how dimensionality reduction techniques like t-SNE are applied in Sonrai's translational analytics workflows to identify meaningful signal in complex biomedical datasets.
t-SNE vs UMAP - Which Should You Use?
Since its publication in 2018, Uniform Manifold Approximation and Projection (UMAP) has become a popular alternative to t-SNE, and is now the default dimensionality reduction method in tools like Scanpy and Seurat for single-cell analysis. Understanding the tradeoffs between the two is important for choosing the right approach for your data.
| t-SNE | UMAP | |
|---|---|---|
| Speed | Slower, especially at scale | Significantly faster (up to 10x on large datasets) |
| Local structure | Excellent - tight, well-separated clusters | Good |
| Global structure | Poor - inter-cluster distances not meaningful | Better preserved |
| Reproducibility | Stochastic - varies between runs (improved with PCA initialisation) | Also stochastic but generally more stable |
| New data | Cannot project new data without recalculating | Supports projection of new data |
| Cluster exaggeration | More pronounced - clusters can appear artificially tight | Also present but less extreme |
| Best for | Exploratory analysis, publication-quality cluster visualisation | Large datasets, trajectory analysis, when global relationships matter |
In practice, for patient stratification workflows where the goal is identifying distinct biological subgroups, t-SNE often produces cleaner visual separation. For larger datasets or when trajectory analysis is needed (e.g. developmental lineages in single-cell data), UMAP is generally preferred. Many analysts run both and compare. A 2024 paper in PLoS Computational Biology confirmed that both t-SNE and UMAP preserve biologically relevant neighbourhood structure in single-cell data, settling an earlier debate about whether 2D embeddings are meaningful at all.
Comparison With PCA
| t-SNE | PCA | |
|---|---|---|
| Method | Stochastic | Deterministic |
| Global structure preserved | Focuses on local structure | Yes |
| Application to new data | Not possible with the original algorithm | Yes |
| Incomplete data | Not possible - missing data should first be imputed | Not possible, however probabilistic PCA supports missing data |
| Speed | Relatively slow | Relatively fast |
| Non-linear structure | Yes | No |
Summary
t-SNE is an extremely versatile and robust method of visualizing high dimensional data. It is particularly useful for data with a non-linear relationship between observed features and the target class that are poorly represented in other dimensionality reduction techniques. PCA should be considered before t-SNE where the new reduced features feed into an ML pipeline, as PCA can be readily applied to unseen data.
For single-cell analysis workflows, both t-SNE and UMAP remain widely used in 2026 - the choice between them depends on dataset size, whether global structure matters, and whether the embedding needs to be applied to new data. When in doubt, running both and comparing is a reasonable approach. Whatever method is used, results should always be treated as exploratory and validated with additional statistical methods.
References
- The art of using t-SNE for single-cell transcriptomics - Dmitry Kobak & Philip Berens, Nature Communications 10, 5416 (2019)
- Visualizing Single-Cell RNA-Seq Data with t-SNE - National Cancer Institute, September 2020
- Machine learning analysis of DNA methylation profiles distinguishes primary lung squamous cell carcinomas from head and neck metastases - Jurmeister et al., Science Translational Medicine, 2019
- Advanced Cell Mapping Visualizations for Single Cell Functional Proteomics Enabling Patient Stratification - Bowman et al., Proteomics, 2020
- Wisconsin Breast Cancer Diagnostics Set - Dua, D. and Graff, C. (2019). UCI Machine Learning Repository.
- The art of seeing the elephant in the room: 2D embeddings of single-cell data do make sense - Lause, Berens, Kobak, PLoS Computational Biology, 2024
No cost. No risk.
Want to see t-SNE applied to your own data?
Challenge Sonrai to find what others haven't. We'll apply dimensionality reduction and clustering to your dataset - at no cost.
Explore the free showcaseRelated Reading
Article
K-Means Clustering in Precision Medicine
Use Case
AI-Powered Single-Cell Analysis
Article
What is XGBoost?
Talk to our team
Sonrai acts as an extension of your team, combining scientific expertise, transparent and reproducible analysis, and a governed research environment to generate decision-ready evidence that can be revisited, reproduced, and built upon throughout the life of a programme.
Book a demo


