Skip to main content

SpatialCompassV SCOMV logo

PyPI version Documentation Status

Spatial omics analysis tools for cell/gene clustering from a astandard region

Overview of the SpatialCompassV (SCOMV) Workflow

The overall workflow of SpatialCompassV (SCOMV) is summarized as follows:

  • Extraction of a reference region
    A reference region (e.g., a tumor region) is identified using the SpatialKnifeY (SKNY) algorithm.

Vector construction from spatial grids

The AnnData object is discretized into spatial grids, and for each grid, the shortest-distance vector to the reference region is computed. vector
This vector information is stored for each cell/gene and projected onto a polar coordinate map. The horizontal axis represents distance, and the vertical axis also represents distance. Distances are defined as negative for locations inside the reference region. polar_map
A uniformity score is also computed for each distance bin, measuring how evenly a cell type or gene surrounds the reference region across all angular directions. High uniformity indicates a symmetric, ring-like distribution, while low uniformity means the signal is concentrated on one side. uniformity
A similarity matrix is then constructed, followed by PCoA and clustering, to classify spatial distribution patterns. PCoA

Additional functionality

  • Gene distributions can also be visualized as 3D density maps, allowing direct comparison of the spatial distributions of two genes.

overview

Installation

Stable release

To install SpatialCompassV, run this command in your terminal:

pip install scomv

From source

The source files for SpatialCompassV can be downloaded from the Github repo.

You can either clone the public repository:

git clone git://github.com/RyosukeNomural/SpatialCompassV

Once you have a copy of the source, you can install it with:

cd SpatialCompassV
pip install .

Test Dataset & Quick Start

This repository includes a small example dataset — a 10x Genomics Xenium human breast cancer FFPE section, from the 10x Genomics Xenium Human Breast Cancer preview dataset — under docs/tutorials/tutorial_data/, so SCOMV can be run end-to-end without downloading anything separately.

Open any of the tutorial notebooks below in Jupyter; each one loads the test dataset above and runs a full SCOMV pipeline on it:

git clone https://github.com/RyosukeNomural/SpatialCompassV.git
cd SpatialCompassV
jupyter notebook docs/tutorials/gene_analysis/index.ipynb   # or cell_analysis / tumor_solid_analysis

For full step-by-step instructions, parameters, and expected intermediate results, see the tutorials: https://spatialcompassv.readthedocs.io/en/latest/tutorials.html

Tumor Clustering based on Uniformity — input: tutorial_data/xenium_data/ + cell.xlsx → output: tumor "solid" region clusters by immune-cell uniformity

tumor_solid_analysis example output

Cell Distribution Clustering — input: tutorial_data/xenium_data/ + Cell_Barcode_Type_Matrices.xlsx → output: cell-type groupings by distance-to-tumor pattern

cell_analysis example output

Gene Distribution Clustering — input: tutorial_data/xenium_data/ → output: gene clusters by spatial distribution pattern

gene_analysis example output

Supplementary Analysis

Supplementary analysis notebooks supporting the paper are kept in supplementary/, separate from the package tutorials above. This currently includes lung_cancer_panel.ipynb, which reproduces the paper's two-stage gene clustering (PCoA + density ratio, then PCoA + uniformity) on a lung cancer Xenium panel. Note that the underlying dataset for this notebook is unpublished and not included in this repository.

breast_cancer_morans_i.ipynb computes Moran's I and Geary's C spatial autocorrelation for genes within a given field of view of the breast cancer test dataset and plots the top genes for each statistic.

Credits

This package was created with Cookiecutter and the audreyfeldroy/cookiecutter-pypackage project template.

Metadata

Release files for scomv 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scomv 0.1.6
File Size Uploaded Provenance Actions
scomv-0.1.6.tar.gz 2.5 MB Without provenance Details for scomv-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scomv 0.1.6
File Interpreter ABI Platform Actions
scomv-0.1.6-py3-none-any.whl Python 3 none any Details for scomv-0.1.6-py3-none-any.whl

Total release size: 2.6 MB

Release files / scomv-0.1.6.tar.gz

Download URL scomv-0.1.6.tar.gz
Size 2.5 MB
Tags Source
SHA-256 checksum
How to use checksums
ff4bc2031fe4e6536455c5b0172c39f3cd8b99ed966b5b4ff5666893d5a040ec
BLAKE2b-256 checksum
How to use checksums
34c2ddd99aeb9ba93556505dce1dc9d33d61bec6925534cb4c65e86359dd5f2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.14

Release files / scomv-0.1.6-py3-none-any.whl

Download URL scomv-0.1.6-py3-none-any.whl
Size 94.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
656dfd679b26c12a28ef66ac5cc15c72704ffdd592f5ccae6fd8876853531804
BLAKE2b-256 checksum
How to use checksums
e844b83553a4b558962b46b109e53b796dde3c31137fd6da9f1f28b1a5425070
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.14

Security for scomv 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page