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()andsc.tl.leiden()with default parameters to compute the embeddings and cluster the data. Everything will be computed using the expression matrix stored inadata.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.layerswhere the expression matrix is stored.
- Returns:
The transformed AnnData object with the dimensionality reductions and clusters.
- Return type:
ad.AnnData