Skip to contents

Computes repeatability for each feature with the following formula: $$\frac{\sigma^2_{between}}{\sigma^2_{between} + \sigma^2_{within}}$$ The repeatability ranges from 0 to 1. Higher repeatability depicts less variation between batches.

Usage

perform_repeatability(object, group, assay.type = NULL)

Arguments

object

a SummarizedExperiment or MetaboSet object

group

column name of pheno data giving the group labels

assay.type

character, assay to be used in case of multiple assays

Value

A data frame with one row per feature with the repeatability measure.

Examples

data(example_set)
# Batch correction
replicates <- list(which(example_set$QC == "QC"))
batch_corrected <- ruvs_qc(example_set, replicates = replicates)
# Evaluate batch correction
rep_orig <- perform_repeatability(example_set, group = "Group")
mean(rep_orig$Repeatability, na.rm = TRUE)
#> [1] 0.3658633
rep_corr <- perform_repeatability(batch_corrected, group = "Group")
mean(rep_corr$Repeatability, na.rm = TRUE)
#> [1] 0.4051463