
Pipeline step: PCA
step_pca_sc.RdWraps calculate_pca_sc() as an ScStep.
Usage
step_pca_sc(
no_pcs = 30L,
pca_params = params_sc_pca(),
sparse_svd = FALSE,
hvg = NULL,
seed = 42L,
.verbose = TRUE
)Arguments
- no_pcs
Integer. Number of PCs to calculate.
- pca_params
Named list. Controls the parameters to be used for the PCA calculation which is single cell-specific, see
params_sc_pca()- sparse_svd
Boolean. Shall sparse solvers be used that do not do scaling. If set to yes, in the case of
random_svd = FALSE, Lanczos iterations are used to solve the sparse SVD. Withrandom_svd = TRUE, the sparse initial matrix is multiplied with the random matrix, yielding a much smaller dense matrix that does not increase the memory pressure massively. Not used forMetaCells.- hvg
Optional integer. If you want to provide your own HVG genes. Otherwise, the function will default to what is found in
get_hvg(). Please provide 1-indexed genes here! If you provide these, the internal HVG will be overwritten.- seed
Integer. Controls reproducibility. Only relevant if
randomised_svd = TRUE.- .verbose
Boolean or integer. Controls verbosity and returns run times.
FALSE-> quiet,TRUEor1L-> normal verbosity,2L-> detailed verbosity.
Examples
# PCA restricted to whatever the HVG step selected
step_hvg_sc(hvg_no = 30L) %>>% step_pca_sc(no_pcs = 10L)
#> <ScPipeline> 2 steps
#> 1. hvg hvg_no = 30L, hvg_params = <list>, streaming = NULL, .verbose = TRUE
#> 2. pca no_pcs = 10L, pca_params = <list>, sparse_svd = FALSE, hvg = NULL, seed = 42L, .verbose = TRUE