ComputekBET_ser: Compute kBET (k-nearest neighbor Batch Effect Test) for a...

View source: R/Seurat_based.R

ComputekBET_serR Documentation

Compute kBET (k-nearest neighbor Batch Effect Test) for a Seurat Object

Description

This function calculates the kBET (k-nearest neighbor Batch Effect Test) rejection rate to assess the batch effect correction for a Seurat object, based on a specified dimensional reduction (e.g., PCA, UMAP).

Usage

ComputekBET_ser(SerObj, reduction = "pca", dims = 1:15, batch.label = "batch")

Arguments

SerObj

A Seurat object containing the single-cell RNA-seq data.

reduction

Character. The dimensional reduction method to use for kBET computation (e.g., "pca", "umap"). Default is '"pca"'.

dims

Numeric vector. The dimensions of the reduced embedding to use. Default is '1:15'.

batch.label

Character. The metadata label representing batch information in 'SerObj@meta.data'. Default is '"batch"'.

Value

The mean kBET rejection rate. A lower rejection rate indicates better batch mixing and less batch effect.

Examples

# Compute kBET for PCA reduction using batch labels
kbet_score <- ComputekBET_ser(SerObj, reduction = "pca", dims = 1:15, batch.label = "batch")

# Compute kBET for UMAP reduction using batch labels
kbet_score <- ComputekBET_ser(SerObj, reduction = "umap", dims = 1:10, batch.label = "batch")


eisascience/scCustFx documentation built on June 2, 2025, 3:59 a.m.