
Pipeline step: BBKNN batch correction
step_bbknn_sc.RdWraps bbknn_sc() as an ScStep.
Usage
step_bbknn_sc(
batch_column,
no_neighbours_to_keep = 5L,
embd_to_use = "pca",
no_embd_to_use = NULL,
bbknn_params = params_sc_bbknn(),
seed = 42L,
.verbose = TRUE
)Arguments
- batch_column
String. The column with the batch information in the obs data of the class.
- no_neighbours_to_keep
Integer. Maximum number of neighbours to keep from the BBKNN algorithm. Due to generating neighbours for each batch, there might be a large number of generated neighbours. This will only keep the top
no_neighbours_to_keepneighbours. Defaults to5L.- embd_to_use
String. The embedding to use. Atm, the only option is
"pca".- no_embd_to_use
Optional integer. Number of embedding dimensions to use. If
NULLall will be used.- bbknn_params
A list, please see
params_sc_bbknn(). The list has the following parameters:neighbours_within_batch - Integer. Number of neighbours to consider per batch.
set_op_mix_ratio - Numeric. Mixing ratio between union (1.0) and intersection (0.0).
local_connectivity - Numeric. UMAP connectivity computation parameter, how many nearest neighbours of each cell are assumed to be fully connected.
trim - Optional integer. Trim the neighbours of each cell to these many top connectivities. May help with population independence and improve the tidiness of clustering. If
NULL, it defaults to10 * neighbours_within_batch.knn - List of kNN parameters. See
params_knn_defaults()for available parameters and their defaults.
- seed
Integer. Random seed.
- .verbose
Boolean or integer. Controls verbosity and returns run times.
FALSE-> quiet,TRUEor1L-> normal verbosity,2L-> detailed verbosity.
Examples
# BBKNN replaces the graph outright, so nothing follows it
step_pca_sc(no_pcs = 10L) %>>%
step_bbknn_sc(batch_column = "batch_index")
#> <ScPipeline> 2 steps
#> 1. pca no_pcs = 10L, pca_params = <list>, sparse_svd = FALSE, hvg = NULL, seed = 42L, .verbose = TRUE
#> 2. bbknn batch_column = "batch_index", no_neighbours_to_keep = 5L, embd_to_use = "pca", no_embd_to_use = NULL, bbknn_params = <list>, seed = 42L, .verbose = TRUE