Description Usage Arguments Value Examples
View source: R/parser-functions.R
Parses the CAMERA results using well-defined rules to eliminate conflicting annotations.
1 | parse_neg_results(raw, rule, IonMode)
|
raw |
a data frame with variables as columns. Should contain all output
columns from XCMS and CAMERA, additional columns from |
rule |
a data frame containing the rule list used by CAMERA to annotate
ion adducts and fragments. Must contain the columns
|
IonMode |
a character string defining the ionization mode. Must be
|
data frame parsed version of the original data frame with additional
columns
"mono_mass"
,"metabolite_group"
,"monoisotopic_flg"
,
"adduct_flg"
,"isotope_flg"
,"ambiguity_flg"
,"Selection_flg"
.
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(LUMA)
if(require(lcmsfishdata, quietly = TRUE)) {
file <- system.file("extdata","primary_adducts_neg.csv", package =
"lcmsfishdata") # is case sensitive on Linux
rules <- read.csv(file, header = TRUE)
Peak.list <- as.data.frame(lcmsfishdata::Peaklist_Neg[["Annotated"]])
test <- parse_neg_results(raw = Peak.list, rule = rules, IonMode = "Negative")
colnames(test)[-which(colnames(test) %in% colnames(Peak.list))] ##Adds the following columns
length(unique(Peak.list[["pcgroup"]])) #Originally were this many metabolite groupings
length(unique(test[["metabolite_group"]])) #Now there are many more metabolite groupings
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.