Metadata-Version: 2.1
Name: topovelo
Version: 0.0.1a1
Summary: topological velocity inference from single-cell spatial transcriptomic data
Home-page: https://github.com/welch-lab/TopoVelo.git
Author: Yichen Gu
Author-email: gyichen@umich.edu
License: GNU General Public License v3.0
Keywords: spatial transcriptomics,RNA velocity,single-cell RNA,graph neural network
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Visualization
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: anndata>=0.8.0
Requires-Dist: hnswlib>=0.6.2
Requires-Dist: igraph>=0.10.4
Requires-Dist: ipywidgets
Requires-Dist: jupyter
Requires-Dist: loess>=2.1.2
Requires-Dist: matplotlib<=3.7.3,>=3.3.0
Requires-Dist: memory_profiler>=0.61.0
Requires-Dist: numba>=0.41.0
Requires-Dist: numpy<=1.23.5,>=1.17.0
Requires-Dist: pandas<=1.5.3,>=0.23.0
Requires-Dist: pynndescent>=0.5.7
Requires-Dist: scanpy>=1.5.0
Requires-Dist: scikit-learn>=0.20.0
Requires-Dist: scipy>=1.13.0
Requires-Dist: scvelo<=0.2.5,>=0.2.3
Requires-Dist: seaborn>=0.10.0
Requires-Dist: torch>=1.8.0
Requires-Dist: torch_geometric>=2.0.4
Requires-Dist: tqdm<=4.62.3
Requires-Dist: umap-learn>=0.3.10
Provides-Extra: default
Requires-Dist: torch==1.13.1+cu117; extra == "default"
Requires-Dist: torch-geometric==2.3.0; extra == "default"
Requires-Dist: anndata==0.8.0; extra == "default"
Requires-Dist: matplotlib==3.5.2; extra == "default"
Requires-Dist: numba==0.56.4; extra == "default"
Requires-Dist: pandas==1.5.3; extra == "default"
Requires-Dist: scipy==1.11.4; extra == "default"
Requires-Dist: scikit-learn==1.4.0; extra == "default"
Requires-Dist: scvelo==0.2.5; extra == "default"

# TopoVelo

TopoVelo stands for **Topo**logical **velo**city inference. It is a tool for jointly modeling temporal gene expression and spatial cellular dynamics from spatial transcriptomic data.
The method applies a graph variational autoencoder to recover spatially-coupled RNA velocity and reveal the spatial migration of cells during tissue growth.

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [License](#license)
- [Contact](#contact)

## Installation

To install the TopoVelo package, you can use pip:
Locally:
```
git clone https://github.com/welch-lab/TopoVelo.git
cd TopoVelo
pip install .
```
From PyPI:
```
pip install topovelo
```

## Usage

The package provides function modules for training and evaluating a TopoVelo model and plotting results. The default pipeline with minimal hyperparameter tuning is shown as follows:
```
import scanpy as sc
import scvelo as scv
import topovelo as tpv
import torch

# Load .h5ad to AnnData
adata = sc.read(< path to .h5ad >)

# Preprocessing
spatial_key = 'X_spatial'
tpv.preprocess(adata, n_gene=200, spatial_key=spatial_key)
tpv.build_spatial_graph(adata, spatial_key)

# Create a VAE object 
device = torch.device('cpu') if torch.cuda.is_available() else torch.device('cpu')
vae = tpv.VAE(adata, tmax=20, dim_z=5, device=device)

# Training
vae.train(adata, adata.obsp['spatial_graph'], spatial_key)

# Save results
vae.save_model(< path to model parameters >, 'encoder', 'decoder')
vae.save_anndata(adata, 'gat', < path to output >, file_name="adata_out.h5ad")
```
Examples of advanced usage, model evaluation and plotting can be found in the [tutorial](./notebooks/tutorial/).

## License

GNU General Public License v3.0

## Contact

The package is currently maintained by Yichen Gu. Please contact the maintainer via gyichen@umich.edu.
