matrix_normalise: Normalize Arrays

View source: R/normalisation_functions.R

matrix_normaliseR Documentation

Normalize Arrays

Description

Normalize Arrays

Usage

matrix_normalise(
  matrix_antigen,
  method = "log2",
  batch_correct = FALSE,
  batch_var1,
  batch_var2 = day_batches,
  return_plot = FALSE,
  plot_by_antigen = TRUE,
  control_antigens = NULL,
  array_matrix = NULL
)

Arguments

matrix_antigen

An object of class matrix with features/proteins as columns and samples as the rows

method

character string specifying the normalization method. Choices are "none","log2","vsn","cyclic_loess" "cyclic_loess_log" ,"rlm"

batch_correct

A logical value indicating whether batch correction should be done or not

batch_var1

A character or factor vector of size similar to rows of matrix_antigen indicating the first batch.

batch_var2

A character or factor vector of size similar to rows of matrix_antigen indicating the second batch.

return_plot

A logical value indicating whether a plot is returned to show the results of normalisation.

plot_by_antigen

Logical to indicate whether to plot by antigen or not slide name for the matrix_antigen object.

control_antigens

logical vector specifying the subset of spots which are non-differentially-expressed control spots, for use with method="rlm"

array_matrix

An object of class dataframe or matrix used with method='rlm' indicating the sample index and

Value

A data frame of normalised values

Examples

matrix_antigen <- readr::read_csv(system.file("extdata", 
"matrix_antigen.csv", package="protGear"))
#VSN
normlise_vsn <- matrix_normalise(as.matrix(matrix_antigen),
method = "vsn",
return_plot = TRUE
)
## log
normlise_log <- matrix_normalise(as.matrix(matrix_antigen),
method = "log2",
return_plot = TRUE
)
## cyclic_loess_log
normlise_cylic_log <- matrix_normalise(as.matrix(matrix_antigen),
method = "cyclic_loess_log",
return_plot = TRUE
)

Keniajin/protGear documentation built on Feb. 6, 2023, 6:28 p.m.