Skip to content

Repository files navigation

easydecon logo

PyPI version

easydecon

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

Installation

python -m pip install easydecon

For development and testing:

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

Optional extras:

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.

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

Refer to https://easydecon.readthedocs.io/en/latest/

About

Fast cell-type transfer for high definition spatial assays

Resources

Stars

5 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages