dynamo.tl.reduceDimension¶
-
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', enforce=False, cores=1, **kwargs)[source]¶ Compute a low dimension reduction projection of an annodata object first with PCA, followed by non-linear dimension reduction methods
- Parameters
adata (
AnnData
) – an Annodata objectX_data (np.ndarray (default: None)) – The user supplied data that will be used for dimension reduction directly.
genes (list or None (default: None)) – The list of genes that will be used to subset the data for dimension reduction and clustering. If None, all genes will be used.
layer (str or None (default: None)) – The layer that will be used to retrieve data for dimension reduction and clustering. If None, .X is used.
basis (str or None (default: None)) – The space that will be used for clustering. Valid names includes, for example, pca, umap, velocity_pca (that is, you can use velocity for clustering), etc.
dims (list or None (default: None)) – The list of dimensions that will be selected for clustering. If None, all dimensions will be used.
n_pca_components ('int' (optional, default 30)) – Number of PCA components.
n_components ('int' (optional, default 2)) – The dimension of the space to embed into.
n_neighbors ('int' (optional, default 30)) – Number of nearest neighbors when constructing adjacency matrix.
reduction_method ('str' (optional, default umap)) – 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.
cores (int (optional, default 1)) – Number of cores. Used only when the tSNE reduction_method is used.
- Returns
- Return type
Returns an updated adata with reduced dimension data for data from different layers.