Utility#

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

Transfer between Python and R#

utility.save_rds(path_rds[, batch_key, ...])

Save AnnData as Seurat or SingleCellExperiment Object.

utility.read_rds(path_rds, path_h5ad[, ...])

Read Rds object with Seurat or SingleCellExperiment Object.

General#

utility.free_memory()

Garbage collector.

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.

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.

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.