topovelo


Nametopovelo JSON
Version 0.0.1a1 PyPI version JSON
download
home_pagehttps://github.com/welch-lab/TopoVelo.git
Summarytopological velocity inference from single-cell spatial transcriptomic data
upload_time2024-11-17 20:31:24
maintainerNone
docs_urlNone
authorYichen Gu
requires_pythonNone
licenseGNU General Public License v3.0
keywords spatial transcriptomics rna velocity single-cell rna graph neural network
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/welch-lab/TopoVelo.git",
    "name": "topovelo",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "spatial transcriptomics, RNA velocity, single-cell RNA, graph neural network",
    "author": "Yichen Gu",
    "author_email": "gyichen@umich.edu",
    "download_url": "https://files.pythonhosted.org/packages/08/2f/4b7e935b57c6e8ab9ee7f720f1422362a1765cc7da443dc6b199e9435895/topovelo-0.0.1a1.tar.gz",
    "platform": null,
    "description": "# TopoVelo\n\nTopoVelo 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.\nThe method applies a graph variational autoencoder to recover spatially-coupled RNA velocity and reveal the spatial migration of cells during tissue growth.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [License](#license)\n- [Contact](#contact)\n\n## Installation\n\nTo install the TopoVelo package, you can use pip:\nLocally:\n```\ngit clone https://github.com/welch-lab/TopoVelo.git\ncd TopoVelo\npip install .\n```\nFrom PyPI:\n```\npip install topovelo\n```\n\n## Usage\n\nThe 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:\n```\nimport scanpy as sc\nimport scvelo as scv\nimport topovelo as tpv\nimport torch\n\n# Load .h5ad to AnnData\nadata = sc.read(< path to .h5ad >)\n\n# Preprocessing\nspatial_key = 'X_spatial'\ntpv.preprocess(adata, n_gene=200, spatial_key=spatial_key)\ntpv.build_spatial_graph(adata, spatial_key)\n\n# Create a VAE object \ndevice = torch.device('cpu') if torch.cuda.is_available() else torch.device('cpu')\nvae = tpv.VAE(adata, tmax=20, dim_z=5, device=device)\n\n# Training\nvae.train(adata, adata.obsp['spatial_graph'], spatial_key)\n\n# Save results\nvae.save_model(< path to model parameters >, 'encoder', 'decoder')\nvae.save_anndata(adata, 'gat', < path to output >, file_name=\"adata_out.h5ad\")\n```\nExamples of advanced usage, model evaluation and plotting can be found in the [tutorial](./notebooks/tutorial/).\n\n## License\n\nGNU General Public License v3.0\n\n## Contact\n\nThe package is currently maintained by Yichen Gu. Please contact the maintainer via gyichen@umich.edu.\n",
    "bugtrack_url": null,
    "license": "GNU General Public License v3.0",
    "summary": "topological velocity inference from single-cell spatial transcriptomic data",
    "version": "0.0.1a1",
    "project_urls": {
        "Homepage": "https://github.com/welch-lab/TopoVelo.git"
    },
    "split_keywords": [
        "spatial transcriptomics",
        " rna velocity",
        " single-cell rna",
        " graph neural network"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "84fb3d0f7a141feb15feb8f552bb61340d79b14a02dc4689015f8dac2c7a7c93",
                "md5": "f506c99024fdc1856d62d3f26a21a202",
                "sha256": "f8bac901b48402cdab5195077afb28e4751ef6fd93f653427b61f13a4103266c"
            },
            "downloads": -1,
            "filename": "topovelo-0.0.1a1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f506c99024fdc1856d62d3f26a21a202",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 178117,
            "upload_time": "2024-11-17T20:31:22",
            "upload_time_iso_8601": "2024-11-17T20:31:22.583340Z",
            "url": "https://files.pythonhosted.org/packages/84/fb/3d0f7a141feb15feb8f552bb61340d79b14a02dc4689015f8dac2c7a7c93/topovelo-0.0.1a1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "082f4b7e935b57c6e8ab9ee7f720f1422362a1765cc7da443dc6b199e9435895",
                "md5": "b1d38381dd66d15149e5d2a9232f9f5b",
                "sha256": "ea46362f3ac47ab60c58d33ce6f3f180eb8abecd0e4460ef57e9885e4dc1266d"
            },
            "downloads": -1,
            "filename": "topovelo-0.0.1a1.tar.gz",
            "has_sig": false,
            "md5_digest": "b1d38381dd66d15149e5d2a9232f9f5b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 171044,
            "upload_time": "2024-11-17T20:31:24",
            "upload_time_iso_8601": "2024-11-17T20:31:24.522816Z",
            "url": "https://files.pythonhosted.org/packages/08/2f/4b7e935b57c6e8ab9ee7f720f1422362a1765cc7da443dc6b199e9435895/topovelo-0.0.1a1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-17 20:31:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "welch-lab",
    "github_project": "TopoVelo",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "topovelo"
}
        
Elapsed time: 0.43027s