@@ -20,9 +20,11 @@ def run_pca(
2020) -> AnnData | None :
2121 """\
2222 Wrap function scanpy.pp.pca
23+
2324 Principal component analysis [Pedregosa11]_.
2425 Computes PCA coordinates, loadings and variance decomposition.
2526 Uses the implementation of *scikit-learn* [Pedregosa11]_.
27+
2628 Parameters
2729 ----------
2830 data
@@ -38,12 +40,12 @@ def run_pca(
3840 Passing `None` decides automatically based on sparseness of the data.
3941 svd_solver
4042 SVD solver to use:
41- `'arpack'` (the default - deterministic)
42- for the ARPACK wrapper in SciPy (:func:`~scipy.sparse.linalg.svds`)
43- `'randomized'`
44- for the randomized algorithm due to Halko (2009).
45- `'auto'`
46- chooses automatically depending on the size of the problem.
43+
44+ - `'arpack'` (the default - deterministic) for the ARPACK wrapper in
45+ SciPy (:func:`~scipy.sparse.linalg.svds`)
46+ - `'randomized'` for the randomized algorithm due to Halko (2009).
47+ - `'auto'` chooses automatically depending on the size of the problem.
48+
4749 random_state
4850 Change to use different initial states for the optimization.
4951 return_info
@@ -52,7 +54,7 @@ def run_pca(
5254 use_highly_variable
5355 Whether to use highly variable genes only, stored in
5456 `.var['highly_variable']`.
55- By default uses them if they have been determined beforehand.
57+ By default, uses them if they have been determined beforehand.
5658 dtype
5759 Numpy data type string to which to convert the result.
5860 copy
@@ -65,22 +67,21 @@ def run_pca(
6567 chunk_size
6668 Number of observations to include in each chunk.
6769 Required if `chunked=True` was passed.
70+
6871 Returns
6972 -------
70- X_pca : :class:`~scipy.sparse.spmatrix`, :class:`~numpy.ndarray`
73+ X_pca: :class:`~scipy.sparse.spmatrix`, :class:`~numpy.ndarray`
7174 If `data` is array-like and `return_info=False` was passed,
72- this function only returns `X_pca`…
73- adata : anndata.AnnData
74- …otherwise if `copy=True` it returns or else adds fields to `adata`:
75- `.obsm['X_pca']`
76- PCA representation of data.
77- `.varm['PCs']`
78- The principal components containing the loadings.
79- `.uns['pca']['variance_ratio']`
80- Ratio of explained variance.
81- `.uns['pca']['variance']`
82- Explained variance, equivalent to the eigenvalues of the
83- covariance matrix.
75+ this function only returns `X_pca`.
76+ adata: anndata.AnnData
77+ Otherwise if `copy=True` it returns or else adds fields to `adata`:
78+
79+ - `.obsm['X_pca']` - PCA representation of data.
80+ - `.varm['PCs']` - The principal components containing the loadings.
81+ - `.uns['pca']['variance_ratio']` - Ratio of explained variance.
82+ - `.uns['pca']['variance']` - Explained variance, equivalent to the
83+ eigenvalues of the covariance matrix.
84+
8485 """
8586
8687 adata = scanpy .pp .pca (
0 commit comments