Metadata-Version: 2.4
Name: phd_ms
Version: 1.1
Summary: Identifying multiscale tissue domains for spatial transcriptomic data using persistent homology.
Author: Perry Beamer
License: MIT License
Keywords: multiscale domains,spatial transcriptomics,topological data analysis
Classifier: Programming Language :: Python :: 3.9
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: gudhi>=3.8.0
Requires-Dist: leidenalg>=0.9.0
Requires-Dist: matplotlib==3.10.3
Requires-Dist: mpl_point_clicker
Requires-Dist: numpy>=1.23.4
Requires-Dist: pandas>=2.2.0
Requires-Dist: pot>=0.8.0
Requires-Dist: scanpy==1.11.2
Requires-Dist: scipy>=1.9.1
Requires-Dist: scikit-learn>=1.5.1
Requires-Dist: tqdm>=4.67
Requires-Dist: importlib-metadata
Dynamic: license-file


# 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 the file to use our clickable graphical interface. When using the point_and_click.py interface, update the directory where your data is stored by changing this line:
```python
DATA = '/home/pbeamer/Documents/graphst/visium_hne_graphst'
```

Here we'll show a simple example with Visium DLPFC data, using default parameters.
First, import necessary components.
```python
import phd-ms
import scanpy
```
Preprocessing steps here (note that we assume a spatially-aware embedding has already been computed for your data):
```python
INPUT_FILE= '/home/pbeamer/Documents/graphst/adata_151673
phd_ms.tl.preprocess_leiden(INPUT_FILE,output_file=INPUT_FILE)
```
Compute persistent homology and plot 10 most prominent multiscale domains:
```python
cluster_complex,clusterings= phd_ms.tl.cluster_filtration(adata)
phd_ms.tl.map_multiscale(adata.obsm['spatial'],cluster_complex,clusterings,num_domains=10)
```
