calculate_silhouette_width: Calculate silhouette width scores from a merged SCE object.

View source: R/calculate_silhouette_width.R

calculate_silhouette_widthR Documentation

Calculate silhouette width scores from a merged SCE object.

Description

This function performs replicated calculations on downsampled data.

Usage

calculate_silhouette_width(
  merged_sce,
  pc_names,
  batch_column = "library_id",
  frac_cells = 0.8,
  nreps = 20,
  seed = NULL
)

Arguments

merged_sce

The merged SCE object containing data from multiple batches

pc_names

A list of names that allow access to the PCs in the merged SCE object. Example: c("PCA", "fastMNN_PCA").

batch_column

The variable in 'merged_sce' indicating the grouping of interest. Generally this is either batches or cell types. Default is "library_id".

frac_cells

The fraction of cells to downsample to. Default: 0.8

nreps

The number of times to repeat sub-sampling procedure. Default: 20

seed

Seed for initializing random sampling

Value

Tibble with five columns: 'rep', representing the given downsampling replicate; 'silhouette_width', the calculated silhouette width for the given 'rep'; 'silhouette_cluster', the assigned cluster for the cell during silhouette calculation, i.e. the true identity; 'other_cluster', the other assigned for the cell during silhouette calculation; 'pc_name', the name associated with the pc results


AlexsLemonade/scpcaTools documentation built on July 12, 2024, 8:34 a.m.