COZI neighbor preference analysis package
Project description
COZIpy - Neighbor preference analysis with a conditional z-score
COZI is a python package for neighbor preference (NEP) analysis of cell type labelled spatial data. As described in Schiller et al. bioRxiv 2025, COZI is one optimized flavor of neighbor preference analysis and infers directional neighbor preferences based on label permutations.
Installation
Option 1. Clone the repository
If you plan to develop or modify COZIpy, install it in editable mode:
# Clone the repository
git clone https://github.com/SchapiroLabor/COZIpy
cd COZIpy
# (Optional) create the conda environment
conda env create -f env.yml
conda activate cozi-env
# Install in editable/development mode
pip install -e .
Option 2. Install from PyPI
Directly install with pip:
pip install cozipy
How to run COZIpy
Description
COZI requires x and y-coordinates and cell type label information as input. The function allows the definition of three different neighborhoods, namely k-nearest neighbor, radius and delaunay. COZI outputs z-scores generated by comparing the observed against the expected neighbor counts between cell types. The counts themselves are normalized by the number of cells of type A with at least one neighbor of type B (termed conditional normalization). It also outputs the conditional cell ratio, so the ratio of cells of type A that actually neighbor cells of type B. For more methodological details, please refer to Schiller et al. bioRxiv 2025.
Tutorial
Check the Tutorial for a code example.
Contributing
Contributions, issues, and feature requests are welcome!
Feel free to open a pull request or submit an issue on GitHub Issues.
Before submitting a PR:
- Run tests
- Follow existing code style and documentation patterns
Citing
If you use COZIpy or any other COZI implementation in IMCRtools or Squidpy in your work, please cite:
Schiller, C. Comparison and Optimization of Cellular Neighbor Preference Methods for Quantitative Tissue Analysis., https://doi.org/10.1101/2025.03.31.646289, bioRxiv, 2025
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cozipy-0.1.2.tar.gz.
File metadata
- Download URL: cozipy-0.1.2.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18fa097a9c5e657831327eeeed5d72658f25d169ae0669771ad9e1e8dd41e958
|
|
| MD5 |
227cecd5a95da6ed9d2c67a6b3e86ea3
|
|
| BLAKE2b-256 |
8a6ceabb910c9a7af1892aeb69a7430c09e66370738c767a4ac9b7a6d05945e8
|
Provenance
The following attestation bundles were made for cozipy-0.1.2.tar.gz:
Publisher:
python-publish.yml on SchapiroLabor/COZIpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cozipy-0.1.2.tar.gz -
Subject digest:
18fa097a9c5e657831327eeeed5d72658f25d169ae0669771ad9e1e8dd41e958 - Sigstore transparency entry: 1065841149
- Sigstore integration time:
-
Permalink:
SchapiroLabor/COZIpy@035eb8f2aa729be99b7ef0fc86406d1a9e71bc41 -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/SchapiroLabor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@035eb8f2aa729be99b7ef0fc86406d1a9e71bc41 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cozipy-0.1.2-py3-none-any.whl.
File metadata
- Download URL: cozipy-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af92b101fcaea6a347b26cc56166bcfd1c0fd64a5b17d97d9f828ee01c4a4343
|
|
| MD5 |
ea6fa64ac339b866ce53eda96a375856
|
|
| BLAKE2b-256 |
4372df5e5b80eb2f9eac8001b1c7844a09817b49d06c5f25a9e32fc9067e16d5
|
Provenance
The following attestation bundles were made for cozipy-0.1.2-py3-none-any.whl:
Publisher:
python-publish.yml on SchapiroLabor/COZIpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cozipy-0.1.2-py3-none-any.whl -
Subject digest:
af92b101fcaea6a347b26cc56166bcfd1c0fd64a5b17d97d9f828ee01c4a4343 - Sigstore transparency entry: 1065841164
- Sigstore integration time:
-
Permalink:
SchapiroLabor/COZIpy@035eb8f2aa729be99b7ef0fc86406d1a9e71bc41 -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/SchapiroLabor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@035eb8f2aa729be99b7ef0fc86406d1a9e71bc41 -
Trigger Event:
release
-
Statement type: