silhouette_width_from_pcs: Calculate silhouette width scores using PCs from a merged SCE...

View source: R/calculate_silhouette_width.R

silhouette_width_from_pcsR Documentation

Calculate silhouette width scores using PCs from a merged SCE object for use in integration metric calculations

Description

Calculate silhouette width scores using PCs from a merged SCE object for use in integration metric calculations

Usage

silhouette_width_from_pcs(
  merged_sce,
  pc_name,
  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_name

The name used to access the PCA results stored in the SingleCellExperiment object

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. Default is NULL.

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.