norm_factors: Create normalization factors.

Description Usage Arguments Value Examples

Description

Using either raw data from BeadStudio or MethyLumiSet data, this function creates normalization factors using either all subjects' means or a subset.

Usage

1
2
norm_factors(controldata, subjects = NULL, methylumidata = NULL,
  type = "raw")

Arguments

controldata

A data.frame containing the red and green color channels for all control samples in raw format output from BeadStudio. May also contain detection p-values for each subject. Must contain a column called TargetID, which contains the CpG site identifiers. Either this or methylumidata must be supplied.

subjects

Optional. User can specify the index or names of a given subject or range of subjects to use in the creation of the normalization factors as oppposed to using all the samples.

methylumidata

A MethyLumiSet object containing control data (which can be accessed using the normctls function). See the vignette for this package for an example using this type of data.

type

One of either "raw" (default) or "methylumi" indicating the type of data supplied by the user.

Value

A list of length two containing the normalization factors for each subject in each color channel.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
ids <- seq(from = 10, to = 59)
n <- length(ids)
reds.s <- data.frame(matrix(rep(round(abs(rnorm(n, 4, 1))), 30), nrow=30))
names(reds.s) <- paste("X", ids, ".Signal_Red", sep = "")
greens.s <- data.frame(matrix(rep(round(abs(rnorm(n, 5, 2))), 30), nrow = 30))
names(greens.s) <- paste("X", ids, ".Signal_Grn", sep = "")
dat <- data.frame(reds.s, greens.s)
dat <- dat[,order(names(dat))]
indices <- sample(1:30, 30, replace = FALSE)
TargetID.s <- rep(NA, 30)
TargetID.s[indices[1:9]] <- "NORM_A"
TargetID.s[indices[10:18]] <- "NORM_T"
TargetID.s[indices[19:25]] <- "NORM_C"
TargetID.s[indices[25:30]] <- "NORM_G"
controldata.s <- data.frame(TargetID = TargetID.s, dat)

normfactors <- norm_factors(controldata=controldata.s, subjects=NULL, type = "raw")
normfactors <- norm_factors(controldata=controldata.s, subjects=1, type = "raw")

asmn documentation built on Sept. 12, 2016, 6:13 a.m.

Related to norm_factors in asmn...