easydecon uses marker genes to deconvolve and assign cell types in spatial transcriptomics data.
python -m pip install easydeconFor 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 documentationStart 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.
