mixMetric | R Documentation |
mixMetric
mixMetric(
sce,
group,
k = 300,
dim_red = "PCA",
assay_name = "logcounts",
n_dim = 10,
k_pos = 5,
res_name = NULL
)
sce |
|
group |
Character. Name of group/batch variable.
Needs to be one of |
k |
Numeric. Number of k-nearest neighbours (knn) to use. |
dim_red |
Character. Name of embeddings to use as subspace for distance distributions. Default is "PCA". |
assay_name |
Character. Name of the assay to use for PCA. Only relevant if no existing 'dim_red' is provided. |
n_dim |
Numeric. Number of dimensions to include to define the subspace. |
k_pos |
Position of the cell, which rank to use for scoring, defaults to 5. |
res_name |
Character. Appendix of the result score's name (e.g. method used to combine batches). |
The mixMetric function implements the mixingMetric function from
Seurat (See MixingMetric
. It takes the median rank of
the '__k_pos__ neighbour from each batch as estimation for the data's entropy
according to the batch variable. The same result can be assesed using the
MixingMetric
function and a seurat object from the
__Seurat__ package.
A SingleCellExperiment
with the mixing metric within colData.
Stuart T Butler A Hoffman P Hafemeister C Papalexi E et. al. (2019) Comprehensive Integration of Single-Cell Data. Cell.
library(SingleCellExperiment)
sim_list <- readRDS(system.file("extdata/sim50.rds", package = "CellMixS"))
sce <- sim_list[[1]][, c(1:15, 400:420, 16:30)]
sce <- mixMetric(sce, "batch", k = 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.