PHD-MS: Persistent Homology for Domains at Multiple Scales
Multiscale domain identification for spatial transcriptomic data.
Installation
Simply install with pip:
pip install phd_ms
Or install from source by downloading, cd to this directory, using:
pip install .
Usage/Examples
Detailed jupyter notebook tutorials are available in the examples folder.
Or simply download the file titled point_and_click.py and run it to use our clickable graphical interface. When using point_and_click.py, set the path to your data by changing this line:
DATA = '/path/to/your_data.h5ad'
Here we'll show a simple example with Visium DLPFC data, using default parameters. First, import necessary components.
import numpy as np
import phd_ms
Preprocessing steps here (note that we assume a spatially-aware embedding has already been computed for your data and stored in adata.obsm):
INPUT_FILE = '/path/to/adata_151673.h5ad'
RESOLUTIONS = np.linspace(start=0.15, stop=.95, num=8)
RES_KEYS = [f'leiden_{r:.3f}' for r in RESOLUTIONS]
adata = phd_ms.tl.preprocess_leiden(INPUT_FILE, output_file=INPUT_FILE, emb='X_gst',
resolution=RESOLUTIONS, res_keys=RES_KEYS)
Compute persistent homology and plot the 10 most prominent multiscale domains:
cluster_complex, clusterings = phd_ms.tl.cluster_filtration(adata, res_keys=RES_KEYS)
domains = phd_ms.tl.map_multiscale(adata.obsm['spatial'], cluster_complex, clusterings, num_domains=10)
Metadata
Release files for phd-ms 1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| phd_ms-1.3.tar.gz | 14.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| phd_ms-1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.4 kB
Release files / phd_ms-1.3.tar.gz
| Download URL | phd_ms-1.3.tar.gz |
|---|---|
| Size | 14.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
49e78b08603f60b5058728f48961aad53a3beae1864c6598f5fd68001e684f12
|
|
BLAKE2b-256 checksum How to use checksums |
cbdc090c3921a0bdde73f06bb6de69c46a1cbbf75f56793f9b469ae4319564bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / phd_ms-1.3-py3-none-any.whl
| Download URL | phd_ms-1.3-py3-none-any.whl |
|---|---|
| Size | 15.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
20c6f931166bd3468183395513b171a082f42f30ea7d180d9fce4bf7f32d5314
|
|
BLAKE2b-256 checksum How to use checksums |
544ccb42dbece45039ca57b4561080fa7626dc3229806fd6be9f6cc861aebdbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|