compdist: Computing a distance matrix for cell type inference

View source: R/RaceID.R

compdistR Documentation

Computing a distance matrix for cell type inference

Description

This functions computes the distance matrix used for cell type inference by RaceID3.

Usage

compdist(
  object,
  metric = "pearson",
  FSelect = TRUE,
  knn = NULL,
  alpha = 1,
  no_cores = 1
)

Arguments

object

SCseq class object.

metric

Distances are computed from the filtered expression matrix after optional feature selection, dimensional reduction, and/or transformation (batch correction). Possible values for metric are spearman, pearson, logpearson, euclidean, kendall. Default is "pearson". In case of the correlation based methods, the distance is computed as 1 – correlation.

FSelect

Logical parameter. If TRUE, then feature selection is performed prior to RaceID3 analysis. Default is TRUE.

knn

Positive integer number of nearest neighbours used for imputing gene expression values. Default is NULL and no imputing is done.

alpha

Positive real number. Relative weight of a cell versus its k nearest neigbour applied for imputing gene expression. A cell receives a weight of alpha while the weight of its k nearest neighbours is determined by quadratic programming. The sum across all weights is normalized to one, and the wieghted mean expression is used for computing the joint probability of a cell and each of its k nearest neighbours. These probabilities are applied for the derivation of the imputed gene expression for each cell. Default is 1. Larger values give more weight to the gene expression observed in a cell versus its neighbourhood.

no_cores

Positive integer number. Number of cores for multithreading during imputation. If set to NULL then the number of available cores minus two is used. Default is 1.

Value

SCseq object with the distance matrix in slot distances. If FSelect=TRUE, the genes used for computing the distance object are stored in slot cluster$features.

Examples

sc <- SCseq(intestinalDataSmall)
sc <- filterdata(sc)
sc <- compdist(sc)

RaceID documentation built on Sept. 28, 2023, 5:06 p.m.