Skip to contents

Wraps find_neighbours_sc() as an ScStep.

Usage

step_neighbours_sc(
  embd_to_use = "pca",
  no_embd_to_use = NULL,
  modality = c("rna", "adt"),
  neighbours_params = params_sc_neighbours(),
  seed = 42L,
  .verbose = TRUE
)

Arguments

embd_to_use

String. The embedding to use. Whichever you chose, it needs to be part of the object.

no_embd_to_use

Optional integer. Number of embedding dimensions to use. If NULL all will be used.

modality

String. One of c("rna", "adt"). You can only use "adt" on SingleCellsMultiModal class.

neighbours_params

List. Output of params_sc_neighbours(). A list with the following items:

  • full_snn - Boolean. Shall the full shared nearest neighbour graph be generated that generates edges between all cells instead of between only neighbours.

  • pruning - Numeric. Weights below this threshold will be set to 0 in the generation of the sNN graph.

  • snn_similarity - String. One of c("rank", "jaccard"). Defines how the weight from the SNN graph is calculated. For details, please see params_sc_neighbours().

  • knn - List of kNN parameters. See params_knn_defaults() for available parameters and their defaults.

seed

Integer. For reproducibility.

.verbose

Boolean or integer. Controls verbosity and returns run times. FALSE -> quiet, TRUE or 1L -> normal verbosity, 2L -> detailed verbosity.

Value

An ScStep.

Examples

# neighbours on the PCA embedding
step_pca_sc(no_pcs = 10L) %>>% step_neighbours_sc()
#> <ScPipeline> 2 steps
#>   1. pca         no_pcs = 10L, pca_params = <list>, sparse_svd = FALSE, hvg = NULL, seed = 42L, .verbose = TRUE
#>   2. neighbours  embd_to_use = "pca", no_embd_to_use = NULL, modality = c("rna", "adt"), neighbours_params = <list>, seed = 42L, .verbose = TRUE