SpatialCompassV 
Spatial omics analysis tools for cell/gene clustering from a astandard region
- PyPI package: https://pypi.org/project/scomv/
- Free software: MIT License
- Documentation: https://spatialcompassv.readthedocs.io
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. |
|
| 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. |
|
| 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. |
|
| A similarity matrix is then constructed, followed by PCoA and clustering, to classify spatial distribution patterns. |
|
Additional functionality
- Gene distributions can also be visualized as 3D density maps, allowing direct comparison of the spatial distributions of two genes.
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
Cell Distribution Clustering
— input: tutorial_data/xenium_data/ + Cell_Barcode_Type_Matrices.xlsx → output: cell-type groupings by distance-to-tumor pattern
Gene Distribution Clustering
— input: tutorial_data/xenium_data/ → output: gene clusters by spatial distribution pattern
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.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scomv-0.1.7.tar.gz | 3.0 MB | Without provenance | Details for scomv-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scomv-0.1.7-py3-none-any.whl | Python 3 | none | any | Details for scomv-0.1.7-py3-none-any.whl |
Total release size: 3.1 MB
Release files / scomv-0.1.7.tar.gz
| Download URL | scomv-0.1.7.tar.gz |
|---|---|
| Size | 3.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8ae34929702cc05809ae3983c29ad74694076b113ce7f19e2a0f5b3c3cf9d719
|
|
BLAKE2b-256 checksum How to use checksums |
f6fb7b1b30c57f5d86cf7f1f09481ccd2a04ee639e50a6c19970b86b921d4943
|
| 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.7-py3-none-any.whl
| Download URL | scomv-0.1.7-py3-none-any.whl |
|---|---|
| Size | 127.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
00511044c67d16a62295813477e69060c924127a3504fce72a556a4683e67d4b
|
|
BLAKE2b-256 checksum How to use checksums |
e57dcac2532f6540aecb95bd39afa1a016b26440958f62a13c972398178b3b35
|
| 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.7
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.