detectBatchDiff: Detect batch/block differences

detectBatchDiffR Documentation

Detect batch/block differences

Description

Detect batch/block differences within analytical runs for each ionisation mode.

Usage

detectBatchDiff(x, by = "block", pthresh = 0.05)

## S4 method for signature 'Binalysis'
detectBatchDiff(x, by = "block", pthresh = 0.05)

## S4 method for signature 'MetaboProfile'
detectBatchDiff(x, by = "block", pthresh = 0.05)

Arguments

x

object of S4 class Binalysis or MetaboProfile

by

info class column to use for batch/block information

pthresh

p-value threshold for significance

Details

Analysis of Variance (ANOVA) is used to detect differences in total ion count (TIC) averages between batches/blocks.

Value

If no differences between batches are found then NULL is returned. If significant differences are found then a tibble is returned containing the ANOVA results for each ionisation mode and showing whether batch correction is needed.

Examples

## Retrieve file paths and sample information for example data
files <- metaboData::filePaths('FIE-HRMS','BdistachyonEcotypes',ask = FALSE)

info <- metaboData::runinfo('FIE-HRMS','BdistachyonEcotypes')

## Perform spectral binning
analysis <- binneR::binneRlyse(files, 
                               info, 
                               parameters = binneR::detectParameters(files))

## Detect batch differences
batch_diff <- detectBatchDiff(analysis)

## Display batch differences
batch_diff

jasenfinch/metaboMisc documentation built on July 31, 2023, 2:28 a.m.