spared.spot_features.compute_dim_red

spared.spot_features.compute_dim_red(adata: AnnData, from_layer: str) AnnData[source]

Compute dimensionality reductions and clusters

Simple wrapper around sc.pp.pca(), sc.pp.neighbors(), sc.tl.umap() and sc.tl.leiden() with default parameters to compute the embeddings and cluster the data. Everything will be computed using the expression matrix stored in adata.layers[from_layer].

Parameters:
  • adata (ad.AnnData) – The AnnData object to transform. Must have expression values in adata.layers[from_layer].

  • from_layer (str) – The key in adata.layers where the expression matrix is stored.

Returns:

The transformed AnnData object with the dimensionality reductions and clusters.

Return type:

ad.AnnData