Description Usage Arguments Value Examples
View source: R/calculation-functions.R
Calculates the correlation matrices for metabolite groups based on the best feature within the group that belongs to the primary metabolite.
1 | calc_corrstat(Sample.df, Peak.list, get.mg, BLANK, IonMode)
|
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 |
Peak.list |
a data frame from CAMERA that has been parsed. Should
contain all output columns from XCMS and CAMERA, and additional columns
from |
get.mg |
numerical vector of metabolite groups that have more than one feature |
BLANK |
a logical indicating whether blanks are being evaluated |
IonMode |
a character string defining the ionization mode.
Must be one of |
Peak.list of class 'tbl_df','tbl' or 'data.frame'
with
variables as columns. Has all of the columns as the original data frame
with one additional column "Correlation.stat"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(LUMA)
if(require(lcmsfishdata, quietly = TRUE)) {
file <- system.file('extdata','CAMERA_objects_Pos.Rdata', package =
"lcmsfishdata") # is case sensitive on Linux
load(file)
pspec.length <- sapply(anposGa@pspectra, function(x) length(x))
get.mg <- which(pspec.length > 1)
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 <- lcmsfishdata::Peaklist_Pos$input_parsed
test <- calc_corrstat(Sample.df = Sample.df, Peak.list = Peak.list,
get.mg = get.mg, BLANK = FALSE, IonMode = "Positive")
test[["Correlation.stat"]][11:23]
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.