# **ONTraC**
[![PyPI Latest Release](https://img.shields.io/pypi/v/ONTraC.svg)](https://pypi.org/project/ONTraC/)
[![Python versions](https://img.shields.io/pypi/pyversions/ONTraC.svg)](https://pypi.org/project/ONTraC/)
[![Downloads](https://static.pepy.tech/badge/ONTraC)](https://pepy.tech/project/ONTraC)
[![PyPI Downloads](https://img.shields.io/pypi/dm/ONTraC.svg?label=PyPI%20downloads)](https://pypistats.org/packages/ontrac)
[![Anaconda-Server Badge](https://anaconda.org/gyuanlab/ontrac/badges/version.svg)](https://anaconda.org/gyuanlab/ontrac)
[![Anaconda-Server Badge](https://anaconda.org/gyuanlab/ontrac/badges/platforms.svg)](https://anaconda.org/gyuanlab/ontrac)
[![GitHub stars](https://badgen.net/github/stars/gyuanlab/ONTraC)](https://github.com/gyuanlab/ONTraC)
[![GitHub license](https://img.shields.io/github/license/gyuanlab/ONTraC.svg)](https://github.com/gyuanlab/ONTraC/blob/master/LICENSE)
ONTraC (Ordered Niche Trajectory Construction) is a niche-centered, machine learning
method for constructing spatially continuous trajectories. ONTraC differs from existing tools in
that it treats a niche, rather than an individual cell, as the basic unit for spatial trajectory
analysis. In this context, we define niche as a multicellular, spatially localized region where
different cell types may coexist and interact with each other. ONTraC seamlessly integrates
cell-type composition and spatial information by using the graph neural network modeling
framework. Its output, which is called the niche trajectory, can be viewed as a one dimensional
representation of the tissue microenvironment continuum. By disentangling cell-level and niche-
level properties, niche trajectory analysis provides a coherent framework to study coordinated
responses from all the cells in association with continuous tissue microenvironment variations.
![ONTraC Structure](docs/source/_static/images/ONTraC_structure.png)
## Installation
```sh
pip install ONTraC
```
For details and alternative approches, please see the [installation tutorial](tutorials/installation.md)
## Tutorial
### Input File
A example input file is provided in `examples/stereo_seq_brain/meta_data.csv`.
This file contains all input formation with five columns: Cell_ID, Sample, Cell_Type, x, and y.
| Cell_ID | Sample | Cell_Type | x | y |
| --------------- | -------- | --------- | ------- | ----- |
| E12_E1S3_100034 | E12_E1S3 | Fibro | 15940 | 18584 |
| E12_E1S3_100035 | E12_E1S3 | Fibro | 15942 | 18623 |
| ... | ... | ... | ... | ... |
| E16_E2S7_326412 | E16_E2S7 | Fibro | 32990.5 | 14475 |
For detailed information about input and output file, please see [IO files explanation](tutorials/IO_files.md#input-files).
### Running ONTraC
The required options for running ONTraC are the paths to the input file and the three output directories:
- **NN-dir:** This directory stores preprocessed data and other intermediary datasets for analysis.
- **GNN-dir:** This directory stores output from he GNN algorithm.
- **NT-dir:** This directory stores NT output.
For detailed description about all parameters, please see [Parameters explanation](tutorials/parameters.md).
```{sh}
ONTraC --meta-input simulated_dataset.csv --NN-dir simulation_niche_net --GNN-dir simulation_GNN --NT-dir simulation_niche_trajectory --hidden-feats 4 -k 6 --modularity-loss-weight 0.3 --purity-loss-weight 300 --regularization-loss-weight 0.1 --beta 0.03 2>&1 | tee simulation.log
```
The input dataset and output files could be downloaded from [Zenodo](https://zenodo.org/records/11186620).
We recommand running `ONTraC` on GPU, it may take much more time on your own laptop with CPU only.
### Output
The intermediate and final results are located in `NN-dir`, `GNN-dir`, and `NT-dir` directories. Please see [IO files explanation](tutorials/IO_files.md#output-files) for detailed infromation.
### Visualization
Please see [post analysis tutorial](tutorials/post_analysis.md).
### Interoperability
ONTraC has been incorporated with [Giotto Suite](https://drieslab.github.io/Giotto_website/articles/ontrac.html).
## Citation
**Wang, W.\*, Zheng, S.\*, Shin, C. S. & [Yuan, G. C.](https://labs.icahn.mssm.edu/yuanlab/)$**. [Characterizing Spatially Continuous Variations in Tissue Microenvironment through Niche Trajectory Analysis](https://www.biorxiv.org/content/10.1101/2024.04.23.590827v1). *bioRxiv*, 2024.
Raw data
{
"_id": null,
"home_page": null,
"name": "ONTraC",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.13,>=3.10",
"maintainer_email": null,
"keywords": "graph neural network, pytorch, pytorch geometric, trajectory inference, spatial omics",
"author": null,
"author_email": "Wen Wang <wwang.bio@gmail.com>, Shiwei Zheng <swzheng29@gmail.com>, Crystal Shin <sjcshin5040@gmail.com>, \"Joselyn C. Ch\u00e1vez-Fuentes\" <joselynchavezf@gmail.com>, Guo-Cheng Yuan <gcyuan@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/7e/7e/eb02f57e45009b19a071dde20bf6a72a97e0ac2f11a2cfec94888d5e6674/ontrac-1.1.3.tar.gz",
"platform": null,
"description": "# **ONTraC**\n\n[![PyPI Latest Release](https://img.shields.io/pypi/v/ONTraC.svg)](https://pypi.org/project/ONTraC/)\n[![Python versions](https://img.shields.io/pypi/pyversions/ONTraC.svg)](https://pypi.org/project/ONTraC/)\n[![Downloads](https://static.pepy.tech/badge/ONTraC)](https://pepy.tech/project/ONTraC)\n[![PyPI Downloads](https://img.shields.io/pypi/dm/ONTraC.svg?label=PyPI%20downloads)](https://pypistats.org/packages/ontrac)\n[![Anaconda-Server Badge](https://anaconda.org/gyuanlab/ontrac/badges/version.svg)](https://anaconda.org/gyuanlab/ontrac)\n[![Anaconda-Server Badge](https://anaconda.org/gyuanlab/ontrac/badges/platforms.svg)](https://anaconda.org/gyuanlab/ontrac)\n[![GitHub stars](https://badgen.net/github/stars/gyuanlab/ONTraC)](https://github.com/gyuanlab/ONTraC)\n[![GitHub license](https://img.shields.io/github/license/gyuanlab/ONTraC.svg)](https://github.com/gyuanlab/ONTraC/blob/master/LICENSE)\n\nONTraC (Ordered Niche Trajectory Construction) is a niche-centered, machine learning\nmethod for constructing spatially continuous trajectories. ONTraC differs from existing tools in\nthat it treats a niche, rather than an individual cell, as the basic unit for spatial trajectory\nanalysis. In this context, we define niche as a multicellular, spatially localized region where\ndifferent cell types may coexist and interact with each other. ONTraC seamlessly integrates\ncell-type composition and spatial information by using the graph neural network modeling\nframework. Its output, which is called the niche trajectory, can be viewed as a one dimensional\nrepresentation of the tissue microenvironment continuum. By disentangling cell-level and niche-\nlevel properties, niche trajectory analysis provides a coherent framework to study coordinated\nresponses from all the cells in association with continuous tissue microenvironment variations.\n\n![ONTraC Structure](docs/source/_static/images/ONTraC_structure.png)\n\n## Installation\n\n```sh\npip install ONTraC\n```\n\nFor details and alternative approches, please see the [installation tutorial](tutorials/installation.md)\n\n## Tutorial\n\n### Input File\n\nA example input file is provided in `examples/stereo_seq_brain/meta_data.csv`.\nThis file contains all input formation with five columns: Cell_ID, Sample, Cell_Type, x, and y.\n\n| Cell_ID | Sample | Cell_Type | x | y |\n| --------------- | -------- | --------- | ------- | ----- |\n| E12_E1S3_100034 | E12_E1S3 | Fibro | 15940 | 18584 |\n| E12_E1S3_100035 | E12_E1S3 | Fibro | 15942 | 18623 |\n| ... | ... | ... | ... | ... |\n| E16_E2S7_326412 | E16_E2S7 | Fibro | 32990.5 | 14475 |\n\nFor detailed information about input and output file, please see [IO files explanation](tutorials/IO_files.md#input-files).\n\n### Running ONTraC\n\nThe required options for running ONTraC are the paths to the input file and the three output directories:\n\n- **NN-dir:** This directory stores preprocessed data and other intermediary datasets for analysis.\n- **GNN-dir:** This directory stores output from he GNN algorithm.\n- **NT-dir:** This directory stores NT output.\n\nFor detailed description about all parameters, please see [Parameters explanation](tutorials/parameters.md).\n\n```{sh}\nONTraC --meta-input simulated_dataset.csv --NN-dir simulation_niche_net --GNN-dir simulation_GNN --NT-dir simulation_niche_trajectory --hidden-feats 4 -k 6 --modularity-loss-weight 0.3 --purity-loss-weight 300 --regularization-loss-weight 0.1 --beta 0.03 2>&1 | tee simulation.log\n```\n\nThe input dataset and output files could be downloaded from [Zenodo](https://zenodo.org/records/11186620).\n\nWe recommand running `ONTraC` on GPU, it may take much more time on your own laptop with CPU only.\n\n### Output\n\nThe intermediate and final results are located in `NN-dir`, `GNN-dir`, and `NT-dir` directories. Please see [IO files explanation](tutorials/IO_files.md#output-files) for detailed infromation.\n\n### Visualization\n\nPlease see [post analysis tutorial](tutorials/post_analysis.md).\n\n### Interoperability\n\nONTraC has been incorporated with [Giotto Suite](https://drieslab.github.io/Giotto_website/articles/ontrac.html).\n\n## Citation\n\n**Wang, W.\\*, Zheng, S.\\*, Shin, C. S. & [Yuan, G. C.](https://labs.icahn.mssm.edu/yuanlab/)$**. [Characterizing Spatially Continuous Variations in Tissue Microenvironment through Niche Trajectory Analysis](https://www.biorxiv.org/content/10.1101/2024.04.23.590827v1). *bioRxiv*, 2024.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A niche-centered, machine learning method for constructing spatially continuous trajectories",
"version": "1.1.3",
"project_urls": {
"Homepage": "https://github.com/gyuanlab/ONTraC",
"Issue Tracker": "https://github.com/gyuanlab/ONTraC/issues",
"Repository": "https://github.com/gyuanlab/ONTraC"
},
"split_keywords": [
"graph neural network",
" pytorch",
" pytorch geometric",
" trajectory inference",
" spatial omics"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "eec86155305ad30ac3ac344c68dea58f4d075dc1a22face8147a3609bf7d9344",
"md5": "28d53b955793c3381a6f5dfd5327caf0",
"sha256": "83e50b51aa37960fb52241302d3033fdeb0b1936597d6b4fc71dfc34846f7433"
},
"downloads": -1,
"filename": "ONTraC-1.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "28d53b955793c3381a6f5dfd5327caf0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.13,>=3.10",
"size": 66821,
"upload_time": "2025-01-15T17:43:17",
"upload_time_iso_8601": "2025-01-15T17:43:17.209830Z",
"url": "https://files.pythonhosted.org/packages/ee/c8/6155305ad30ac3ac344c68dea58f4d075dc1a22face8147a3609bf7d9344/ONTraC-1.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7e7eeb02f57e45009b19a071dde20bf6a72a97e0ac2f11a2cfec94888d5e6674",
"md5": "6e0afeab66644e4639857fb806d0e8e0",
"sha256": "0ad9bae84d40a6180369671c69798e1a9c6c2daab4815ebe58609a8efe8f4b63"
},
"downloads": -1,
"filename": "ontrac-1.1.3.tar.gz",
"has_sig": false,
"md5_digest": "6e0afeab66644e4639857fb806d0e8e0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.13,>=3.10",
"size": 55967,
"upload_time": "2025-01-15T17:43:06",
"upload_time_iso_8601": "2025-01-15T17:43:06.538633Z",
"url": "https://files.pythonhosted.org/packages/7e/7e/eb02f57e45009b19a071dde20bf6a72a97e0ac2f11a2cfec94888d5e6674/ontrac-1.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-15 17:43:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gyuanlab",
"github_project": "ONTraC",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "ontrac"
}