GOTVis
Grassmann / Optimal-Transport embeddings for single-cell data.
GOTVis is the visualisation companion to
GOTClust. It turns the objects
produced by Grassmann-optimal-transport clustering — above all the
Sinkhorn transport plan gamma returned by GSSC — into 2-D / 3-D
coordinates suitable for plotting, downstream QC and publication figures.
Why a separate package?
GOTClust ships a single functional-proximity embedding
(grassmann_functional_embedding). That embedding is cell-centric: it
preserves Grassmann cost C and says nothing about cluster membership.
GSSC (Grassmann Sinkhorn Spectral Clustering) introduces a prototype
membership matrix gamma, which carries a completely different kind of
geometry — simplex geometry over prototypes. Rather than overload
GOTClust's embedding namespace, GOTVis owns that geometry and keeps the
dependency surface tiny.
Install
pip install gotvis # core: numpy + scipy only
pip install "gotvis[all]" # + anndata, sklearn, plotting, grassmann-ot
pip install "gotvis[tsne]" # + scikit-learn TSNE backend
pip install "gotvis[opentsne]" # + openTSNE backend
What's inside
| Embedding | Input | Geometry | Cost |
|---|---|---|---|
sinkhorn_embedding(method="svd") |
gamma | truncated SVD of centred gamma — one axis per membership direction | O(n m²) |
sinkhorn_embedding(method="barycentric") |
gamma | Aitchison ilr / clr on the (m−1)-simplex | O(n m) |
sinkhorn_embedding(method="spectral") |
gamma | Laplacian eigenmaps on ΓΓᵀ / Jensen-Shannon affinity | O(n² m) |
gammagram_embedding() |
gamma | MDS / t-SNE on ‖gᵢ−gⱼ‖ | O(n²) |
functional_embedding() |
H / U_list / C | Laplacian Eigenmaps or classical MDS on Grassmann cost | O(n²) |
mds_embedding() / tsne_embedding() |
any distance | generic fallback | O(n³)/O(n²) |
Quick start
From a Sinkhorn gamma
import numpy as np
import gotvis
# gamma: (n_cells, n_prototypes) non-negative soft assignment
Y = gotvis.sinkhorn_embedding(gamma, method="svd")
Y = gotvis.sinkhorn_embedding(gamma, method="barycentric", transform="ilr")
Y, info = gotvis.sinkhorn_embedding(
gamma, method="spectral", affinity="kl", return_info=True
)
Straight from a GOTClust GSSC run
from gotclust import grassmann_sinkhorn_clustering
import gotvis
labels, info = grassmann_sinkhorn_clustering(H, n_clusters=5)
# info dict is accepted directly — no plumbing
Y = gotvis.sinkhorn_embedding(info, method="svd")
Y = gotvis.sinkhorn_embedding(info, method="barycentric")
From Grassmann cost (classic functional proximity)
Y = gotvis.functional_embedding(C=C, method="laplacian", knn=15)
Y = gotvis.functional_embedding(H=H, p=3, k=30, method="mds",
landmarks=500)
With AnnData
import gotvis.tools as gt
gt.gamma_from_gotclust(info, adata) # adata.uns["gamma"]
gt.embed(adata, method="svd", key_added="X_gotvis")
ax = gt.plot_embedding(adata, color="cell_type", basis="X_gotvis")
Design notes
- Core is numpy + scipy only.
anndata,matplotlib,sklearn,POTandgrassmann-otare all optional. GOTVis never imports them at module scope. gammais validated everywhere. Negative, NaN/Inf and degenerate shapes raise immediately with an actionable message; all-zero rows are tolerated (they embed at the origin).- Sign / rotation ambiguity is handled. SVD axes are sign-stabilised so repeated runs agree.
Relationship to GOTClust embeddings
GOTVis's functional_embedding is a portable re-implementation of
gotclust.grassmann_functional_embedding — same Laplacian-Eigenmaps /
MDS semantics, but with no GOTClust import required and an optional
landmark-MDS fast path. The genuinely new content is the whole
gamma-based family, which GOTClust does not provide.
License
MIT
Metadata
Release files for gotvis 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gotvis-0.1.0.tar.gz | 19.3 kB | Without provenance | Details for gotvis-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gotvis-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for gotvis-0.1.0-py3-none-any.whl |
Total release size: 36.2 kB
Release files / gotvis-0.1.0.tar.gz
| Download URL | gotvis-0.1.0.tar.gz |
|---|---|
| Size | 19.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
687c2d99fb777421a6c2b6949a7a56f29c65fdf12bfb8bb66deb2588047d4edb
|
|
BLAKE2b-256 checksum How to use checksums |
323299dc7af622f20a3b9f0e2fdd6fe1c0c46bf57fd65cc3b88cbd23f91aa9bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.18
|
Release files / gotvis-0.1.0-py3-none-any.whl
| Download URL | gotvis-0.1.0-py3-none-any.whl |
|---|---|
| Size | 16.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
56a6079e645af2040cdd0f78f56640ac41dd33d9882dd23e13735cfd9c91a70f
|
|
BLAKE2b-256 checksum How to use checksums |
718bdc2a768a3c0c444b098d1c874c1550054bd277bb50d7eea48866b73deb0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.18
|
Security for gotvis 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.