Description Usage Arguments Value Examples
View source: R/plotting-functions.R
Plots EICs and Pseudospectra from parsed metabolite groups using
plotEICs-methods()
and plotPsSpectrum-methods()
from
CAMERA
. Also plots correlation matrices and clustered dendrograms
for each parsed metabolite group.
1 2 3 4 5 6 7 8 9 10 11 12 | plot_metgroup(
CAMERA.obj,
Sample.df,
Peak.list,
center,
BLANK,
gen.plots,
IonMode,
file.base,
QC.id,
maxlabel
)
|
CAMERA.obj |
|
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. Must contain
all output columns from |
center |
numeric value indicating which sample to pick for plotting purposes |
BLANK |
a logical indicating whether blanks are being evaluated. Default
is |
gen.plots |
a logical indicating whether to create plots for metabolite
groups. Default is |
IonMode |
a character string defining the ionization mode. Must be one
of |
file.base |
character string used to name graphical output. Will be
appended with |
QC.id |
character identifier for pooled QC samples. Default is
|
maxlabel |
numeric How many m/z labels to print |
List of length 2. 1st element is a data frame with all columns as
the original data frame with column "Correlation.stat"
. 2nd element
is a list of objects used to validate CAMERA results.
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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | library(LUMA)
if(require(lcmsfishdata, quietly = TRUE)) {
# is case sensitive on Linux
file <- system.file("extdata","Sample_Class.txt", package = "lcmsfishdata")
Sample.df <- read.table(file, header = TRUE, sep = "\t")
file2 <- system.file("extdata","CAMERA_objects_Pos.Rdata", package =
"lcmsfishdata") # is case sensitive on Linux
load(file2, envir = environment())
Peak.list <- lcmsfishdata::Peaklist_Pos[["input_parsed"]]
# is case sensitive on Linux
file3 <- system.file("extdata","Sample_Data.csv", package = "lcmsfishdata")
sample_data <- read.table(file3, header = TRUE, sep = ",")
mzdatafiles <- sample_data$CT.ID
file.base <- gen_filebase(mzdatafiles = mzdatafiles, BLANK = FALSE, IonMode
= "Positive", ion.id = c("Pos","Neg"))
test <- plot_metgroup(CAMERA.obj = anposGa, Sample.df = Sample.df,
Peak.list = Peak.list, center = 2, BLANK = FALSE, gen.plots = FALSE,
IonMode = "Positive", file.base = file.base, QC.id = "Pooled_QC_", maxlabel
= 10)
class(test) ##is list
length(test) ## with 2 elements
test2 <- test[[1]]
colnames(test2)[(which(!colnames(test2) %in% colnames(Peak.list)))] #Adds new column
test2[["Correlation.stat"]][1:10]
## Not run:
#Runs with pdf plotting. This requires access to raw datafiles and won't
#work with lcmsfishdata. Better to use your own data here.
test <- plot_metgroup(CAMERA.obj = anposGa, Sample.df = Sample.df,
Peak.list = Peak.list, center = 2, BLANK = FALSE, gen.plots = TRUE, IonMode
= "Positive", file.base = file.base, QC.id = "Pooled_QC_", maxlabel = 10)
## End(Not run)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.