Description Usage Arguments Value Examples
View source: R/calculation-functions.R
Calculates the fraction of samples within each class that contains a given feature. Only the minimum fraction across all sample classes is returned.
1 | calc_minfrac(Sample.df, xset4, BLANK, Peak.list)
|
Sample.df |
a data frame with class info as columns. Must contain a
separate row entry for each unique sex and class combination. Must contain
the columns |
xset4 |
an xcms object that has had peak picking, retention time alignment, peak grouping, and imputing missing values performed |
BLANK |
a logical indicating whether blanks are being evaluated |
Peak.list |
a table of class 'tbl_df',tbl' or 'data.frame' with
variables as columns. Should contain all output columns from |
data frame containing the original table with one additional column 'Minfrac' at the end, followed by the CAMERA columns 'isotopes','adduct','pcgroup'
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(LUMA)
if(require(lcmsfishdata, quietly = TRUE)) {
file <- system.file('extdata','XCMS_objects_Pos.Rdata', package =
"lcmsfishdata") # is case sensitive on Linux
load(file)
# case sensitive on Linux
file2 <- system.file('extdata','Sample_Class.txt', package = "LUMA") # is
Sample.df <- read.table(file2, sep = "\t", header = TRUE)
Peak.list <- lcmsfishdata::Peaklist_Pos$From_CAMERA
test <- calc_minfrac(Sample.df = Sample.df, xset4 = xset4, BLANK = FALSE,
Peak.list = Peak.list)
test[["MinFrac"]][11:23]
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.