Returns a peak_table object. The first slot contains a matrix of intensities, where rows correspond to samples and columns correspond to aligned features. The rest of the slots contain various meta-data about peaks, samples, and experimental settings.
get_peaktable(
peak_list,
chrom_list,
response = c("area", "height"),
use.cor = FALSE,
hmax = 0.2,
plot_it = FALSE,
ask = plot_it,
clust = c("rt", "sp.rt"),
sigma.t = NULL,
sigma.r = 0.5,
deepSplit = FALSE,
verbose = FALSE,
out = c("data.frame", "matrix")
)
The function returns a peak_table
object, consisting of the following
elements:
tab
: the peak table itself -- a data-frame of intensities in a
sample x peak configuration.
pk_meta
: A data.frame containing peak meta-data (e.g. the spectral component,
peak number, and average retention time).
sample_meta
: A data.frame of sample meta-data. Must be added using
attach_metadata
).
ref_spectra
: A data.frame of reference spectra (in a wavelength x peak
configuration). Must be added using attach_ref_spectra
args
: A vector of arguments given to get_peaktable
to generate
the peak table.
A peak_list
object created by get_peaks
,
containing a nested list of peak tables: the first level is the
sample, and the second level is the spectral component. Every component is
described by a data.frame where every row is one peak, and the columns contain
information on various peak parameters.
A list of chromatographic matrices.
Indicates whether peak area or peak height is to be used
as intensity measure. Defaults to area
setting.
Logical. Indicates whether to use corrected retention times (by default) or raw retention times (not advised!).
Height at which the complete linkage dendrogram will be cut. Can be interpreted as the maximal inter-cluster retention time difference.
Logical. If TRUE, for every component a stripplot will be shown indicating the clustering.
Logical. Ask before showing new plot?
Specify whether to perform hierarchical clustering based on
spectral similarity and retention time (sp.rt
) or retention time alone
(rt
). Defaults to rt
. The sp.rt
option is experimental
and should be used with caution.
Width of gaussian in retention time distance function.
Controls weight given to retention time if sp.rt
is selected.
Width of gaussian in spectral similarity function. Controls
weight given to spectral correlation if sp.rt
is selected.
Logical. Controls sensitivity to cluster splitting. If
TRUE
, function will return more smaller clusters. See documentation for
cutreeDynamic
for additional information.
Logical. Whether to print warning when combining peaks into
single time window. Defaults to FALSE
.
Specify data.frame
or matrix
as output. Defaults to
data.frame
.
Ethan Bass
The function performs a complete linkage clustering of retention times across
all samples, and cuts at a height given by the user (which can be understood
as the maximal inter-cluster retention time difference) in the simple case
based on retention times. Clustering can also incorporate information about
spectral similarity using a distance function adapted from Broeckling et al.,
2014:
$$latexascii$$
If two peaks from the same sample are assigned to the same cluster, a warning
message is printed to the console. These warnings can usually be ignored, but
one could also consider reducing the hmax
variable. However, this may
lead to splitting of peaks across multiple clusters. Another option is to
filter the peaks by intensity to remove small features.
Broeckling, C. D., Afsar F.A., Neumann S., Ben-Hur A., and Prenni J.E. 2014. RAMClust: A Novel Feature Clustering Method Enables Spectral-Matching-Based Annotation for Metabolomics Data. Anal. Chem. 86:6812-6817. tools:::Rd_expr_doi("10.1021/ac501530d")
Wehrens, R., Carvalho, E., Fraser, P.D. 2015. Metabolite profiling in LC–DAD using multivariate curve resolution: the alsace package for R. Metabolomics 11:143-154. tools:::Rd_expr_doi("10.1007/s11306-014-0683-5")
attach_ref_spectra
attach_metadata
if (FALSE) { # interactive()
data(Sa_pr)
pks <- get_peaks(Sa_pr, lambdas = c('210'))
get_peaktable(pks, response = "area")
}
Run the code above in your browser using DataLab