API Overview

Import the ucdeconvolve package using import ucdeconvolve as ucd. The package contains four main modules, described in detail below.

Note

Authenticate a new python session using ucd.api.authenticate

API: api

API functions allow for user registration, account activation and authentication for service invocation.

api.register([username, password, ...])

Registers a New User

api.activate([code])

Activate User Account

api.authenticate(token)

Authenticate

Tools: tl

Tools module contains the three primary prediction functions of ucdeconvolve.

tl.base(data[, token, split, sort, ...])

UniCell Deconvolve: Base

tl.explain(data, celltypes[, groupby, ...])

UniCell Deconvolve: Explain

tl.select(data, reference[, token, ...])

UniCell Deconvolve: Select

Plotting: pl

Plotting functions for embedding and spatial are designed to interface as wrappers around scanpy functions such as sc.pl.embedding and sc.pl.spatial with additional functionality to enable construciton of plots similar to those in the ucdeconolve paper.

pl.embedding(adata[, basis, color, key, ...])

Plot Deconvolution

pl.spatial(adata[, color, key, category, ...])

Plot Spatial

pl.base_clustermap(adata[, groupby, ...])

Plot Clustered heatmap of top celltype predictions grouped by a column in 'adata.obs'

pl.explain_boxplot(adata[, key, celltypes, ...])

Plot Boxplots of Feature Attributions By Gene

pl.explain_clustermap(adata[, key, n_top_genes])

Plot Explanation Results as Clustermap

Utilities: utils

Utilities module contains useful functions for interfacing with results of deconvolution functions and preparing prediction queries.

utils.read_results(adata[, key, category, ...])

Read deconvolution results from an annotated dataset and return a dataframe.

utils.assign_top_celltypes(adata[, key, ...])

Gets top deconvolution predictions by cluster.

utils.get_base_celltypes([root, category, ...])

Get UCDBase CellTypes

utils.get_prebuilt_reference(reference[, ...])

Get Prebuilt Reference

utils.list_prebuilt_references([token])

List Prebuilt References

Compatability: compat

The compatability module allows for users of earlier builds of ucdeconvolve who have existing workflows to continue leveraging legacy code with minimal required changes.

Warning

This module will be removed in the near future.

compat.deconvolve(data, token[, split, ...])

UniCell Deconvolve

compat.read_results(adata[, category, key])

Read deconvolution results from an annotated dataset and return a dataframe.