PaCMAP (Pairwise Controlled Manifold Approximation) is a dimensionality reduction method designed to produce visualizations that faithfully preserve both local and global structure. It constructs three types of point pairs — neighbor pairs, mid-near pairs, and further pairs — and optimizes a low-dimensional embedding by balancing attractive and repulsive forces among them.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/satijalab/seurat-wrappers/llms.txt
Use this file to discover all available pages before exploring further.
References
Wang, Y., Huang, H., Rudin, C., & Shaposhnik, Y. (2021). Understanding how dimension reduction tools work: an empirical approach to deciphering t-SNE, UMAP, TriMAP, and PaCMAP for data visualization. Journal of Machine Learning Research, 22(201), 1–73. https://doi.org/10.48550/arXiv.2012.04456 Huang, H., Wang, Y., Rudin, C., & Browne, E. P. (2022). Towards a comprehensive evaluation of dimension reduction methods for transcriptomic data visualization. Communications Biology. https://doi.org/10.1038/s42003-022-03628-x Source: YingfanWang/PaCMAPInstallation
PaCMAP is implemented in Python and called from R viareticulate. You must set up a Python environment with the pacmap package before using RunPaCMAP().
Key function
RunPaCMAP() — Runs PaCMAP on a Seurat object and stores the embedding as a DimReduc object. Input can be either a set of features (expression values) or existing reduction dimensions (e.g., PCA components).
Example
Run PaCMAP from variable features
Run PaCMAP from existing PCA dimensions
You can also pass specific PCA dimensions instead of raw features:Visualize gene expression on the PaCMAP embedding
Parameters
A Seurat object to run PaCMAP on.
Name of the dimensional reduction to use as input when
dims is specified.Dimensions of the specified
reduction to use as input. Specify either dims or features, not both.Features (genes) to use as input. Specify either
features or dims, not both.Assay to pull feature data from when
features is specified. Defaults to the default assay.Layer within the assay to use when
features is specified.Number of PaCMAP components to compute.
Number of neighbors in the k-nearest neighbor graph. Defaults to 10 for datasets with fewer than 10,000 cells; for larger datasets defaults to
10 + 15 * (log10(n) - 4).Ratio of mid-near pairs to neighbor pairs. Controls the balance between local and global structure preservation.
Ratio of further pairs to neighbor pairs. Controls the repulsive force in the embedding.
Distance metric for constructing the k-nearest neighbor graph.
Learning rate for the AdaGrad optimizer.
Number of optimization iterations.
Whether to apply PCA to the input data before constructing the k-nearest neighbor graph. Recommended — greatly accelerates the process with minimal accuracy loss. Does not affect embedding initialization.
Initialization method for the low-dimensional embedding. One of
"pca" or "random".Name under which the resulting
DimReduc object is stored in the Seurat object.Prefix for the column names of the PaCMAP embedding dimensions.
Random seed for reproducibility.