Metadata-Version: 2.4
Name: spatialsnake
Version: 0.0.7
Summary: A Python package for spatial transcriptomics analysis workflows.
Home-page: https://github.com/l-zh007/spatialsnake
Author: lzh
Author-email: lzh <l-zh007@users.noreply.github.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/l-zh007/spatialsnake
Project-URL: Issues, https://github.com/l-zh007/spatialsnake/issues
Keywords: spatial transcriptomics,bioinformatics,snakemake,spatialdata
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: setuptools<81,>=80.9.0
Requires-Dist: packaging<26,>=24.0
Requires-Dist: snakemake-interface-common==1.20.2
Requires-Dist: spatialdata<0.6,>=0.5.0
Requires-Dist: spatialdata-io<0.4,>=0.3.0
Requires-Dist: spatialdata-plot<0.3,>=0.2.11
Requires-Dist: dask<2025,>=2024.11.2
Requires-Dist: dask-expr<2,>=1.1.19
Requires-Dist: dask-image<2025,>=2024.5.3
Requires-Dist: xarray<2026,>=2025.1.2
Requires-Dist: pims<0.8,>=0.7
Requires-Dist: pooch<1.9,>=1.8.2
Requires-Dist: numpy<2.3,>=2.2.6
Requires-Dist: scanpy<1.11,>=1.10.4
Requires-Dist: anndata<0.13,>=0.12.0
Requires-Dist: umap-learn>=0.5.7
Requires-Dist: pandas<2.3,>=2.2.3
Requires-Dist: scipy<1.15,>=1.13.1
Requires-Dist: scikit-learn<1.8,>=1.7.2
Requires-Dist: numba<0.63,>=0.62.1
Requires-Dist: llvmlite<0.46,>=0.45.1
Requires-Dist: shapely<2.2,>=2.1.1
Requires-Dist: matplotlib<3.10,>=3.9.4
Requires-Dist: seaborn>=0.13.2
Requires-Dist: plotnine>=0.15.0
Requires-Dist: Pillow<12,>=11.3.0
Requires-Dist: zarr<3,>=2.18.7
Requires-Dist: h5py>=3.14.0
Requires-Dist: tifffile>=2025.8.28
Requires-Dist: imageio>=2.37.0
Requires-Dist: ome-zarr<0.12,>=0.11.1
Requires-Dist: statsmodels>=0.14.5
Requires-Dist: Pint>=0.25
Requires-Dist: pyarrow<22,>=21.0.0
Requires-Dist: click>=8.3.0
Requires-Dist: typer>=0.16.0
Requires-Dist: docopt>=0.6.2
Requires-Dist: PyYAML>=6.0.3
Requires-Dist: geosketch>=1.3
Requires-Dist: geopandas<1.1.2,>=1.1.1
Requires-Dist: pyogrio<0.13,>=0.12.1
Requires-Dist: pydeseq2>=0.5.2
Requires-Dist: harmonypy<0.1,>=0.0.10
Requires-Dist: bbknn<1.7,>=1.6.0
Requires-Dist: python-igraph<0.12,>=0.11.9
Requires-Dist: louvain>=0.8.2
Provides-Extra: extended
Requires-Dist: cell2location<0.2,>=0.1.5; extra == "extended"
Requires-Dist: opencv-python<4.14,>=4.13.0.92; extra == "extended"
Requires-Dist: scvi-tools<1.5,>=1.4.0; extra == "extended"
Requires-Dist: squidpy<1.7,>=1.6.5; extra == "extended"
Requires-Dist: napari-spatialdata<0.6,>=0.5.7; extra == "extended"
Requires-Dist: PyQt5==5.15.11; extra == "extended"
Requires-Dist: scikit-misc>=0.5.2; extra == "extended"
Requires-Dist: ipython<10,>=9.5.0; extra == "extended"
Requires-Dist: pyro-ppl<1.9.2,>=1.9.1; extra == "extended"
Requires-Dist: pyro-api<0.2,>=0.1.1; extra == "extended"
Requires-Dist: opt-einsum<4,>=3.3.0; extra == "extended"
Requires-Dist: cellphonedb<5.1,>=5.0.1; extra == "extended"
Requires-Dist: torch<2.9,>=2.8.0; extra == "extended"
Requires-Dist: pytorch-lightning<2.6,>=2.5.5; extra == "extended"
Requires-Dist: cellcharter<0.4,>=0.3.5; extra == "extended"
Requires-Dist: cytoolz<2,>=1.0.1; extra == "extended"
Requires-Dist: ktplotspy<0.4,>=0.3.3; extra == "extended"
Requires-Dist: liana<1.7,>=1.6.1; extra == "extended"
Requires-Dist: loompy<3.1,>=3.0.8; extra == "extended"
Requires-Dist: pyscenic<0.13,>=0.12.1; extra == "extended"
Requires-Dist: distributed<2025,>=2024.11.2; extra == "extended"
Requires-Dist: leidenalg<0.11,>=0.10.2; extra == "extended"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

