Metadata-Version: 2.4
Name: gotvis
Version: 0.3.0
Summary: Grassmann functional embeddings (Laplacian Eigenmaps / MDS / t-SNE) for single-cell visualisation
Author: GOTVis Developers
License: MIT
Project-URL: Homepage, https://github.com/ZengFLab/gotvis
Project-URL: Documentation, https://github.com/ZengFLab/gotvis#readme
Project-URL: Repository, https://github.com/ZengFLab/gotvis
Project-URL: Issues, https://github.com/ZengFLab/gotvis/issues
Keywords: single-cell,embedding,visualization,grassmann-manifold,single-cell-rna-seq,computational-biology
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.20
Requires-Dist: scipy>=1.6
Provides-Extra: gotclust
Requires-Dist: grassmann-ot>=0.3.0; extra == "gotclust"
Provides-Extra: anndata
Requires-Dist: anndata>=0.8; extra == "anndata"
Provides-Extra: plot
Requires-Dist: matplotlib>=3.3; extra == "plot"
Requires-Dist: seaborn>=0.11; extra == "plot"
Provides-Extra: tsne
Requires-Dist: scikit-learn>=0.24; extra == "tsne"
Provides-Extra: opentsne
Requires-Dist: openTSNE>=1.0; extra == "opentsne"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: numpy>=1.20; extra == "dev"
Requires-Dist: scipy>=1.6; extra == "dev"
Requires-Dist: scikit-learn>=0.24; extra == "dev"
Requires-Dist: POT>=0.9.0; extra == "dev"
Provides-Extra: all
Requires-Dist: anndata>=0.8; extra == "all"
Requires-Dist: matplotlib>=3.3; extra == "all"
Requires-Dist: seaborn>=0.11; extra == "all"
Requires-Dist: scikit-learn>=0.24; extra == "all"
Requires-Dist: grassmann-ot>=0.3.0; extra == "all"
Dynamic: license-file

# GOTVis — Grassmann functional embeddings for single-cell visualisation

GOTVis is the visualisation companion of **GOTClust**. It turns Grassmann
objects (local subspaces `U_list` or the Grassmann cost matrix `C`) into
2-D / 3-D coordinates.

## 0.2 breaking changes

* `functional_embedding` is renamed to **`embedding`**. The old name is kept
  as a deprecated alias (removed in 1.0).
* The whole gamma / Sinkhorn embedding family is **removed**
  (`sinkhorn_embedding`, `sinkhorn_svd_embedding`, `barycentric_embedding`,
  `sinkhorn_spectral_embedding`, `gammagram_embedding`, `resolve_gamma`,
  `coerce_gamma`, `gamma_affinity`). A Sinkhorn gamma encodes cell → prototype
  membership, not cell-cell manifold geometry, so gamma-based MDS/t-SNE plots
  are misleading (e.g. trajectory data collapses to a line). t-SNE support is
  preserved as `embedding(..., method="tsne")` on Grassmann objects.

## Install

```
pip install -e .
pip install "gotvis[tsne]"        # scikit-learn TSNE backend
pip install "gotvis[opentsne]"    # openTSNE backend (optional)
pip install "gotvis[all]"         # + anndata, plotting, grassmann-ot
```

## Usage

```python
import gotvis

# from the GOTClust/GSSC info dict (use its Grassmann cost matrix, not gamma)
labels, info = grassmann_spectral_clustering(H, 7)
Y = gotvis.embedding(C=info["C"], method="tsne")
Y = gotvis.embedding(C=info["C"], method="mds")
Y = gotvis.embedding(C=info["C"], method="laplacian", knn=15)

# from raw input: H (r, n_cells) -> local subspaces -> cost matrix
Y = gotvis.embedding(H, k=30, p=3, method="laplacian")

# AnnData
gotvis.embed(adata, C=info["C"], method="tsne")   # writes adata.obsm["X_gotvis"]
gotvis.plot_embedding(adata, color="cell_type")
```

## API

| Method | Input | Geometry | Cost |
|---|---|---|---|
| `embedding(method="laplacian")` | H / U_list / C | kNN graph + Laplacian Eigenmaps (default) | O(n²) |
| `embedding(method="mds")` | H / U_list / C | classical MDS, optional landmark approximation | O(n³) |
| `embedding(method="tsne")` | H / U_list / C | t-SNE with metric="precomputed" on Grassmann distance | O(n²) |
| `mds_embedding(D)` / `tsne_embedding(D)` | any distance matrix | generic fallbacks | — |

`gotclust_embed(H=/C=/U_list=, method=...)` is a compatibility wrapper. Passing
`gamma=` raises `TypeError`.
