msmu.tl.pca
Perform principal component analysis (PCA) on the specified modality of the MuData object.
This uses the scikit-learn implementation described by
Pedregosa et al. (2011). For background on PCA, see
Maćkiewicz and Ratajczak (1993).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mdata
|
MuData
|
|
required |
modality
|
str
|
The modality to perform PCA on. |
required |
layer
|
str | None
|
Layer to use for quantification aggregation. If |
None
|
n_components
|
int | None
|
Number of components to keep.
if If If If Hence, the |
None
|
svd_solver
|
Literal['auto', 'full', 'arpack', 'randomized']
|
|
'auto'
|
random_state
|
int | None
|
Used when the |
0
|
key_added
|
str
|
Base key used for PCA outputs. Results are stored in:
- |
'X_pca'
|
**kwargs
|
Any
|
Additional keyword arguments passed to the |
{}
|
Returns:
| Type | Description |
|---|---|
MuData
|
Updated |
References
Pedregosa, F. et al. Scikit-learn: machine learning in Python. Journal of Machine Learning Research 12, 2825–2830 (2011). Full text.
Maćkiewicz, A. and Ratajczak, W. Principal components analysis (PCA). Computers & Geosciences 19, 303–342 (1993). https://doi.org/10.1016/0098-3004(93)90090-r.
Halko, N., Martinsson, P. G., and Tropp, J. A. Finding structure with randomness: probabilistic algorithms for constructing approximate matrix decompositions. SIAM Review 53, 217–288 (2011). https://doi.org/10.1137/090771806.