<p align="center">
  <img src="https://raw.githubusercontent.com/l-zh007/spatialsnake/main/spatialsnake-logo.png" alt="Spatialsnake logo" width="700">
</p>

<p align="center">
  <img
    width="820"
    src="https://readme-typing-svg.demolab.com?font=Fira+Code&weight=500&size=16&duration=3200&pause=1100&color=4C78A8&center=true&vCenter=true&width=820&lines=Shared+SpatialData+objects+across+platforms;Configurable+core+analysis+and+focused+analysis;Further+analyses+and+optional+data+operations"
    alt="Spatialsnake workflow features"
  />
</p>

<p align="center">
  <a href="https://spatialsnake-tutorial.readthedocs.io/en/latest/">
    <img src="https://img.shields.io/badge/docs-Read%20the%20Documentation-blue" alt="Documentation">
  </a>
  <a href="https://pypi.org/project/spatialsnake/">
    <img src="https://img.shields.io/pypi/v/spatialsnake" alt="PyPI version">
  </a>
  <a href="https://anaconda.org/bioconda/spatialsnake">
    <img src="https://anaconda.org/bioconda/spatialsnake/badges/version.svg" alt="Bioconda version">
  </a>
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="MIT license"></a>
  <a href="https://anaconda.org/bioconda/spatialsnake">
    <img src="https://anaconda.org/bioconda/spatialsnake/badges/downloads.svg" alt="Bioconda downloads">
  </a>
</p>

Spatialsnake is a command-line tool for analysing **processed spatial transcriptomics data** across sequencing- and imaging-based platforms. Built on SpatialData and Snakemake, it supports core analysis, focused analysis, further analyses and optional data operations.

<p align="center">
  <img src="assets/spatialsnake-workflow.svg" alt="Spatialsnake core analysis, focused analysis and further analyses" width="900">
</p>

## Key features

- **Core analysis:** ingest supported platform outputs, review QC and dimensionality diagnostics, cluster observations, inspect markers or reference-based estimates, and store reviewed annotations. Compatible samples can share the core workflow while retaining sample and group identities.
- **Focused analysis:** select populations, ROIs or physical-distance neighborhoods; recluster selected observations and return refined labels to the parent object. Prepared subsets can proceed to downstream analyses.
- **Further analyses:** use BANKSY or CellCharter for spatial domains, CellPhoneDB/LIANA/CellChat for communication, and pySCENIC for regulatory programs. Comparison modules support sample-level pseudobulk differential expression analysis and descriptive comparisons of CellChat networks. Supported communication plots can be regenerated from saved inference results.
- **Optional data operations:** split or merge compatible objects, import AnnData, and export AnnData or Seurat objects through the CLI. Saved stage inputs allow selected analyses to be revised without repeating unrelated preparation.

## Supported platforms

