Metadata-Version: 2.4
Name: Cellist
Version: 1.2.0
Summary: Cellist (Cell identification in high-resolution Spatial Transcriptomics) is a cell segmentation tool for high-resolution spatial transcriptomics. 
Home-page: https://github.com/dongqingsun96/Cellist
Author: Dongqing Sun
Author-email: Dongqing Sun <Dongqingsun96@gmail.com>
License: GPL-3.0
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.23.0
Requires-Dist: scikit-learn>=1.3.1
Requires-Dist: scikit-misc>=0.2.0
Requires-Dist: scikit-image>=0.20.0
Requires-Dist: pandas==2.3.1
Requires-Dist: scipy>=1.9.1
Requires-Dist: matplotlib>=3.7.3
Requires-Dist: seaborn>=0.11.2
Requires-Dist: scanpy>=1.9.4
Requires-Dist: h5py>=3.8.0
Requires-Dist: tables>=3.7.0
Requires-Dist: spateo-release==1.1.0
Requires-Dist: pyvista==0.42
Requires-Dist: leidenalg==0.10.2
Requires-Dist: cellpose==3.1.1.1
Requires-Dist: polars>=1.0
Requires-Dist: pyometiff==0.0.13
Requires-Dist: vtk==9.4.1
Requires-Dist: sklearn-ann
Requires-Dist: annoy
Requires-Dist: alphashape
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# Cellist

![PyPI](https://img.shields.io/pypi/v/cellist)
![Downloads](https://pepy.tech/badge/cellist)
![Documentation Status](https://readthedocs.org/projects/cellist/badge/?version=latest)

Cell identification in high-resolution Spatial Transcriptomics

Cellist is a computational method to perform cell segmentation on high-resolution spatial transcriptomics (ST) data, including sequncing-based (e.g. Stereo-seq and Seq-Scope) and imaging-based (e.g. seqFISH+ and STARmap) technologies.

![avatar](docs/_static/img/Cellist_workflow.png)

## Change Log
### v0.0.1a
* Build Cellist.
### v1.0.0
* Release Cellist.
### v1.1.0
* Update Cellist model.
* Support Cellpose for image-based segmentation.
### v1.1.1
* Fix a typo in the Watershed segmentation.
* Update package dependencies.
### v1.2.0
* `cellist seg`: new `--count-layers` option (default `auto`). Extra count columns of the GEM such as `EXONIC` / `INTRONIC` are aggregated into additional cell-level matrices (`{outprefix}_Cellist_segmentation_cell_count_EXONIC.h5`, `..._INTRONIC.h5`) with the same gene and cell ordering as the main count matrix, so they can be used directly as the spliced / unspliced layers for RNA velocity.
* `cellist seg`: default model parameters changed to `--cell-radius 25`, `--alpha 0.9`, `--beta 5.0` (v1.1.1: 15, 0.8, 10). Runs that relied on the old defaults should pass them explicitly.
* `cellist seg`: the merge of overlapping slices / patches is now deterministic. Each spot keeps the assignment with the highest probability over all slices; previously a first-occurrence de-duplication ran before the probability sort, so about 1% of labels depended on the order in which worker results were collected and changed between otherwise identical runs.
* `cellist seg`: memory-bounded merge that streams the GEM with `polars`; the GEM count column name (`MIDCount` / `MIDCounts`) is detected automatically.
* `cellist align`: new `--transpose`, `--transpose_auto` and `--prealigned` options. `cellist watershed`: new `--offset` and `--test-mode` options. `cellist cellpose`: GPU device selected automatically.
* New dependency `polars`.

## System Requirements
### Hardware Requirements
For optimal performance, especially when using `Cellpose` for initial image-based segmentation, a system with a GPU is recommended.

### Operating System
This package is supported on Linux systems and has been tested on **Rocky Linux release 9.4**.

### Python Rependencies
The core dependencies include:
```
scikit-learn>=1.3.1
scikit-image>=0.20.0
h5py>=3.8.0
tables>=3.7.0
```
A complete list of required packages is available in `requirements.txt`.

## Install Cellist
### Step-by-step Instructions
We recommend installing Cellist in a fresh conda environment:
```bash
git clone https://github.com/wanglabtongji/Cellist.git
cd Cellist
conda create -n Cellist python=3.10
conda activate Cellist
pip install -r requirements.txt
pip install .
```
Note: After installation, users can verify the installation by running `cellist --help`. The command may return a message such as `fastpd is not installed. Please compile the fastpd library`. This warning originates from Spateo and does not affect the functionality of `Cellist`.

### Typical Install Time
On a high-performance server, installation typically takes 10 minutes.

## Documentation
For full installation and usage of Cellist, please refer to the [documentation](https://cellist.readthedocs.io/en/latest/).

## Usage
```bash
cellist --help
usage: cellist [-h] [-v] {seg,align,watershed,cellpose,impute} ...

Cellist (Cell identification in high-resolution Spatial Transcriptomics) is a cell segmentation tool for high-
resolution spatial transcriptomics.

positional arguments:
  {seg,align,watershed,cellpose,impute}
    seg                 Run Cellist segmentation on high-resolution spatial transcriptomics.
    align               Refine alignment between image and spatial transcriptomics.
    watershed           Run initial watershed segmentation on the staining image.
    cellpose            Run initial cellpose segmentation on the staining image.
    impute              Perform spatially-aware gene imputation within each cluster.

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         Print version info.
```
