This functions computes the distance matrix used for cell type inference by RaceID3.
compdist(
object,
metric = "pearson",
FSelect = TRUE,
knn = NULL,
alpha = 1,
no_cores = 1
)
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
.
SCseq
class object.
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.
Logical parameter. If TRUE
, then feature selection is performed prior to RaceID3 analysis. Default is TRUE
.
Positive integer number of nearest neighbours used for imputing gene expression values. Default is NULL
and no imputing is done.
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.
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.
sc <- SCseq(intestinalDataSmall)
sc <- filterdata(sc)
sc <- compdist(sc)
Run the code above in your browser using DataLab