The `TYPE` values below are case-sensitive documented spellings. Platform-specific selectors determine the representation loaded for analysis.

| Platform / representation | CLI `TYPE` | Input |
| --- | --- | --- |
| Visium | `visium` | Processed expression matrix and spatial files |
| Visium HD | `visium_HD` | Space Ranger binned outputs; choose `bin_size` in the core sample table |
| Segmented Visium | `visium_segment` | Supported Space Ranger segmentation outputs |
| Stereo-seq | `stereoseq` | Supported SAW outputs; choose bin, cellbin or adjusted cellbin with `input_spec` |
| Xenium | `xenium` | Processed expression/transcript data and available images or cell geometries |
| MERFISH / MERSCOPE | `Merfish` | Supported Vizgen expression, transcript, boundary and image outputs |

Availability of images, transcripts and geometries depends on the platform files and loading settings. See the input documentation below for file requirements and resolution selection.

## Installation

For a basic installation on Linux with Conda:

```bash
conda create -n spatialsnake_env --override-channels -c conda-forge -c bioconda spatialsnake -y
conda activate spatialsnake_env
spatialsnake install-packages
```

The command installs the latest compatible release available on Bioconda.

See the [installation guide](https://spatialsnake-tutorial.readthedocs.io/en/latest/environment_setup.html) for PyPI and source installation, environment requirements, and optional analysis dependencies, including CPU/GPU choices.

## Command reference

```text
spatialsnake single_analysis <INPUT_FILE> <TYPE> [options]
spatialsnake compare_analysis <INPUT_FILE> <TYPE> [options]
spatialsnake useful_tool [--option=<operation>] <INPUT>... [options]
spatialsnake produce-file --option=<analysis_option>
spatialsnake install-packages
spatialsnake --help
```

Use `spatialsnake --help` for available commands and parameters. Important parameters can be set directly on the command line; `--configfile` supplies additional YAML settings, with explicitly provided CLI values taking precedence. See the [command-line guide](https://spatialsnake-tutorial.readthedocs.io/en/latest/usage.html) and [configuration reference](https://spatialsnake-tutorial.readthedocs.io/en/latest/config_reference/index.html) for details.

## Documentation and support

- [Input preparation and supported representations](https://spatialsnake-tutorial.readthedocs.io/en/latest/data_input/index.html).
- [Core analysis](https://spatialsnake-tutorial.readthedocs.io/en/latest/core_analysis/index.html) and [multi-sample data assembly](https://spatialsnake-tutorial.readthedocs.io/en/latest/integration_analysis/multi_sample_integration.html).
- [Focused analysis](https://spatialsnake-tutorial.readthedocs.io/en/latest/subcluster_annotation/index.html).
- [Optional data operations](https://spatialsnake-tutorial.readthedocs.io/en/latest/useful_tool/index.html).
- [Further analyses](https://spatialsnake-tutorial.readthedocs.io/en/latest/downstream_analysis/index.html).
- **Problems or feature requests:** [GitHub issues](https://github.com/l-zh007/spatialsnake/issues). Include the software version, installation route, exact command, relevant YAML/sample table and error log. Omit credentials and private data.

## Citation

Report the Spatialsnake version and source revision used in your analysis. Please also cite the underlying SpatialData framework and Snakemake workflow engine:

- Marconato L, Palla G, Yamauchi KA, et al. **SpatialData: an open and universal data framework for spatial omics.** *Nature Methods*. 2025;22:58–62. [doi:10.1038/s41592-024-02212-x](https://doi.org/10.1038/s41592-024-02212-x).
- Mölder F, Jablonski KP, Letcher B, et al. **Sustainable data analysis with Snakemake.** *F1000Research*. 2021;10:33. [doi:10.12688/f1000research.29032.2](https://doi.org/10.12688/f1000research.29032.2).

For individual analytical methods, cite the corresponding original publications listed in the module documentation.

## License

Spatialsnake is distributed under the [MIT license](LICENSE).
