Skip to contents

Corrects intensity matrices using GAM fits on QC samples. Two modes:

  1. y ~ s(order)

  2. y ~ s(order, batch)

Usage

MetCorR(method = 2, int_data, order, class, batch, qc_label)

Arguments

method

Integer; 1 or 2. Default 2. 1 - one feature mode, only run order; 2 - two features mode, run order & batch index.

int_data

A data.frame of intensities (rows = samples, cols = features).

order

Numeric or coercible; injection order per sample (length = nrow(int_data)).

class

Character or factor; sample class/labels per sample (length = nrow(int_data)).

batch

Numeric or coercible; batch index per sample (length = nrow(int_data)). Required for method 2.

qc_label

Pattern used to identify QC rows in class via grep(qc_label, class).

Value

A numeric data.frame of corrected intensities (same dimnames as input).

Examples

if (FALSE) {
 data(example_intensity, package = "MetCorR")
 data(example_meta, package = "MetCorR")
 out <- MetCorR(
   method   = 2,
   int_data = example_intensity,
   order    = example_meta$order,
   class    = example_meta$class,
   batch    = example_meta$batch,
   qc_label = "QC"
 )
}