msmu.tl.pca
Perform Principal Component Analysis (PCA) on the specified modality of the MuData object.
References
Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., ... & Duchesnay, E. (2011). Scikit-learn: Machine learning in Python. Journal of machine learning research, 12(Oct), 2825-2830.
Andrzej M., Waldemar R. (1993). Principal Component Analysis (PCA). Computers & Geosciences, 19(3), 303-342.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mdata
|
MuData
|
MuData object containing the data. |
required |
modality
|
str
|
The modality to perform PCA on. |
required |
layer
|
str | None
|
Layer to use for quantification aggregation. If None, the default layer (.X) will be used. Defaults to "scaled". |
None
|
n_components
|
int | None
|
Number of components to keep. if n_components is not set all components are kept:: If If If Hence, the None case results in: |
None
|
svd_solver
|
Literal['auto', 'full', 'arpack', 'randomized']
|
"auto":
The solver is selected by a default 'auto' policy is based on "full" :
Run exact full SVD calling the standard LAPACK solver via
"arpack" :
Run SVD truncated to "randomized" : Run randomized SVD by the method of Halko et al. |
'auto'
|
random_state
|
int | None
|
Used when the 'arpack' or 'randomized' solvers are used. Pass an int for reproducible results across multiple function calls. |
0
|
key_added
|
str
|
Base key used for PCA outputs. Results are stored in:
- |
'X_pca'
|
**kwargs
|
Any
|
Additional keyword arguments passed to PCA constructor. |
{}
|
Returns:
| Type | Description |
|---|---|
MuData
|
Updated MuData object with PCA results. |