Metadata-Version: 2.4
Name: easydecon
Version: 0.1.7
Summary: Marker-gene based similarity and deconvolution utilities for single-cell and spatial transcriptomics
Author-email: "Sinan U. Umu" <sinanugur@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Sinan U. Umu
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/sinanugur/easydecon
Project-URL: Repository, https://github.com/sinanugur/easydecon
Keywords: single-cell,spatial transcriptomics,deconvolution,bioinformatics
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: scipy
Requires-Dist: scanpy
Requires-Dist: anndata
Requires-Dist: joblib
Requires-Dist: tqdm
Requires-Dist: scikit-learn
Requires-Dist: matplotlib
Provides-Extra: spatial
Requires-Dist: spatialdata; extra == "spatial"
Requires-Dist: spatialdata-io; extra == "spatial"
Requires-Dist: spatialdata-plot; extra == "spatial"
Provides-Extra: deseq
Requires-Dist: pydeseq2; extra == "deseq"
Provides-Extra: fast
Requires-Dist: fireducks; extra == "fast"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Provides-Extra: docs
Requires-Dist: sphinx>=6.2.1; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=2.0.0; extra == "docs"
Requires-Dist: myst-parser>=2.0.0; extra == "docs"
Provides-Extra: all
Requires-Dist: spatialdata; extra == "all"
Requires-Dist: spatialdata-io; extra == "all"
Requires-Dist: spatialdata-plot; extra == "all"
Requires-Dist: pydeseq2; extra == "all"
Requires-Dist: fireducks; extra == "all"
Requires-Dist: pytest; extra == "all"
Requires-Dist: pytest-cov; extra == "all"
Dynamic: license-file

<img src="easydecon-logo.png" alt="easydecon logo" width="130" />

[![PyPI version](https://badge.fury.io/py/easydecon.svg)](https://badge.fury.io/py/easydecon)

# easydecon

easydecon uses marker genes to deconvolve and assign cell types in spatial
transcriptomics data.

## Installation

```bash
python -m pip install easydecon
```

For development and testing:

```bash
python -m pip install -e ".[test]"
```

Optional extras:

```bash
python -m pip install -e ".[spatial]"  # SpatialData support
python -m pip install -e ".[deseq]"    # pseudobulk PyDESeq2 markers
python -m pip install -e ".[docs]"     # build the documentation
```

## Quickstart

Start with a spatial AnnData table (or a SpatialData object) and a CSV or
Excel marker file. The file needs `group` and `names` columns: `group` is the
cell type and `names` is the marker gene. Gene names in the file must match
the spatial table's `var_names`.

```python
import easydecon as ed

result = ed.run_easydecon(
    sdata=sdata,
    filename="markers.csv",
    return_result_object=True,
    verbose=False,
)

print(result.posterior_df.head())
print(result.assigned_labels.head())
print(result.diagnostics)
```

`posterior_df` shows the relative support for each tested cell type. It is not
necessarily an absolute cell-fraction estimate. `assigned_labels` gives a
single label per location, so it does not retain that uncertainty. Review the
diagnostics before using the assignments downstream.

## Documentation

Begin with [docs/index.rst](docs/index.rst). Useful guides include:

* [installation and quickstart](docs/usage.rst)
* [workflow concepts](docs/workflow.md)
* [marker inputs](docs/marker_inputs.md)
* [results and interpretation](docs/results.md)
* [Scanpy markers](docs/scanpy_markers.md)
* [reference-profile markers](docs/reference_markers.md)
* [Phase 1](docs/phase1.md) and [Phase 2](docs/phase2.md)
* [refinement](docs/refinement.md)
* [visualization](docs/visualization.md)
