Title: | Read and Preprocess Fluorescence Excitation-Emission Matrix (EEM) Data |
---|---|
Description: | Read raw EEM data and prepares them for further analysis. |
Authors: | Vipavee Trivittayasil |
Maintainer: | Vipavee Trivittayasil <[email protected]> |
License: | GPL-3 |
Version: | 1.1.1.9000 |
Built: | 2025-02-22 03:09:35 UTC |
Source: | https://github.com/chengvt/eem |
Subset EEM list
## S3 method for class 'EEM' x[i, ...]
## S3 method for class 'EEM' x[i, ...]
x |
EEM class object |
i |
indices specifying elements to extract |
... |
arguments for |
data(applejuice) selected <- applejuice[1-5]
data(applejuice) selected <- applejuice[1-5]
Apples of each of six types (Aomori–Fuji, Aomori–Jona, Aomori–Ohrin, NZ–Envy, NZ–Jazz, NZ–Fuji) were blended and filtered using a gauze. Fluorescence profiles of complete excitation–emission matrix of filtered solutions (diluted with water to 147 times) were measured using fluorescence spectroscopy machines. The sample name refers to "type–fruit number–replicate". To save space, only two apples of each types were given in the dataset.
data("applejuice")
data("applejuice")
data(applejuice) summary(applejuice)
data(applejuice) summary(applejuice)
Smooth out the difference dimensions of EEM data by finding the common variables of all data and subset those data.
commonizeEEM(EEM)
commonizeEEM(EEM)
EEM |
a list containing EEM data as created by |
EEM class object with only common variables
data(gluten) data(applejuice) data <- c(gluten, applejuice) summary(data) # different dimensions data_combined <- commonizeEEM(data) summary(data_combined) # same dimension, ready for unfold
data(gluten) data(applejuice) data <- c(gluten, applejuice) summary(data) # different dimensions data_combined <- commonizeEEM(data) summary(data_combined) # same dimension, ready for unfold
Cut portions of EEM
cutEEM(x, cutEX = NULL, cutEM = NULL) ## S3 method for class 'EEM' cutEEM(x, cutEX = NULL, cutEM = NULL) ## S3 method for class 'EEMweight' cutEEM(x, cutEX = NULL, cutEM = NULL)
cutEEM(x, cutEX = NULL, cutEM = NULL) ## S3 method for class 'EEM' cutEEM(x, cutEX = NULL, cutEM = NULL) ## S3 method for class 'EEMweight' cutEEM(x, cutEX = NULL, cutEM = NULL)
x |
a list of EEM data generated by |
cutEX |
Numeric or sequential data specifying regions to be cut for excitation wavelength. Examples, 200 or 200:500 |
cutEM |
Numeric or sequential data specifying regions to be cut for emission wavelength. Examples, 200 or 200:500 |
A list similar to input EEM
is returned but with specified portions cut.
data(applejuice) applejuice_cut <- cutEEM(applejuice, cutEX = 300:450) drawEEM(applejuice_cut, 1)
data(applejuice) applejuice_cut <- cutEEM(applejuice, cutEX = 300:450) drawEEM(applejuice_cut, 1)
This function deletes two regions that are not related to fluorescence emission: (1) regions where emission wavelength is shorten than excitation light, (2) scattering rays and their second, third and forth order lights.
delScattering(EEM, rep = 0, first = 30, second = 40, third = 40, forth = 40)
delScattering(EEM, rep = 0, first = 30, second = 40, third = 40, forth = 40)
EEM |
A list containing EEM data as created by |
rep |
(optional) Regions to be deleted are to be replaced with |
first |
(optional) Width of region to be deleted for first order scattering rays [nm] |
second |
(optional) Width of region to be deleted for second order scattering rays [nm] |
third |
(optional) Width of region to be deleted for third order scattering rays [nm] |
forth |
(optional) Width of region to be deleted for forth order scattering rays [nm] |
A list similar to input EEM
is returned but with all scattering rays deleted.
Fujita, K., Tsuta, M., Kokawa, M., and Sugiyama, J. (2010). Detection of deoxynivalenol using fluorescence excitation–emission matrix. Food and Bioprocess Technology, 3(6), 922–927.
data(applejuice) drawEEM(delScattering(applejuice, NA), 1)
data(applejuice) drawEEM(delScattering(applejuice, NA), 1)
This function deletes three regions that are not related to fluorescence emission: (1) regions where emission wavelength is shorten than excitation light (Em <= Ex), (2) scattering rays and their second order light, (3) regions above second-order scattering (EM >= 2*EX)
delScattering2(EEM, rep = 0, first = 30, second = 40)
delScattering2(EEM, rep = 0, first = 30, second = 40)
EEM |
A list containing EEM data as created by |
rep |
(optional) Regions to be deleted are to be replaced with |
first |
(optional) Width of region to be deleted for first order scattering rays [nm] |
second |
(optional) Width of region to be deleted for second order scattering rays [nm] |
A list similar to input EEM
is returned but with all scattering rays deleted.
data(applejuice) drawEEM(delScattering2(applejuice, NA), 1)
data(applejuice) drawEEM(delScattering2(applejuice, NA), 1)
This function is a wrapper function for filled.contour
to draw contour for EEM data.
drawEEM(x, ...) ## S3 method for class 'EEM' drawEEM(x, n, exlab = "Excitation wavelength [nm]", emlab = "Emission wavelength [nm]", color.palette = matlab.like, nlevels = 50, main = NULL, flipaxis = FALSE, ...) ## S3 method for class 'EEMweight' drawEEM(x, ncomp, exlab = "Excitation wavelength [nm]", emlab = "Emission wavelength [nm]", color.palette = matlab.like, nlevels = 50, main = NULL, flipaxis = FALSE, ...) ## S3 method for class 'matrix' drawEEM(x, n, exlab = "Excitation wavelength [nm]", emlab = "Emission wavelength [nm]", color.palette = matlab.like, nlevels = 50, main = NULL, flipaxis = FALSE, ...) ## S3 method for class 'data.frame' drawEEM(x, n, exlab = "Excitation wavelength [nm]", emlab = "Emission wavelength [nm]", color.palette = matlab.like, nlevels = 50, main = NULL, flipaxis = FALSE, ...) ## S3 method for class 'numeric' drawEEM(x, exlab = "Excitation wavelength [nm]", emlab = "Emission wavelength [nm]", color.palette = matlab.like, nlevels = 50, main = NULL, flipaxis = FALSE, ...)
drawEEM(x, ...) ## S3 method for class 'EEM' drawEEM(x, n, exlab = "Excitation wavelength [nm]", emlab = "Emission wavelength [nm]", color.palette = matlab.like, nlevels = 50, main = NULL, flipaxis = FALSE, ...) ## S3 method for class 'EEMweight' drawEEM(x, ncomp, exlab = "Excitation wavelength [nm]", emlab = "Emission wavelength [nm]", color.palette = matlab.like, nlevels = 50, main = NULL, flipaxis = FALSE, ...) ## S3 method for class 'matrix' drawEEM(x, n, exlab = "Excitation wavelength [nm]", emlab = "Emission wavelength [nm]", color.palette = matlab.like, nlevels = 50, main = NULL, flipaxis = FALSE, ...) ## S3 method for class 'data.frame' drawEEM(x, n, exlab = "Excitation wavelength [nm]", emlab = "Emission wavelength [nm]", color.palette = matlab.like, nlevels = 50, main = NULL, flipaxis = FALSE, ...) ## S3 method for class 'numeric' drawEEM(x, exlab = "Excitation wavelength [nm]", emlab = "Emission wavelength [nm]", color.palette = matlab.like, nlevels = 50, main = NULL, flipaxis = FALSE, ...)
x |
a list of EEM data generated by |
... |
(optional) further arguments passed to other methods of |
n |
sample number. The number should not exceed |
exlab |
(optional) excitation-axis label |
emlab |
(optional) emission-axis label |
color.palette |
(optional) contour color palette. See |
nlevels |
(optional) number of levels used to separate range of intensity value |
main |
(optional) plot title |
flipaxis |
(optional) flip axis |
ncomp |
number of components |
A figure is returned on the graphic device
EEM
: draw contour of EEM data created by readEEM
function
EEMweight
: draw contours of the output from getLoading
and
getReg
.
matrix
: draw contour of unfolded matrix which have column names in
the format of EX...EM...
data.frame
: draw contour of unfolded data.frame which have column names in
the format of EX...EM...
numeric
: draw contour of a vector of numeric values which have names in
the format of EX...EM...
# method for class "EEM" data(applejuice) drawEEM(applejuice, 1) # draw contour of the first sample drawEEM(applejuice, 1, flipaxis = TRUE) # flip the axis # method for class "EEMweight" applejuice_uf <- unfold(applejuice) # unfold list into matrix result <- prcomp(applejuice_uf) drawEEM(getLoading(result), 1) # plot loading of the first PC
# method for class "EEM" data(applejuice) drawEEM(applejuice, 1) # draw contour of the first sample drawEEM(applejuice, 1, flipaxis = TRUE) # flip the axis # method for class "EEMweight" applejuice_uf <- unfold(applejuice) # unfold list into matrix result <- prcomp(applejuice_uf) drawEEM(getLoading(result), 1) # plot loading of the first PC
This function draw contour for EEM data using ggplot2. Use 'ggsave' to save the contours.
drawEEMgg(x, ...) ## S3 method for class 'EEM' drawEEMgg(x, n, textsize = 20, color.palette = matlab.like, nlevels = 20, exlab = "Excitation wavelength [nm]", emlab = "Emission wavelength [nm]", main = NULL, has_legend = TRUE, zlim = NULL, breaks = waiver(), flipaxis = FALSE, ...) ## S3 method for class 'EEMweight' drawEEMgg(x, ncomp, textsize = 25, color.palette = matlab.like, nlevels = 20, exlab = "Excitation wavelength [nm]", emlab = "Emission wavelength [nm]", main = NULL, has_legend = TRUE, zlim = NULL, breaks = waiver(), flipaxis = FALSE, ...)
drawEEMgg(x, ...) ## S3 method for class 'EEM' drawEEMgg(x, n, textsize = 20, color.palette = matlab.like, nlevels = 20, exlab = "Excitation wavelength [nm]", emlab = "Emission wavelength [nm]", main = NULL, has_legend = TRUE, zlim = NULL, breaks = waiver(), flipaxis = FALSE, ...) ## S3 method for class 'EEMweight' drawEEMgg(x, ncomp, textsize = 25, color.palette = matlab.like, nlevels = 20, exlab = "Excitation wavelength [nm]", emlab = "Emission wavelength [nm]", main = NULL, has_legend = TRUE, zlim = NULL, breaks = waiver(), flipaxis = FALSE, ...)
x |
a list of EEM data generated by |
... |
arguments for other methods |
n |
sample number. The number should not exceed |
textsize |
(optional) text size |
color.palette |
(optional) contour color palette. See |
nlevels |
(optional) number of levels used to separate range of intensity value |
exlab |
(optional) excitation-axis label |
emlab |
(optional) emission-axis label |
main |
(optional) plot title |
has_legend |
logical value for legend |
zlim |
zlim = c(min, max) |
breaks |
breaks |
flipaxis |
(optional) flip axis |
ncomp |
number of components |
drawEEM
is faster and should be used.
A figure is returned on the graphic device
EEM
: draw EEM of EEM data created by readEEM
function
EEMweight
: draw contours of the output from getLoading
and
getReg
.
## Not run: require(EEM) require(ggplot2) data(applejuice) drawEEMgg(applejuice, 1) # draw EEM of sample no.1 drawEEMgg(applejuice, 1, color.palette = cm.colors) # draw EEM of sample no.31 with different color drawEEMgg(applejuice, 1, nlevels = 10) # change nlevels # manually define legend values drawEEMgg(applejuice, 1, breaks = seq(from = 1000, to = 6000, by = 1000)) # can be combined with other ggplot2 commands # add point to the plot drawEEMgg(applejuice, 1) + geom_point(aes(x = 350, y = 500), pch = 17, cex = 10) # add grid line to the plot drawEEMgg(applejuice, 1) + theme(panel.grid = element_line(color = "grey"), panel.grid.major = element_line(colour = "grey")) # add bg color drawEEMgg(applejuice, 1, has_legend = FALSE) + geom_raster(aes(fill = value)) + geom_contour(colour = "white") ## End(Not run)
## Not run: require(EEM) require(ggplot2) data(applejuice) drawEEMgg(applejuice, 1) # draw EEM of sample no.1 drawEEMgg(applejuice, 1, color.palette = cm.colors) # draw EEM of sample no.31 with different color drawEEMgg(applejuice, 1, nlevels = 10) # change nlevels # manually define legend values drawEEMgg(applejuice, 1, breaks = seq(from = 1000, to = 6000, by = 1000)) # can be combined with other ggplot2 commands # add point to the plot drawEEMgg(applejuice, 1) + geom_point(aes(x = 350, y = 500), pch = 17, cex = 10) # add grid line to the plot drawEEMgg(applejuice, 1) + theme(panel.grid = element_line(color = "grey"), panel.grid.major = element_line(colour = "grey")) # add bg color drawEEMgg(applejuice, 1, has_legend = FALSE) + geom_raster(aes(fill = value)) + geom_contour(colour = "white") ## End(Not run)
EEM package can be used to import raw data files, visualizing data and preparing them for multivariate analysis
The latest version and documentation can be found here.
Internal functions for EEM package
generatePoint(n, pch = NULL) generateColor(n, color.palette = NULL) getEX(string, digits = NULL) getEM(string, digits = NULL)
generatePoint(n, pch = NULL) generateColor(n, color.palette = NULL) getEX(string, digits = NULL) getEM(string, digits = NULL)
n |
number |
pch |
Either an integer specifying a symbol or a single character to be used as the default in plotting points. |
color.palette |
(optional) contour color palette. See |
string |
string or vector of strings |
digits |
integer indicating the number of decimal places
( |
'generatePoint' and 'generateColor' are used to create point and color vector from specified number (n) and palette.
generateColor
: generate colors
getEX
: get EX value
getEM
: get EM value
Extract values from other models
getLoading(x) getReg(x)
getLoading(x) getReg(x)
x |
A 'EEMweight' list containing title and value attributes.
data(applejuice) applejuice_uf <- unfold(applejuice) # unfold list into matrix result <- prcomp(applejuice_uf) loading <- getLoading(result) str(loading)
data(applejuice) applejuice_uf <- unfold(applejuice) # unfold list into matrix result <- prcomp(applejuice_uf) loading <- getLoading(result) str(loading)
Find local maximum peaks in EEM data
findLocalMax(data, ...) ## S3 method for class 'EEM' findLocalMax(data, n, threshold = 0.7, showprint = TRUE, ...) ## S3 method for class 'matrix' findLocalMax(data, n, threshold = 0.7, showprint = TRUE, ...) ## S3 method for class 'numeric' findLocalMax(data, threshold = 0.7, showprint = TRUE, ...)
findLocalMax(data, ...) ## S3 method for class 'EEM' findLocalMax(data, n, threshold = 0.7, showprint = TRUE, ...) ## S3 method for class 'matrix' findLocalMax(data, n, threshold = 0.7, showprint = TRUE, ...) ## S3 method for class 'numeric' findLocalMax(data, threshold = 0.7, showprint = TRUE, ...)
data |
EEM data generated by |
... |
(optional) further arguments passed to other methods |
n |
sample number. The number should not exceed |
threshold |
threshold value in between 0 and 1. Lower the value to cover low peaks. |
showprint |
logical value whether to print out the results or not |
return a character vector of peak names. If showprint = TRUE, it will also print a dataframe of indicating the value of local maximum peaks.
EEM
: for EEM data created by readEEM
function
matrix
: for unfolded EEM data created by unfold
function
numeric
: for a vector of numeric values which have names in
the format of EX...EM...
data(applejuice) findLocalMax(applejuice, 1) applejuice_uf <- unfold(applejuice) findLocalMax(applejuice_uf, 1)
data(applejuice) findLocalMax(applejuice, 1) applejuice_uf <- unfold(applejuice) findLocalMax(applejuice_uf, 1)
Fold EEM matrix into a list
fold(EEM_uf, ...) ## S3 method for class 'matrix' fold(EEM_uf, ...) ## S3 method for class 'data.frame' fold(EEM_uf, name = NULL, ...) ## S3 method for class 'numeric' fold(EEM_uf, ...)
fold(EEM_uf, ...) ## S3 method for class 'matrix' fold(EEM_uf, ...) ## S3 method for class 'data.frame' fold(EEM_uf, name = NULL, ...) ## S3 method for class 'numeric' fold(EEM_uf, ...)
EEM_uf |
Unfolded EEM matrix where columns are wavelength condition and rows are samples. It should have corresponding column names (formatted as EX###EM###) and row names. |
... |
arguments for other methods |
name |
optional for data.frame input to specify the sample names |
EEM a list containing EEM/EEM data
data.frame
: fold unfolded data.frame
data(applejuice) applejuice_uf <- unfold(applejuice) # unfold list into matrix applejuice_uf_norm <- normalize(applejuice_uf) # normalize matrix drawEEM(fold(applejuice_uf_norm), 1) # visualize normalized EEM
data(applejuice) applejuice_uf <- unfold(applejuice) # unfold list into matrix applejuice_uf_norm <- normalize(applejuice_uf) # normalize matrix drawEEM(fold(applejuice_uf_norm), 1) # visualize normalized EEM
Pure wheat gluten and pure wheat starch were mixed at gluten ratios ranging from 0 to 100 %, in 20 % increments. The samples were set in a cell with a quartz glass window, and the samples were pressed against the glass to obtain a flat surface. This dataset contains fluorescence excitation-emission profiles of each samples with 8 replicates. To save space, only the data with gluten ratios ranging from 0 to 60 % was provided.
data("gluten")
data("gluten")
Kokawa, M., Fujita, K., Sugiyama, J., Tsuta, M., Shibata, M., Araki, T., & Nabetani, H. (2012). Quantification of the distributions of gluten, starch and air bubbles in dough at different mixing stages by fluorescence fingerprint imaging. Journal of Cereal Science, 55(1), 15–21.
data(gluten) summary(gluten)
data(gluten) summary(gluten)
Normalize data (area under the curve = 1)
normalize(EEM_uf)
normalize(EEM_uf)
EEM_uf |
Unfolded EEM matrix where columns are wavelength condition and rows are samples |
The unfolded EEM data can be normalized by dividing each variable by the sum of the absolute value of all variables in a sample, such that the summation of absolute values of all variables in each sample was equal to 1. This is can be used to reduce the scaling difference,which is common in spectroscopic applications. This difference is usually caused by the scattering effect, source/detector variation and instrumental sensitivity.
A matrix of normalized data
data(applejuice) applejuice_uf <- unfold(applejuice) # unfold list into matrix applejuice_uf_norm <- normalize(applejuice_uf) # normalize data rowSums(abs(applejuice_uf_norm), na.rm = TRUE) # the absolute sum of each row equal to 1
data(applejuice) applejuice_uf <- unfold(applejuice) # unfold list into matrix applejuice_uf_norm <- normalize(applejuice_uf) # normalize data rowSums(abs(applejuice_uf_norm), na.rm = TRUE) # the absolute sum of each row equal to 1
Plot loadings for EEM data
plotLoading(x, ncomp = NULL, ...)
plotLoading(x, ncomp = NULL, ...)
x |
|
ncomp |
number of components |
... |
(optional) arguments for |
A figure is returned on the graphic device
data(applejuice) applejuice_uf <- unfold(applejuice) # unfold list into matrix result <- prcomp(applejuice_uf) plotLoading(result, ncomp = 1) # plot loading of the first PC
data(applejuice) applejuice_uf <- unfold(applejuice) # unfold list into matrix result <- prcomp(applejuice_uf) plotLoading(result, ncomp = 1) # plot loading of the first PC
Plot regression coefficients for EEM data
plotReg(x, ncomp = NULL, ...)
plotReg(x, ncomp = NULL, ...)
x |
output variable from |
ncomp |
number of components |
... |
(optional) arguments for |
A figure is returned on the graphic device
data(gluten) gluten_uf <- unfold(gluten) # unfold list into matrix # delete columns with NA values index <- colSums(is.na(gluten_uf)) == 0 gluten_uf <- gluten_uf[, index] gluten_ratio <- as.numeric(names(gluten)) require(pls) model <- plsr(gluten_ratio ~ gluten_uf, ncomp = 3) plotReg(model)
data(gluten) gluten_uf <- unfold(gluten) # unfold list into matrix # delete columns with NA values index <- colSums(is.na(gluten_uf)) == 0 gluten_uf <- gluten_uf[, index] gluten_ratio <- as.numeric(names(gluten)) require(pls) model <- plsr(gluten_ratio ~ gluten_uf, ncomp = 3) plotReg(model)
Plot score for prcomp
(PCA) result
plotScore(prcompResult, xPC = 1, yPC = 2, group = NULL, group2 = NULL, cex = 1.5, cex.legend = 1, label = NULL, pos = 4, col = NULL, pch = NULL, legendlocation = "bottomright", legendoutside = FALSE, rightwhitespace = 0, ...)
plotScore(prcompResult, xPC = 1, yPC = 2, group = NULL, group2 = NULL, cex = 1.5, cex.legend = 1, label = NULL, pos = 4, col = NULL, pch = NULL, legendlocation = "bottomright", legendoutside = FALSE, rightwhitespace = 0, ...)
prcompResult |
output object from |
xPC |
an integer indicating PC component on x-axis |
yPC |
an integer indicating PC component on y-axis |
group |
a vector of numeric, character or factor class separating the samples into groups. Correspond to point color. |
group2 |
The second group, can be a vector of numeric, character or factor class separating the samples into groups. Correspond to point shape. |
cex |
(optional) size of points on graphs |
cex.legend |
(optional) size of fonts in legend |
label |
(optional) a character vector or expression specifying the text to be written. |
pos |
(optional, applicable when label is given) a position specifier for the text. If specified this overrides any adj value given. Values of 1, 2, 3 and 4, respectively indicate positions below, to the left of, above and to the right of the specified coordinates. |
col |
point color palette |
pch |
point type palette |
legendlocation |
(optional)location of legend on graph.
Look up |
legendoutside |
(optional) set to TRUE if you want to put legend on the outside of the plot. The legend location is defaulted to topright. |
rightwhitespace |
(optional) set width for white space for legend. Only applicable if legendoutside = TRUE |
... |
additional arguments for |
A figure is returned on the graphic device
data(applejuice) applejuice_uf <- unfold(applejuice) # unfold list into matrix result <- prcomp(applejuice_uf) plotScore(result) # plot PC1 vs PC2 score plotScore(result, pch = 3, col = "blue") # change shape and color # get country of apple production country <- sapply(strsplit(names(applejuice), split = "-"), "[", 1) plotScore(result, label = country) # add label # or plot by group plotScore(result, xPC = 1, yPC = 3, group = country) # custom point types and color plotScore(result, xPC = 1, yPC = 3, group = country, pch = c(1,2), col = c("green", "black")) # move legend outside plotScore(result, xPC = 1, yPC = 3, group = country, legendoutside = TRUE) # two groups cultivar <- sapply(strsplit(names(applejuice), split = "-"), "[", 2) plotScore(result, group = country, group2 = cultivar) # make the points more transparent ## Not run: require(scales) plotScore(result, group = country, group2 = country, col = alpha(generateColor(2), 0.7)) ## End(Not run)
data(applejuice) applejuice_uf <- unfold(applejuice) # unfold list into matrix result <- prcomp(applejuice_uf) plotScore(result) # plot PC1 vs PC2 score plotScore(result, pch = 3, col = "blue") # change shape and color # get country of apple production country <- sapply(strsplit(names(applejuice), split = "-"), "[", 1) plotScore(result, label = country) # add label # or plot by group plotScore(result, xPC = 1, yPC = 3, group = country) # custom point types and color plotScore(result, xPC = 1, yPC = 3, group = country, pch = c(1,2), col = c("green", "black")) # move legend outside plotScore(result, xPC = 1, yPC = 3, group = country, legendoutside = TRUE) # two groups cultivar <- sapply(strsplit(names(applejuice), split = "-"), "[", 2) plotScore(result, group = country, group2 = cultivar) # make the points more transparent ## Not run: require(scales) plotScore(result, group = country, group2 = country, col = alpha(generateColor(2), 0.7)) ## End(Not run)
Plot score matrix for prcomp
(PCA) result based on group
plotScorem(prcompResult, ncomp = 4, group, cex = 1.5, col = NULL, pch = NULL, legendtitle = NULL, ...)
plotScorem(prcompResult, ncomp = 4, group, cex = 1.5, col = NULL, pch = NULL, legendtitle = NULL, ...)
prcompResult |
output object from |
ncomp |
maximum number of PC score to plot |
group |
a vector of numeric, character or factor class separating the samples into groups. |
cex |
(optional) size of points on graphs |
col |
point color palette |
pch |
point type palette |
legendtitle |
legend title |
... |
additional arguments to be passed on to |
A figure is returned on the graphic device
data(applejuice) # country of apple production country <- sapply(strsplit(names(applejuice), split = "-"), "[", 1) applejuice_uf <- unfold(applejuice) # unfold list into matrix result <- prcomp(applejuice_uf) # plot PC1 vs PC3 score based on country of production plotScorem(result, ncomp = 4, group = country) # specify colours plotScorem(result, ncomp = 4, group = country, col = c("black", "grey"))
data(applejuice) # country of apple production country <- sapply(strsplit(names(applejuice), split = "-"), "[", 1) applejuice_uf <- unfold(applejuice) # unfold list into matrix result <- prcomp(applejuice_uf) # plot PC1 vs PC3 score based on country of production plotScorem(result, ncomp = 4, group = country) # specify colours plotScorem(result, ncomp = 4, group = country, col = c("black", "grey"))
Create name for prcomp
result
prcompname(prcompResult, PC, explvar = TRUE)
prcompname(prcompResult, PC, explvar = TRUE)
prcompResult |
output value from |
PC |
PC number |
explvar |
(logical) show explained variance (%) or not |
String
data(applejuice) applejuice_uf <- unfold(applejuice) # unfold list into matrix result <- prcomp(applejuice_uf) prcompname(result, 1)
data(applejuice) applejuice_uf <- unfold(applejuice) # unfold list into matrix result <- prcomp(applejuice_uf) prcompname(result, 1)
Print EEM
## S3 method for class 'EEM' print(x, ...)
## S3 method for class 'EEM' print(x, ...)
x |
EEM class object |
... |
arguments for |
data(applejuice) print(applejuice)
data(applejuice) print(applejuice)
Read raw files from fluorescence spectrometer
readEEM(path = NULL)
readEEM(path = NULL)
path |
path to the files or folders which contains raw files (accept a vector). |
The supported format is *.txt, *.csv and *.dat files from FP-8500 (JASCO), F-7000 (Hitachi Hi-tech), RF-6000 (Shimadzu) and Aqualog (Horiba) fluorescence spectrometer. It is likely that outputs from different machines of the same companies are supported by this function. Please send a word or pull request to add support for other formats.
readEEM
returns a list containing each raw files
Summarize by listing the sample number, names and their dimensions
## S3 method for class 'EEM' summary(object, ...)
## S3 method for class 'EEM' summary(object, ...)
object |
a list containing EEM data as created by |
... |
arguments for |
Text on console
data(applejuice) summary(applejuice)
data(applejuice) summary(applejuice)
Unfold EEM list into a matrix with columns as variables (wavelength conditions) and rows as samples.
unfold(EEM, replaceNA = TRUE)
unfold(EEM, replaceNA = TRUE)
EEM |
a list containing EEM data as created by |
replaceNA |
logical value whether to replace NA with 0 |
Unfolded EEM matrix where columns are wavelength condition and rows are samples
data(applejuice) applejuice_uf <- unfold(applejuice) # unfold list into matrix dim(applejuice_uf) # dimension of unfolded matrix
data(applejuice) applejuice_uf <- unfold(applejuice) # unfold list into matrix dim(applejuice_uf) # dimension of unfolded matrix