Description Usage Arguments Value Examples
View source: R/normalization-functions.R
Replaces zero values with half of the minimum value from all study samples and normalizes to unity
1 2 3 4 5 6 7 8 | replace_zeros_normalize(
Peak.list = NULL,
Sample.df,
tbl.id = NULL,
QC.id = "Pooled_QC_",
mult = 1000,
...
)
|
Peak.list |
a data frame containing combined ion mode peaklist with ion
mode duplicates removed. Alternatively can be retrieved from databases.
Default is |
Sample.df |
a data frame with class info as columns. Must contain a
separate row entry for each unique sex/class combination. Must contain the
columns |
tbl.id |
character vector of table names to draw from databases. First
value should be table name from positive ionization peak database, second
should be table name from negative ionization peak database. Default is
|
QC.id |
character vector specifying identifier in filename designating a
Pooled QC sample. Only the first value will be used. Default is
|
mult |
numeric multiplier to be added to unit normalization. Default is
|
... |
Arguments to pass parameters to database functions |
data frame containing normalized intensity matrix for all samples plus Pooled QCs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | library(LUMA)
if(require(lcmsfishdata, quietly = TRUE)) {
file <- system.file("extdata","Sample_Class.txt", package = "lcmsfishdata")
Sample.df <- read.table(file, header = TRUE, sep = "\t")
Peak.list <- lcmsfishdata::Peaklist_db$Peaklist_Combined_FINAL
QC.ID <- "Pooled_QC"
mult <- 1
test <- replace_zeros_normalize(Peak.list = Peak.list, Sample.df =
Sample.df, QC.id = QC.ID, mult = mult)
sum(test[,grep(QC.ID, colnames(test))]) # There are 11 Pooled QC samples,
# each with unit normalized intensity values
mult2 <- 1000
test2 <- replace_zeros_normalize(Peak.list = Peak.list, Sample.df =
Sample.df, QC.id = QC.ID, mult = mult2)
sum(test2[,grep(QC.ID, colnames(test))]) #Now they are each normalized to 1000
test_pos <- test[grep("Pos",test[["Ion.Mode"]]),grep(QC.ID, colnames(test))]
test_neg <- test[grep("Neg",test[["Ion.Mode"]]),grep(QC.ID, colnames(test))]
sum(test_pos) == sum(test_neg) #Ion modes are given equal weighting
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.