batch_separation: Compute the batch separation metric

Description Usage Arguments Value Examples

View source: R/benchmarking.R

Description

Compute the batch separation metric

Usage

1
batch_separation(emb, batch)

Arguments

emb

the embedding of the cells where each row is a cell, and each column is a feature (e.g. principal component)

batch

the batch labels of the cells

Value

Cohen's kappa of the the predicted batch labels with the true batch label on the entire dataset (i.e., training accuracy)

Examples

1
2
3
4
5
6
# suppose that iris[["Species"]] are the batch labels
batch_separation(emb = iris[,1:2],batch = iris$Species) # lower batch separation present in dim = 1:2
plot(iris[,1],iris[,2],col = iris[["Species"]])

batch_separation(emb = iris[,3:4],batch = iris$Species) # higher batch separation in dim = 3:4
plot(iris[,3],iris[,4],col = iris[["Species"]])

YutongWangUMich/corgi documentation built on Oct. 26, 2019, 1:13 p.m.