combine_phenodata: Combine phenotype data in Peak.list

Description Usage Arguments Value Examples

View source: R/parser-functions.R

Description

Combine phenotype data for each metabolite group in Peak.list with summed intensity values

Usage

1
2
3
4
5
6
7
8
9
combine_phenodata(
  Sample.df,
  Peak.list,
  Summed.list,
  search.par,
  QC.id,
  BLANK,
  IonMode
)

Arguments

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 "Sex","Class","n","Endogenous".

Peak.list

data frame. Must have the columns "Correlation.stat", "metabolite_group", "mono_mass". Should contain output columns from XCMS and ]codeCAMERA, and additional columns from functions match_Annotation(), calc_minfrac(), CAMERAParser(), plot_metgroup().

Summed.list

data frame containing metabolite group as first column and the rest summed intensities for each sample

search.par

a single-row data frame with 11 variables containing user-defined search parameters. Must contain the columns "ppm","rt","Voidrt","Corr.stat.pos","Corr.stat.neg", "CV","Minfrac", "Endogenous", "Solvent","gen.plots", "keep.singletons".

QC.id

character vector specifying identifier in filename designating a Pooled QC sample. Only the first value will be used. Default is "Pooled_QC_"

BLANK

a logical indicating whether blanks are being evaluated

IonMode

a character string defining the ionization mode. Must be one of c("Positive","Negative").

Value

Peak.list.summed with the munged phenotype columns up front followed by QC and sample columns

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(LUMA)
file <- system.file('extdata','Search_Parameters.txt', package = "LUMA") # is
# case sensitive on Linux
search.par <- read.table(file, sep = "\t", header = TRUE) #Ignore Warning message
file2 <- system.file('extdata','Sample_Class.txt', package = "LUMA") # is
# case sensitive on Linux
Sample.df <- read.table(file2, sep = "\t", header = TRUE) #Ignore Warning message
Peak.list <- LUMA::Peaklist_Pos$output_parsed
Summed.list <- sum_features(Peak.list = Peak.list, Sample.df = Sample.df ,
                       search.par = search.par, BLANK = FALSE, IonMode = "Positive")
test <- combine_phenodata(Sample.df = Sample.df, Peak.list = Peak.list,
Summed.list = Summed.list, search.par = search.par, BLANK = FALSE, IonMode =
"Positive")
nrow(Peak.list) - nrow(test) ##Combines multiple features into single entries per metabolite

USEPA/LUMA documentation built on Aug. 29, 2020, 1:40 p.m.