- dynamo.tl.reduceDimension(adata, X_data=None, genes=None, layer=None, basis='pca', dims=None, n_pca_components=30, n_components=2, n_neighbors=30, reduction_method='umap', embedding_key=None, neighbor_key=None, enforce=False, cores=1, copy=False, **kwargs)
Compute a low dimension reduction projection of an annodata object first with PCA, followed by non-linear dimension reduction methods
AnnData) – an Annodata object
int) – Number of input PCs (principle components) that will be used for further non-linear dimension reduction.. If n_pca_components is larger than the existing #PC in adata.obsm[‘X_pca’] or input layer’s corresponding pca space (layer_pca), pca will be rerun with n_pca_components PCs requested.
int) – The dimension of the space to embed into.
int) – Number of nearest neighbors when constructing adjacency matrix.
str) – Non-linear dimension reduction method to further reduce dimension based on the top n_pca_components PCA components. Currently, PSL (probablistic structure learning, a new dimension reduction by us), tSNE (fitsne instead of traditional tSNE used) or umap are supported.
str]) – The str in .obsm that will be used as the key to save the reduced embedding space. By default it is None and embedding key is set as layer + reduction_method. If layer is None, it will be “X_neighbors”.
str]) – The str in .uns that will be used as the key to save the nearest neighbor graph. By default it is None and neighbor_key key is set as layer + “_neighbors”. If layer is None, it will be “X_neighbors”.
int) – Number of cores. Used only when the tSNE reduction_method is used.
adata – An new or updated anndata object, based on copy parameter, that are updated with reduced dimension data for data from different layers.
- Return type