- 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 AnnData object first with PCA, followed by non-linear dimension reduction methods
AnnData) – An AnnData object.
int) – Number of input PCs (principal 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. Defaults to 30.
int) – The dimension of the space to embed into. Defaults to 2.
int) – The number of nearest neighbors when constructing adjacency matrix. Defaults to 30.
str) – Non-linear dimension reduction method to further reduce dimension based on the top n_pca_components PCA components. Currently, PSL (probabilistic structure learning, a new dimension reduction by us), tSNE (fitsne instead of traditional tSNE used) or umap are supported. Defaults to “umap”.
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”. Defaults to None.
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”. Defaults to None.
bool) – Whether to re-perform dimension reduction even if there is reduced basis in the AnnData object. Defaults to False.
int) – The number of cores used for calculation. Used only when tSNE reduction_method is used. Defaults to 1.
bool) – Whether to return a copy of the AnnData object or update the object in place. Defaults to False.
kwargs – Other kwargs that will be passed to umap.UMAP. for umap, min_dist is a noticeable kwargs that would significantly influence the reduction result.
- Return type:
An updated AnnData object updated with reduced dimension data for data from different layers, returned if copy is true.