Utility

Utility#

The utility module is collection of functions useful for the analysis.

General#

utility.free_memory([cuda])

Garbage collector.

utility.create_report(log_file)

Create a report file.

utility.transfer_labels(adata_original, ...)

Transfer annotation from a subset AnnData to an AnnData.

utility.add_gene_metadata(data, gene_key[, ...])

Add gene metadata to AnnData or DataFrame.

utility.live_display([console, current, ...])

Decorator that displays a live status line and execution time for a function.

Plotting#

utility.generate_cmap(*args)

Generate a custom colormap.

utility.extended_tab20([n_shades])

Extends the colormap tab20 to more shades for a color.

utility.get_hex_colormaps(colormap)

Get a list with Hexa IDs for a colormap.

utility.spine_format(axis[, txt, fontsize])

Formatting the spines for embeddings.

utility.tab30()

Create a tab30 colormap.

Spatial#

utility.select_slide(adata, s[, s_col])

Subset a Spatial AnnData object.

utility.add_smooth_kernel(adata[, ...])

Compute a smooth kernel, i.e, expression matrix is smooth.