check_batch_effects: Check for batch effects

View source: R/check_batch_effects.R

check_batch_effectsR Documentation

Check for batch effects

Description

Pairwise associations between each of the first three components of a MDS or PCA analysis and defined phenotype variables is tested using F tests in a linear model. P-values are visualized in a heatmap (called prince plot in the R package swamp).

Usage

check_batch_effects(se, res.pca, col.test = NULL, title = NULL)

Arguments

se

RangedSummarizedExperiment-class object

res.pca

List. Output of calculate_mds_pca.

col.test

Character or integer vector. Column(s) in colData() with phenotype information to be tested.

title

Character. Title of the plot.

Value

List with the following components:

  • pval: Matrix with P-values between phenotype variables in rows and components in columns

  • r2: Matrix with absolute adjusted r^2 values between phenotype variables in rows and components in columns

  • plot: Plot with heatmaps as returned from the ggarrange function

Examples

data("se.gene")

res.pca = calculate_mds_pca(se = se.gene,
                            method = "pca")

col.test = c("Age.of.patient",
             "Body.surface.area",
             "Duration.of.psoriasis",
             "Induration",
             "Overall.erythema",
             "Scaling",
             "Sex",
             "scan.date")

check_batch_effects(se = se.gene,
                    res.pca = res.pca,
                    col.test = col.test)

szymczak-lab/QCnormSE documentation built on March 25, 2023, 1:05 p.m.