diff --git a/reference/write_peaktable.html b/reference/write_peaktable.html
index a3a9b94..7a2d8c5 100644
--- a/reference/write_peaktable.html
+++ b/reference/write_peaktable.html
@@ -37,7 +37,7 @@
diff --git a/search.json b/search.json
index 9ccc4a7..d2a3ba3 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"https://ethanbass.github.io/chromatographR/articles/FAQ.html","id":"how-should-i-format-my-data-for-analysis-in-chromatographr","dir":"Articles","previous_headings":"","what":"1. How should I format my data for analysis in chromatographR?","title":"Frequently asked questions","text":"chromatographR functions expect chromatograms wide format retention times rownames. Thus, csv file retention times first column, able read files R follows: chromatograms “long” format, need reshape wide format proceeding analysis.","code":"lapply(vector_of_file_paths, function(f){ read.csv(f, row.names = 1) })"},{"path":"https://ethanbass.github.io/chromatographR/articles/FAQ.html","id":"some-of-my-peaks-arent-being-integrated-when-i-run-get_peaks-","dir":"Articles","previous_headings":"","what":"2. Some of my peaks aren’t being integrated when I run get_peaks.","title":"Frequently asked questions","text":"Try adjusting value sd.max argument, especially seeing wider peaks ones aren’t integrated. argument controls maximum peak width. tried set default value (sd.max = 50) sensible number, “sensible” can vary resolution data. example, example shown , wider peaks picked sd.max = 2.5 increase sd.max 10, able successfully integrate peaks. fails, try adjusting smooth_window.","code":"data(Sa_pr) par(mfrow=c(2,1)) pks <- get_peaks(Sa_warp, lambdas = \"210\", fit = \"egh\", sd.max = 2.5) plot(pks, main = \"'sd.max' = 3\") pks <- get_peaks(Sa_warp, lambdas = \"210\", fit = \"egh\", sd.max = 10) plot(pks, main = \"'sd.max' = 10\")"},{"path":"https://ethanbass.github.io/chromatographR/articles/GC-FID.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Analysis of Polistes cuticular hydrocarbons with GC-FID","text":"basic workflow similar analyzing different types chromatographic data chromatographR, important differences analyzing GC-FID data (1-dimensional data). vignette highlights important considerations using chromatographR analyze GC-FID data (2D chromatography data). demonstrate use chromatographR analysis GC-FID data, analyze dataset cuticular hydrocarbons (CHCs) composition four species paper wasps (Polistes spp.) collected Dr. Andrew Legan (Andrew Wesley Legan 2022; . Legan et al. 2022). dataset includes CHCs collected Polistes dominula (european paper wasp), Polistes exclamans (common paper wasp), P. fuscatus (northern paper wasp), P. metricus (metric paper wasp). social insects, cuticular hydrocarbons serve chemical cues mediating number social behaviors paper wasps (Andrew W. Legan et al. 2021), including nestmate recognition (G. J. Gamboa, Reeve, Pfennig 1986; George J. Gamboa et al. 1996; Bruschini et al. 2011), establishment social hierarchies (Jandt, Tibbetts, Toth 2014) mate choice (Reed Landolt 1990). P. dominula (Kranz 2020) P. exclamans (© Andrew Legan) P. fuscatus (Cook 2022) P. metricus (Drabik-Hamshare 2022) Figure 1: Polistes species includes study. order get good alignment, helpful remove solvent peak. accomplish , can use preprocess function remove first four minutes chromatogram. also reduce time-axis resolution .005 minutes since drastically reduces computation time seemingly little effect accuracy integration results. can group chromatograms species analysis. can extract peaks alkane ladder using get_peaks function plot integrated peak areas. eliminate small peaks part alkane ladder, use filter_peaks function remove features amplitude least 10^4 response units. case, also integration results ‘Shimadzu LabSolutions’, can check integration results provided chromatographR results LabSolutions. Reassuringly, peak areas heights estimated chromatographR similar results provided LabSolutions.","code":"# load chromatograms from Legan et al 2022 files <- rdryad::dryad_download(\"10.5061/dryad.wpzgmsbr8\")[[1]] chrom_paths <- grep(\"README|METADATA|ANNOTATED\", files, invert = TRUE, value = TRUE) dat <- read_chroms(chrom_paths, format_in = \"shimadzu_fid\") # load metadata path_to_metadata <- grep(\"METADATA\", files, value = TRUE) meta <- read.csv(path_to_metadata, sep = \"\\t\") dat.pr <- preprocess(dat, spec.smooth = FALSE, dim1 = seq(4, 59.9, .005), cl = 1) species <- c(dominula = \"DOMINULA\", exclamans.= \"EXCLAMANS\", fuscatus = \"FUSCATUS\", metricus = \"METRICUS\") species_idx <- lapply(species, function(sp){ which(names(dat.pr) %in% gsub(\".txt\", \"\", meta[which(meta$POLISTES_SPECIES == sp), \"SAMPLE_ID\"])) }) ladder <- grep(\"LADDER\", names(dat.pr)) pks <- get_peaks(dat.pr[ladder], time.units = \"s\") plot(pks, chrom_list = dat.pr[ladder]) pks_f <- filter_peaks(pks, min_height = 10000) path_to_annotated_alkanes <- grep(\"ANNOTATED\", files[[1]], value = TRUE) alkanes <- read.csv(path_to_annotated_alkanes, sep=\"\\t\") # check equality of retention times # all.equal(alkanes$RT[-1],pks_f$ALKANE_LADDER$Intensity$rt) par(mfrow=c(1,2)) plot(pks_f$ALKANE_LADDER$Intensity$area ~ alkanes$Area[-1], pch = 20, xlab = \"Area (LabSolutions)\", ylab = \"Area (chromatographR)\", main = \"Area\") m <- lm(pks_f$ALKANE_LADDER$Intensity$area ~ alkanes$Area[-1]) abline(m) legend(\"bottomright\", bty = \"n\", legend = bquote(R^2 == .(format(summary(m)$adj.r.squared, digits = 4)))) plot(pks_f$ALKANE_LADDER$Intensity$height ~ alkanes$Height[-1], pch = 20, xlab = \"Area (LabSolutions)\", ylab = \"Area (chromatographR)\", main = \"Height\") m <- lm(pks_f$ALKANE_LADDER$Intensity$height ~ alkanes$Height[-1]) abline(m) legend(\"bottomright\", bty = \"n\", legend = bquote(R^2 == .(format(summary(m)$adj.r.squared, digits = 4))))"},{"path":"https://ethanbass.github.io/chromatographR/articles/GC-FID.html","id":"alignment-of-chromatograms","dir":"Articles","previous_headings":"","what":"Alignment of chromatograms","title":"Analysis of Polistes cuticular hydrocarbons with GC-FID","text":"can align chromatograms species using variable dynamic time warping. sanity check, can compare single species alignments species multi-species alignment corresponding chromatograms. general, results quite similar multispecies single species alignments.","code":"warp_dominula <- suppressWarnings(correct_rt(dat.pr[species_idx$dominula], alg = \"vpdtw\", what = \"corrected.values\", plot_it = TRUE, verbose = TRUE, penalty = 1, maxshift = 100)) #> Selected chromatogram 9 as best reference. warp_metricus <- suppressWarnings(correct_rt(dat.pr[species_idx$metricus], alg = \"vpdtw\", what = \"corrected.values\", plot_it = FALSE, verbose = FALSE, penalty = 2, maxshift = 100)) warp_exclamans <- suppressWarnings(correct_rt(dat.pr[species_idx$exclamans], alg = \"vpdtw\", what = \"corrected.values\", plot_it = FALSE, verbose = FALSE, penalty = 2, maxshift = 200)) warp_fuscatus <- suppressWarnings(correct_rt(dat.pr[species_idx$fuscatus], alg = \"vpdtw\", what = \"corrected.values\", plot_it = FALSE, verbose = FALSE, penalty = 2, maxshift = 200)) warp_all <- suppressWarnings(correct_rt(dat.pr[-1], alg = \"vpdtw\", what = \"corrected.values\", plot_it = FALSE, verbose = FALSE, penalty = 2, maxshift = 200)) par(mfrow=c(3,1)) plot_chroms(warp_all[grep(\"PMET\",names(warp_all))],show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. metricus\"), \" (multi-species)\")), bty = \"n\") plot_chroms(warp_metricus, show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. metricus\"), \" (single-species)\")), bty = \"n\") plot_chroms(dat.pr[species_idx$metricus], show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. metricus\"), \" (raw)\")), bty = \"n\") par(mfrow=c(3,1)) plot_chroms(warp_all[grep(\"PFUS\",names(warp_all))],show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. fuscatus\"), \" (multi-species)\")), bty = \"n\") plot_chroms(warp_fuscatus, show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. fuscatus\"), \" (single-species)\")), bty = \"n\") plot_chroms(dat.pr[species_idx$fuscatus], show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. fuscatus\"), \" (raw)\")), bty = \"n\") par(mfrow=c(3,1)) plot_chroms(warp_all[grep(\"PDOM\", names(warp_all))],show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. dominula\"), \" (multi-species)\")), bty=\"n\") plot_chroms(warp_dominula, show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. dominula\"), \" (single-species)\")), bty=\"n\") plot_chroms(dat.pr[species_idx$dominula], show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. dominula\"), \" (raw)\")), bty=\"n\") par(mfrow = c(3,1)) plot_chroms(warp_all[grep(\"PEXC\", names(warp_all))],show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. exclamans\"), \" (multi-species)\")), bty = \"n\") plot_chroms(warp_exclamans, show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. exclamans\"), \" (single-species)\")), bty = \"n\") plot_chroms(dat.pr[species_idx$exclamans], show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. exclamans\"), \" (raw)\")), bty = \"n\")"},{"path":"https://ethanbass.github.io/chromatographR/articles/GC-FID.html","id":"integration-and-peaktable-assembly","dir":"Articles","previous_headings":"","what":"Integration and peaktable assembly","title":"Analysis of Polistes cuticular hydrocarbons with GC-FID","text":"","code":"pks <- get_peaks(warp_all) pktab <- get_peaktable(pks) #> Warning in cbind(lambda = rep(as.numeric(names(peak_list[[1]])[comp]), ncl), : #> NAs introduced by coercion pktab <- attach_metadata(pktab, metadata = meta, column = \"SAMPLE_ID\")"},{"path":"https://ethanbass.github.io/chromatographR/articles/GC-FID.html","id":"analysis-of-peaktable","dir":"Articles","previous_headings":"","what":"Analysis of peaktable","title":"Analysis of Polistes cuticular hydrocarbons with GC-FID","text":"one expect, permanova shows species largest contributor variance CHC profiles (R2 = 0.52), followed state origin (R2 = 0.48) sex (R2 = 1). Principal componenets analysis shows decent separation species, P. dominula, P. fuscatus P. dominula separating along PC2 P. exclamans separating species along PC1. can get even better separation break data sex, though considerable intraspecific variation.","code":"m <- vegan::adonis2(pktab$tab ~ POLISTES_SPECIES + STATE + SEX + LAT + LON, data = pktab$sample_meta, method = \"manhattan\", na.action = na.omit) m #> Permutation test for adonis under reduced model #> Permutation: free #> Number of permutations: 999 #> #> vegan::adonis2(formula = pktab$tab ~ POLISTES_SPECIES + STATE + SEX + LAT + LON, data = pktab$sample_meta, method = \"manhattan\", na.action = na.omit) #> Df SumOfSqs R2 F Pr(>F) #> Model 13 5.8841e+11 0.51582 8.6048 0.001 *** #> Residual 105 5.5231e+11 0.48418 #> Total 118 1.1407e+12 1.00000 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 # ggordiplot function (modified from https://github.com/jfq3/ggordiplots/blob/master/R/gg_ordiplot.R) with added shape argument gg_ordiplot <- function (ord, groups, shape = NULL, scaling = 1, choices = c(1, 2), kind = c(\"sd\", \"se\", \"ehull\"), conf = NULL, show.groups = \"all\", ellipse = TRUE, label = FALSE, hull = FALSE, spiders = FALSE, pt.size = 3, plot = TRUE) { x <- y <- cntr.x <- cntr.y <- Group <- NULL groups <- as.factor(groups) if (show.groups[1] == \"all\") { show.groups <- as.vector(levels(groups)) } df_ord <- vegan::scores(ord, display = \"sites\", scaling = scaling, choices = choices) axis.labels <- ggordiplots::ord_labels(ord)[choices] df_ord <- data.frame(x = df_ord[, 1], y = df_ord[, 2], Group = groups) if (!is.null(shape)){ df_ord <- data.frame(df_ord, shape = shape) } df_mean.ord <- aggregate(df_ord[, 1:2], by = list(df_ord$Group), mean) colnames(df_mean.ord) <- c(\"Group\", \"x\", \"y\") df_mean.ord <- df_mean.ord[df_mean.ord$Group %in% show.groups, ] if (is.null(conf)) { rslt <- vegan::ordiellipse(ord, groups = groups, display = \"sites\", scaling = scaling, choices = choices, kind = kind, show.groups = show.groups, draw = \"none\", label = label) } else { rslt <- vegan::ordiellipse(ord, groups = groups, display = \"sites\", scaling = scaling, choices = choices, kind = kind, show.groups = show.groups, draw = \"none\", conf = conf, label = label) } df_ellipse <- data.frame() for (g in show.groups) { df_ellipse <- rbind(df_ellipse, cbind(as.data.frame(with(df_ord[df_ord$Group == g, ], vegan:::veganCovEllipse(rslt[[g]]$cov, rslt[[g]]$center, rslt[[g]]$scale))), Group = g)) } colnames(df_ellipse) <- c(\"x\", \"y\", \"Group\") df_ellipse <- df_ellipse[, c(3, 1, 2)] rslt.hull <- vegan::ordihull(ord, groups = groups, scaling = scaling, choices = choices, show.groups = show.groups, draw = \"none\") df_hull <- data.frame() df_temp <- data.frame() for (g in show.groups) { x <- rslt.hull[[g]][, 1] y <- rslt.hull[[g]][, 2] Group <- rep(g, length(x)) df_temp <- data.frame(Group = Group, x = x, y = y) df_hull <- rbind(df_hull, df_temp) } df_spiders <- df_ord df_spiders$cntr.x <- NA df_spiders$cntr.y <- NA for (g in show.groups) { df_spiders[which(df_spiders$Group == g), 4:5] <- df_mean.ord[which(df_mean.ord == g), 2:3] } df_spiders <- df_spiders[, c(3, 4, 5, 1, 2)] df_spiders <- df_spiders[order(df_spiders$Group), ] df_spiders <- df_spiders[df_spiders$Group %in% show.groups, ] xlab <- axis.labels[1] ylab <- axis.labels[2] plt <- ggplot2::ggplot() + geom_point(data = df_ord, aes(x = x, y = y, color = Group, shape = shape), size = pt.size) + xlab(xlab) + ylab(ylab) if (ellipse == TRUE) { plt <- plt + geom_path(data = df_ellipse, aes(x = x, y = y, color = Group), show.legend = FALSE) } if (label == TRUE) { plt <- plt + geom_text(data = df_mean.ord, aes(x = x, y = y, label = Group, color = Group), show.legend = FALSE) } if (hull == TRUE) { plt <- plt + geom_path(data = df_hull, aes(x = x, y = y, color = Group), show.legend = FALSE) } if (spiders == TRUE) { plt <- plt + geom_segment(data = df_spiders, aes(x = cntr.x, xend = x, y = cntr.y, yend = y, color = Group), show.legend = FALSE) } plt <- plt + coord_fixed(ratio = 1) if (plot) { print(plt) } invisible(list(df_ord = df_ord, df_mean.ord = df_mean.ord, df_ellipse = df_ellipse, df_hull = df_hull, df_spiders = df_spiders, plot = plt)) } ord <- vegan::rda(pktab$tab, scale = TRUE) pktab$sample_meta$SEX_SP <- interaction(pktab$sample_meta$SEX, pktab$sample_meta$POLISTES_SPECIES) gg_ordiplot(ord, groups = pktab$sample_meta[,\"POLISTES_SPECIES\"], shape = pktab$sample_meta[,\"SEX\"], plot = FALSE)$plot + scale_shape_manual(values = c(19, 21), name = \"Sex\") + labs(colour = \"Species\") cond <- which(pktab$sample_meta$SEX == \"M\") ord_m <- vegan::rda(pktab$tab[cond,], scale = TRUE) gg_ordiplot(ord_m, groups = pktab$sample_meta[cond,\"POLISTES_SPECIES\"], plot = FALSE)$plot + ggtitle(\"Males\") + theme_classic() + theme(legend.position=\"bottom\", plot.title = element_text(hjust = 0.5)) + labs(colour = \"Species\") cond <- which(pktab$sample_meta$SEX == \"F\") ord_f <- vegan::rda(pktab$tab[cond,],scale=TRUE) gg_ordiplot(ord_f, groups = pktab$sample_meta[cond,\"POLISTES_SPECIES\"], plot = FALSE)$plot + ggtitle(\"Females\") + theme_classic() + theme(legend.position=\"bottom\", plot.title = element_text(hjust = 0.5)) + labs(colour = \"Species\")"},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/articles/GC-FID.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session Information","title":"Analysis of Polistes cuticular hydrocarbons with GC-FID","text":"","code":"sessionInfo() #> R version 4.4.2 (2024-10-31) #> Platform: x86_64-pc-linux-gnu #> Running under: Ubuntu 22.04.5 LTS #> #> Matrix products: default #> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 #> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 #> #> locale: #> [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 #> [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8 #> [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C #> [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C #> #> time zone: UTC #> tzcode source: system (glibc) #> #> attached base packages: #> [1] stats graphics grDevices utils datasets methods base #> #> other attached packages: #> [1] ggplot2_3.5.1 vegan_2.6-8 lattice_0.22-6 #> [4] permute_0.9-7 rdryad_1.0.0 chromatographR_0.7.2 #> #> loaded via a namespace (and not attached): #> [1] gtable_0.3.6 xfun_0.49 caTools_1.18.3 #> [4] vctrs_0.6.5 tools_4.4.2 bitops_1.0-9 #> [7] generics_0.1.3 curl_6.0.1 parallel_4.4.2 #> [10] tibble_3.2.1 fansi_1.0.6 cluster_2.1.6 #> [13] pkgconfig_2.0.3 Matrix_1.7-1 readxl_1.4.3 #> [16] lifecycle_1.0.4 farver_2.1.2 compiler_4.4.2 #> [19] stringr_1.5.1 ptw_1.9-16 munsell_0.5.1 #> [22] RcppDE_0.1.7 minpack.lm_1.2-4 htmltools_0.5.8.1 #> [25] yaml_2.3.10 Formula_1.2-5 pillar_1.9.0 #> [28] tidyr_1.3.1 MASS_7.3-61 nlme_3.1-166 #> [31] mime_0.12 tidyselect_1.2.1 zip_2.3.1 #> [34] digest_0.6.37 stringi_1.8.4 dplyr_1.1.4 #> [37] purrr_1.0.2 labeling_0.4.3 VPdtw_2.2.1 #> [40] splines_4.4.2 fastmap_1.2.0 grid_4.4.2 #> [43] colorspace_2.1-1 cli_3.6.3 chromConverter_0.2.1 #> [46] magrittr_2.0.3 triebeard_0.4.1 crul_1.5.0 #> [49] dynamicTreeCut_1.63-1 utf8_1.2.4 withr_3.0.2 #> [52] ggordiplots_0.4.3 scales_1.3.0 rappdirs_0.3.3 #> [55] rmarkdown_2.29 reticulate_1.40.0 cellranger_1.1.0 #> [58] fastcluster_1.2.6 png_0.1-8 pbapply_1.7-2 #> [61] evaluate_1.0.1 knitr_1.49 hoardr_0.5.4 #> [64] mgcv_1.9-1 urltools_1.7.3 rlang_1.1.4 #> [67] Rcpp_1.0.13-1 glue_1.8.0 httpcode_0.3.0 #> [70] xml2_1.3.6 jsonlite_1.8.9 R6_2.5.1"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"chromatographR package reproducible analysis HPLC-DAD data R. Liquid chromatography coupled diode-array detection (HPLC-DAD) remains one popular analytical methodologies due convenience low-cost. However, currently open-source tools available analyzing HPLC-DAD chromatograms “simple” chromatographic data. use proprietary software analysis HPLC-DAD data currently significant barrier reproducible science, since tools widely accessible, usually require users select complicated options graphical user interface easily repeated. Reproducibility much higher command line workflows, like chromatographR, entire analysis can stored easily repeated anyone using publicly available software. chromatographR package began fork previously published alsace package (Wehrens, Carvalho, Fraser 2015), reworked improved functions peak-finding, integration peak table generation well number new tools data visualization downstream analysis. Unlike alsace, emphasized multivariate curve resolution alternating least squares (MCR-ALS), chromatographR developed around conventional workflow seem familiar users standard software tools HPLC-DAD analysis. chromatographR includes tools ) pre-processing, b) retention-time alignment, c) peak-finding, d) peak-integration e) peak-table construction, well additional functions useful analyzing resulting peak table.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"loading-data","dir":"Articles","previous_headings":"Workflow","what":"Loading data","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"chromatographR can import data growing list proprietary file formats using read_chroms function. Supported file formats include ‘Agilent ChemStation’ ‘MassHunter’ (.D) files, ‘Thermo Raw’ (.raw), ‘Chromeleon’ UV ASCII (.txt), ‘Waters ARW’ (.arw), ‘Shimadzu’ ASCII (.txt), . (full list, see chromConverter documentation). Select appropriate file format specifying format_in argument (e.g. csv, chemstation_uv, masshunter_dad, chromeleon_uv, waters_arw, etc).","code":"> # single folder > read_chroms(paths = path, format_in = \"chemstation_uv\") > > # multiple folders > path <- 'foo' # path to parent directory > folders <- list.files(path = path, full.names = TRUE) > dat <- read_chroms(folders, format_in = \"chemstation_uv\")"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"example-data","dir":"Articles","previous_headings":"Workflow","what":"Example data","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"package includes example data consisting root extracts tall goldenrod (Solidago altissima). Roots extracted 90% methanol run Agilent 1100 HPLC coupled DAD detector, according previously described method (Uesugi Kessler 2013). dataset called Sa (abbreviated Solidago altissima).","code":"> data(Sa)"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"pre-processing-data","dir":"Articles","previous_headings":"Workflow","what":"Pre-processing data","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"Data liquid chromatography often suffer variety non-informative artifacts, noise drifting baseline. addition, data produced instrument may higher resolution wider range (along either time spectral dimensions) require. Fortunately, issues can remedied fairly easily. example, smoothing can reduce noise spectral direction baseline subtraction can help correct drifting baseline. Interpolation wavelengths retention times can used reduce dimensionality data, facilitating comparison across samples reducing time computational load required downstream analyses. functions (smoothing, baseline correction, interpolation) available preprocess function enabled default. select narrower range times /wavelengths, arguments can provided optional dim1 dim2 arguments. baseline_cor function ptw package (Bloemberg et al. 2010) takes arguments p (asymmetry parameter) lambda (smoothing parameter). can read documentation ptw::asysm. may want experiment parameters choosing values use whole dataset. selecting parameters baseline correction, can proceed pre-processing step shown .","code":"> i <- 2 # chromatogram number in list of data > tpoints <- as.numeric(rownames(Sa[[i]])) > lambda <- '200.00000' > > matplot(x = tpoints, y = Sa[[i]][,lambda], + type = 'l', ylab = 'Abs (mAU)', xlab = 'Time (min)') > matplot(x = tpoints, y = ptw::baseline.corr(Sa[[i]][,lambda], p = .001, lambda = 1e5), + type = 'l', add = TRUE, col='blue', lty = 3) > # choose dimensions for interpolation > new.ts <- seq(10, 18.66, by = .01) # choose time-points > new.lambdas <- seq(200, 318, by = 2) # choose wavelengths > > dat.pr <- preprocess(Sa, dim1 = new.ts, dim2 = new.lambdas, p = .001, lambda = 1e5, cl = 1) Warning in preprocess(Sa, dim1 = new.ts, dim2 = new.lambdas, p = 0.001, : The `parallel` argument is deprecated. Just use the `cl` argument to enable parallel processing."},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"alignment","dir":"Articles","previous_headings":"Workflow","what":"Alignment","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"many cases, liquid chromatography can suffer retention time shifts (e.g. due temperature fluctuations, column degradation, subtle changes mobile-phase composition), can make difficult compare peaks across samples. Luckily, number “time-warping” algorithms developed correcting kinds shifts. chromatographR, parametric time warping (ptw) (Eilers 2004; Bloemberg et al. 2010) variable penalty dynamic time warping (vpdtw) (Clifford et al. 2009; Clifford Stone 2012) available correcting retention time shifts correct_rt function. warping functions aim produce better alignment features “warping” time-axis supplied chromatogram match reference chromatogram. (reference chromatogram can either determined algorithmically selected manually setting reference argument). First, check alignment chromatograms using plot_chroms function. chromatograms appear shifted, shown poor overlap chromatograms across four samples. remedy problem, can try “warp” chromatograms using one two options described .","code":"> plot_chroms(dat.pr, lambdas = 210)"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"parametric-time-warping","dir":"Articles","previous_headings":"Workflow > Alignment","what":"Parametric time warping","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"ptw option can take single wavelength list wavelengths provided user using lambdas argument. chromatogram, ptw produces “global” warping function across wavelengths supplied user. code block creates warping models samples provided list data matrices. function used warp chromatogram according corresponding model, setting models parameter. Depending variety samples severity retention time shifts, may take experimentation warping parameters get satisfactory results. Sometimes less can actually – example, wavelengths fewer peaks may sometimes yield better warping models. (Also see documentation ptw guidance warp function optimization). can use following code snippet compare alignment warped (top panel) unwarped (bottom panel) chromatograms. Clearly, alignment considerably improved warping. can also use correct_rt function global alignment multiple wavelengths, providing list wavelengths lambdas argument, always improve results. alignment still isn’t perfect warping, probably good enough align peaks assemble peak table, primary goal.","code":"> warping.models <- correct_rt(dat.pr, what = \"models\", lambdas = c(210), scale = TRUE) > warp <- correct_rt(chrom_list = dat.pr, models = warping.models, what = \"corrected.values\") > par(mfrow=c(2,1)) > # plot warped data > plot_chroms(warp, lambdas = c(210)) > legend(\"topleft\", legend = \"ptw\", bty = \"n\") > > # plot unwarped data > plot_chroms(dat.pr, lambdas = c(210)) > legend(\"topleft\", legend = \"raw\", bty = \"n\")"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"variable-penalty-dynamic-time-warping","dir":"Articles","previous_headings":"Workflow > Alignment","what":"Variable penalty dynamic time warping","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"Variable penalty dynamic time warping another algorithm can effective correcting retention time shifts (Clifford et al. 2009; Clifford Stone 2012). Instead calculating explicit warping function, dynamic time warping (DTW) works repeatedly shifting, expanding contracting time axis small steps satisfactory alignment attained. process can result close matching peaks, can also lead severe peak distortion time axis repeatedly expanded /contracted (Tomasi, van den Berg, Andersson 2004). Variable penalty dynamic time warping derivative DTW constrains expansion contraction time-axis applying penalty types “risky” moves. can often achieve good alignment minimal peak distortion. VPdtw package suggested dependency since requires working C++ compiler. Unlike ptw, VPdtw can take single wavelength input (returns global warping whole chromatographic matrix). code snippet uses VPdtw warp example chromatograms using first chromatogram reference. penalty maxshift parameters can adjusted control degree warping. case alignments produced two algorithms similar, cases one algorithm may dramatically outperform .","code":"> warp <- correct_rt(chrom_list = dat.pr, alg = \"vpdtw\", lambdas = 210, + what = \"corrected.values\", reference = 1) > par(mfrow=c(2,1)) > plot_chroms(warp, lambdas = c(210)) > legend(\"topleft\", legend = \"vpdtw\", bty = \"n\") > > plot_chroms(dat.pr, lambdas = c(210)) > legend(\"topleft\", legend = \"raw\", bty = \"n\")"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"peak-detection-and-integration","dir":"Articles","previous_headings":"Workflow","what":"Peak detection and integration","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"get_peaks function produced nested list peaks looping supplied chromatograms specified wavelengths, finding peaks, fitting specified function using non-linear least squares. area curve peak estimated using trapezoidal approximation. fit argument can used specify peak-fitting model. current options exponential-gaussian hybrid (egh) (Lan Jorgenson 2001) (default setting) gaussian. Alternatively, peak areas can integrated without applying model (fit = raw). function returns nested list data.frames containing parameters peaks identified chromatogram.","code":"> # find and integrate peaks using gaussian peak fitting > pks_gauss <- get_peaks(warp, lambdas = c(210), sd.max = 40, fit = \"gaussian\") > > # find and integrate peaks using exponential-gaussian hybrid model > pks_egh <- get_peaks(warp, lambdas = c(210), sd.max = 40, fit = \"egh\") > > # find and integrate peaks without modeling peak shape > pks_raw <- get_peaks(warp, lambdas = c(210), sd.max = 100, fit = \"raw\")"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"filtering","dir":"Articles","previous_headings":"Workflow > Peak detection and integration","what":"Filtering","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"peak-finding algorithm may often detect lot peaks little noise. Thus, recommended filter extraneous peaks stage (especially processing lot samples) can greatly reduce computational load peak table construction. can accomplished directly using arguments sd_max (filter peak width) /amp_thresh (filter peak height). Alternatively, filter_peaks function can used filter peaks peak_list already created.","code":""},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"visualization","dir":"Articles","previous_headings":"Workflow > Peak detection and integration","what":"Visualization","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"plot.peak_list function allows visually assess peak integration accuracy. compare peaks fitted first chromatogram (idx = 1) using two algorithms. Usually egh function performs slightly better asymmetrical peaks. Even though peaks fully filled raw setting selected, results may necessarily accurate.","code":"> par(mfrow=c(3,1)) > plot(pks_gauss, idx = 1, lambda = 210) > legend(\"topright\", \"Gaussian\", bty = \"n\") > > plot(pks_egh, idx = 1, lambda = 210) > legend(\"topright\", \"Exponential-gaussian hybrid\", bty = \"n\") > > plot(pks_raw, idx = 1, lambda = 210) > legend(\"topright\", \"Raw\", bty = \"n\")"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"peak-table-assembly","dir":"Articles","previous_headings":"Workflow","what":"Peak table assembly","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"obtaining peak_list, get_peaks function performs complete-linkage hierarchical clustering link peaks across samples. returns peak_table object samples rows peaks columns. peak_table object also slots holding metadata peaks, samples, parameters used analysis. lot samples, step can quite computationally expensive. Thus, suggested filter peak_list provided get_peaktable order remove extraneous peaks (see Peak finding fitting section ). Peaks can also filtered peak_table assembly using filter_peaktable function. important parameter hmax controls stringency retention times matched across samples. low value hmax increase odds splitting single peaks across multiple columns, high value hmax increase odds erroneously combining multiple peaks column.","code":"> # assembly peak table from peak_list saved in `pks_egh` > pk_tab <- get_peaktable(pks_egh, response = \"area\", hmax = 0.2) > > # print first six columns of peak table > head(pk_tab$tab[,1:6]) V1 V2 V3 V4 V5 V6 119 5.496455 0.0000000 0.6572183 1.991365 15.199917 0.3114568 121 4.200859 1.0746359 0.6078366 0.000000 7.908693 0.0000000 122 8.261218 0.9544689 1.9510595 0.000000 25.772683 1.7912076 458 6.201729 2.2880101 1.9889770 5.308515 13.995000 0.2875473"},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"attaching-metadata","dir":"Articles","previous_headings":"Workflow > Further analysis and data-visualization","what":"Attaching metadata","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"begin analyzing peak table, usually want attach sample metadata peak_table object. can easily accomplished using attach_metadata function. function takes metadata argument supplied data.frame containing experimental metadata, one columns matches names samples. column specified supplying column name string column argument. attach ordered metadata sample_meta slot peak table. peak table can normalized (e.g. dividing sample weight) using normalize_data function.","code":"> # load example metadata > path <- system.file(\"extdata\", \"Sa_metadata.csv\", package = \"chromatographR\") > meta <- read.csv(path) > # attach metadata > pk_tab <- attach_metadata(peak_table = pk_tab, metadata = meta, column = \"vial\") > # normalize peak table by sample mass > pk_tab <- normalize_data(peak_table = pk_tab, column = \"mass\")"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"attaching-reference-spectra","dir":"Articles","previous_headings":"Workflow > Further analysis and data-visualization","what":"Attaching reference spectra","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"Optionally, can attach scaled reference spectra peak_table using attach_ref_spectra function. can helpful working UV spectra programmatically (e.g. sort peaks chromophores). Reference spectra defined either spectrum highest intensity peak (ref = \"max.int\") spectrum highest average correlation spectra associated peak (ref = \"max.cor\"). , show spectra can used construct correlation matrix find peaks matching particular chromophore.","code":"> pk_tab <- attach_ref_spectra(pk_tab, ref = \"max.int\") > cor_matrix <- cor(pk_tab$ref_spectra) > hx <- names(which(cor_matrix[,\"V20\"] > .99)) > matplot(x = as.numeric(rownames(pk_tab$ref_spectra)), + y = pk_tab$ref_spectra[, hx], type = 'l', + ylab = \"Abs (mAU)\", + xlab = \"Wavelength (nm)\")"},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"mirror-plot","dir":"Articles","previous_headings":"Workflow > Further analysis and data-visualization > Data visualization","what":"Mirror plot","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"mirror_plot function provides quick way visually compare results across treatment groups.","code":"> mirror_plot(pk_tab, lambdas = c(210), var = \"trt\", legend_size = 2)"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"plotting-spectra","dir":"Articles","previous_headings":"Workflow > Further analysis and data-visualization > Data visualization","what":"Plotting spectra","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"plot_spectrum function allows easily plot record spectra associated particular peak peak table. useful interpreting results /checking errors peak table. example, may want check spectra particular peak match across different samples, may want compare spectrum known standard. plot_spectrum function can used plot spectrum chromatographic trace using arguments plot_spectrum plot_trace. default plot trace spectrum chromatogram largest peak peak table. Alternatively, can choose chromatogram index wavelength using idx lambda arguments. plot_spectrum function can also used generate interactive plots using plotly. plot_all_spectra function can used visually compare spectra specified peak across samples.","code":"> par(mfrow = c(2,1)) > peak <- \"V7\" > plot_spectrum(peak, peak_table = pk_tab, chrom_list = warp, + verbose = FALSE) > plot_spectrum(peak, peak_table = pk_tab, chrom_list = warp, + verbose = FALSE, engine = \"plotly\") > peak <- \"V13\" > plot_all_spectra(peak, peak_table = pk_tab, export = FALSE)"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"plot-peak-table-function","dir":"Articles","previous_headings":"Workflow > Further analysis and data-visualization > Data visualization","what":"Plot peak table function","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"plot.peak_table function provides simplified interface various options plotting data peak_table. example, can used quick interface plot_spectrum plot_all_spectra functions shown . can also used quickly compare results across treatments calling boxplot.","code":"> plot(pk_tab, loc = \"V13\", box_plot = TRUE, vars = \"trt\", verbose = FALSE)"},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session Information","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"","code":"> sessionInfo() R version 4.4.2 (2024-10-31) Platform: x86_64-pc-linux-gnu Running under: Ubuntu 22.04.5 LTS Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 locale: [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8 [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C time zone: UTC tzcode source: system (glibc) attached base packages: [1] parallel stats graphics grDevices utils datasets methods [8] base other attached packages: [1] chromatographR_0.7.2 knitr_1.49 loaded via a namespace (and not attached): [1] sass_0.4.9 utf8_1.2.4 generics_0.1.3 [4] tidyr_1.3.1 bitops_1.0-9 xml2_1.3.6 [7] fastcluster_1.2.6 stringi_1.8.4 lattice_0.22-6 [10] digest_0.6.37 magrittr_2.0.3 caTools_1.18.3 [13] chromConverter_0.2.1 evaluate_1.0.1 grid_4.4.2 [16] dynamicTreeCut_1.63-1 fastmap_1.2.0 cellranger_1.1.0 [19] jsonlite_1.8.9 Matrix_1.7-1 Formula_1.2-5 [22] purrr_1.0.2 fansi_1.0.6 scales_1.3.0 [25] pbapply_1.7-2 textshaping_0.4.0 jquerylib_0.1.4 [28] cli_3.6.3 rlang_1.1.4 munsell_0.5.1 [31] ptw_1.9-16 cachem_1.1.0 yaml_2.3.10 [34] tools_4.4.2 minpack.lm_1.2-4 dplyr_1.1.4 [37] colorspace_2.1-1 RcppDE_0.1.7 reticulate_1.40.0 [40] vctrs_0.6.5 R6_2.5.1 png_0.1-8 [43] lifecycle_1.0.4 stringr_1.5.1 fs_1.6.5 [46] htmlwidgets_1.6.4 ragg_1.3.3 pkgconfig_2.0.3 [49] desc_1.4.3 pkgdown_2.1.1.9000 bslib_0.8.0 [52] pillar_1.9.0 VPdtw_2.2.1 glue_1.8.0 [55] Rcpp_1.0.13-1 systemfonts_1.1.0 tidyselect_1.2.1 [58] xfun_0.49 tibble_3.2.1 farver_2.1.2 [61] htmltools_0.5.8.1 rmarkdown_2.29 compiler_4.4.2 [64] readxl_1.4.3"},{"path":"https://ethanbass.github.io/chromatographR/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Ethan Bass. Author, maintainer. Hans W Borchers. Contributor, copyright holder. Author savgol pinv functions bundled pracma","code":""},{"path":"https://ethanbass.github.io/chromatographR/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Bass, E. (2023). chromatographR: Chromatographic Data Analysis Toolset (version 0.7.2). http://doi.org/10.5281/zenodo.6944334","code":"@Manual{, title = {chromatographR: Chromatographic Data Analysis Toolset}, author = {Ethan Bass}, year = {2023}, note = {version 0.7.2}, url = {https://ethanbass.github.io/chromatographR/}, doi = {10.5281/zenodo.6944334}, }"},{"path":"https://ethanbass.github.io/chromatographR/contributing.html","id":"how-to-contribute","dir":"","previous_headings":"","what":"How to contribute","title":"NA","text":"Contributions package welcome. Please get touch (preferable opening GitHub issue) discuss suggestions file bug report. good reasons file issue: found actual bug. ’re getting cryptic error message don’t understand. file format ’d like read isn’t currently supported chromatographR. (, please make sure include link example file!) new feature ’d like see implemented.","code":""},{"path":"https://ethanbass.github.io/chromatographR/contributing.html","id":"reporting-bugs","dir":"","previous_headings":"How to contribute","what":"Reporting Bugs","title":"NA","text":"Please check existing issues filing bug report. ’re bug hasn’t yet reported, please include many details possible, including preferably code snippet can used reproduce issue error messages printed console. Please include version chromatographR running. Version information can obtained R session running packageVersion(\"chromatographR\").","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/index.html","id":"overview","dir":"","previous_headings":"","what":"Overview","title":"Chromatographic Data Analysis Toolset","text":"chromatographR package reproducible analysis HPLC-DAD chromatographic data R. can also used analyze “simple” chromatographic data like GC-FID, HPLC-UV, HPLC-FD.","code":""},{"path":"https://ethanbass.github.io/chromatographR/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Chromatographic Data Analysis Toolset","text":"chromatographR can now installed CRAN: However, ’s recommended install latest development version chromatographR GitHub using devtools package: R Universe:","code":"install.packages(\"chromatographR\") install.packages(\"remotes\") remotes::install_github(\"https://github.com/ethanbass/chromatographR/\") install.packages(\"chromatographR\", repos=\"https://ethanbass.r-universe.dev/\", type=\"source\")"},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/index.html","id":"importing-data","dir":"","previous_headings":"Usage","what":"Importing data","title":"Chromatographic Data Analysis Toolset","text":"chromatographR can import variety vendor formats, including ‘Agilent ChemStation’ ‘MassHunter’ files. accomplished using parsers chromConverter package. See chromConverter page detailed list supported formats. Alternatively, chromatographR can also used regular csv files.","code":""},{"path":"https://ethanbass.github.io/chromatographR/index.html","id":"analysis","dir":"","previous_headings":"Usage","what":"Analysis","title":"Chromatographic Data Analysis Toolset","text":"Please see vignette included package details application chromatographR analysis HPLC data. second vignette suggested workflow analysis GC-FID data forthcoming soon.","code":""},{"path":"https://ethanbass.github.io/chromatographR/index.html","id":"contributing","dir":"","previous_headings":"","what":"Contributing","title":"Chromatographic Data Analysis Toolset","text":"Contributions always welcome. Please get touch (preferable opening GitHub issue) discuss suggestions file bug report. good reasons file issue: ’ve found actual bug. ’re getting cryptic error message don’t understand. file format ’d like read isn’t currently supported chromatographR. (, please make sure include link example file!) new feature ’d like see implemented. Also see contributing.md page details. (Note: Please post questions file conversions chromConverter page).","code":""},{"path":"https://ethanbass.github.io/chromatographR/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation:","title":"Chromatographic Data Analysis Toolset","text":"use chromatographR published work, please cite follows: Bass, E. (2023). chromatographR: Chromatographic Data Analysis Toolset (version 0.7.2). http://doi.org/10.5281/zenodo.6944334","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/Sa.html","id":null,"dir":"Reference","previous_headings":"","what":"Raw goldenrod root chromatograms — Sa","title":"Raw goldenrod root chromatograms — Sa","text":"list four HPLC-DAD data matrices Solidago altissima roots extracted 90% methanol. Retention times stored rows wavelengths stored columns.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/Sa.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Raw goldenrod root chromatograms — Sa","text":"","code":"data(Sa)"},{"path":"https://ethanbass.github.io/chromatographR/reference/Sa.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Raw goldenrod root chromatograms — Sa","text":"list four matrices (1301 times x 60 wavelengths).","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/Sa_pr.html","id":null,"dir":"Reference","previous_headings":"","what":"Preprocessed goldenrod root chromatograms — Sa_pr","title":"Preprocessed goldenrod root chromatograms — Sa_pr","text":"list four pre-processed HPLC-DAD chromatograms derived raw data stored Sa. Retention times stored rows wavelengths stored columns. time axis compressed save space processing time data little choppy.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/Sa_pr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Preprocessed goldenrod root chromatograms — Sa_pr","text":"","code":"data(Sa_pr)"},{"path":"https://ethanbass.github.io/chromatographR/reference/Sa_pr.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Preprocessed goldenrod root chromatograms — Sa_pr","text":"list four pre-processed matrices (434 retention times x 60 wavelengths).","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/Sa_warp.html","id":null,"dir":"Reference","previous_headings":"","what":"Warped goldenrod root chromatograms. — Sa_warp","title":"Warped goldenrod root chromatograms. — Sa_warp","text":"list four pre-processed warped goldenrod root chromatograms derived raw data stored Sa.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/Sa_warp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warped goldenrod root chromatograms. — Sa_warp","text":"","code":"data(Sa_warp)"},{"path":"https://ethanbass.github.io/chromatographR/reference/Sa_warp.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Warped goldenrod root chromatograms. — Sa_warp","text":"list four pre-processed warped matrices (434 times x 60 wavelengths).","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_metadata.html","id":null,"dir":"Reference","previous_headings":"","what":"Attach experimental metadata — attach_metadata","title":"Attach experimental metadata — attach_metadata","text":"Attaches sample metadata `peak_table` object. Metadata provided data.frame object. One columns supplied metadata must match exactly row names peak table.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_metadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Attach experimental metadata — attach_metadata","text":"","code":"attach_metadata(peak_table, metadata, column)"},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_metadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Attach experimental metadata — attach_metadata","text":"peak_table `peak_table` object. metadata `data.frame` containing sample metadata. column name column metadata object containing sample names. Sample names must match row names peak_table$tab.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_metadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Attach experimental metadata — attach_metadata","text":"peak_table object attached metadata $sample_meta slot.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_metadata.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Attach experimental metadata — attach_metadata","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_metadata.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Attach experimental metadata — attach_metadata","text":"","code":"data(pk_tab) path <- system.file(\"extdata\", \"Sa_metadata.csv\", package = \"chromatographR\") meta <- read.csv(path) pk_tab <- attach_metadata(peak_table = pk_tab, metadata = meta, column=\"vial\")"},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_ref_spectra.html","id":null,"dir":"Reference","previous_headings":"","what":"Attach reference spectra — attach_ref_spectra","title":"Attach reference spectra — attach_ref_spectra","text":"Gathers reference spectra attaches peak_table object. Reference spectra defined either spectrum highest intensity ( max.int) spectrum highest average correlation spectra peak_table (max.cor).","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_ref_spectra.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Attach reference spectra — attach_ref_spectra","text":"","code":"attach_ref_spectra(peak_table, chrom_list, ref = c(\"max.cor\", \"max.int\"))"},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_ref_spectra.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Attach reference spectra — attach_ref_spectra","text":"peak_table Peak table get_peaktable. chrom_list list chromatograms matrix format (timepoints x wavelengths). argument provided , function try find chrom_list object used create provided peak_table. ref criterion use select reference spectra. Current options maximum correlation (max.cor) maximum signal intensity (max.int).","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_ref_spectra.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Attach reference spectra — attach_ref_spectra","text":"peak_table object reference spectra attached $ref_spectra slot.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_ref_spectra.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Attach reference spectra — attach_ref_spectra","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_ref_spectra.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Attach reference spectra — attach_ref_spectra","text":"","code":"data(pk_tab) pk_tab <- attach_ref_spectra(pk_tab, ref=\"max.int\") pk_tab <- attach_ref_spectra(pk_tab, ref = \"max.cor\")"},{"path":"https://ethanbass.github.io/chromatographR/reference/boxplot.peak_table.html","id":null,"dir":"Reference","previous_headings":"","what":"Make boxplot from peak table. — boxplot.peak_table","title":"Make boxplot from peak table. — boxplot.peak_table","text":"function can take multiple response variables left hand side formula (separated +). case, separate boxplot produced response variable.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/boxplot.peak_table.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make boxplot from peak table. — boxplot.peak_table","text":"","code":"# S3 method for class 'peak_table' boxplot(x, formula, ...)"},{"path":"https://ethanbass.github.io/chromatographR/reference/boxplot.peak_table.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make boxplot from peak table. — boxplot.peak_table","text":"x peak_table object formula formula object ... Additional arguments boxplot","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/boxplot.peak_table.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make boxplot from peak table. — boxplot.peak_table","text":"","code":"data(pk_tab) path <- system.file(\"extdata\", \"Sa_metadata.csv\", package = \"chromatographR\") meta <- read.csv(path) pk_tab <- attach_metadata(peak_table = pk_tab, metadata = meta, column=\"vial\") boxplot(pk_tab, formula=V11 ~ trt)"},{"path":"https://ethanbass.github.io/chromatographR/reference/chromatographR-package.html","id":null,"dir":"Reference","previous_headings":"","what":"chromatographR — chromatographR-package","title":"chromatographR — chromatographR-package","text":"Chromatographic Data Analysis Toolset","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/chromatographR-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"chromatographR — chromatographR-package","text":"Tools high-throughput analysis HPLC-DAD/UV chromatograms (similar data). Includes functions preprocessing, alignment, peak-finding fitting, peak-table construction, data-visualization, etc. Preprocessing peak-table construction follow rough formula laid alsace (Wehrens, R., Bloemberg, T.G., Eilers P.H.C., 2015. doi:10.1093/bioinformatics/btv299 ). Alignment chromatograms available using parametric time warping (ptw) (Wehrens, R., Bloemberg, T.G., Eilers P.H.C. 2015. doi:10.1093/bioinformatics/btv299 ) variable penalty dynamic time warping (VPdtw) (Clifford, D., & Stone, G. 2012. doi:10.18637/jss.v047.i08 ). Peak-finding relies algorithm suggested Tom O'Haver Pragmatic Introduction Signal Processing. Peaks fitted gaussian exponential-gaussian hybrid peak shape using non-linear least squares (Lan, K. & Jorgenson, J. W. 2001. doi:10.1016/S0021-9673(01)00594-5 ). details package usage suggested workflow can found vignette.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/chromatographR-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"chromatographR — chromatographR-package","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/cluster_spectra.html","id":null,"dir":"Reference","previous_headings":"","what":"Cluster spectra — cluster_spectra","title":"Cluster spectra — cluster_spectra","text":"Cluster peaks spectral similarity.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/cluster_spectra.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cluster spectra — cluster_spectra","text":"","code":"cluster_spectra( peak_table, peak_no = NULL, alpha = 0.05, min_size = 5, max_size = NULL, nboot = 1000, plot_dend = TRUE, plot_spectra = TRUE, verbose = getOption(\"verbose\"), save = FALSE, parallel = TRUE, max.only = FALSE, output = c(\"pvclust\", \"clusters\"), ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/cluster_spectra.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cluster spectra — cluster_spectra","text":"peak_table Peak table get_peaktable. peak_no Minimum maximum thresholds number peaks cluster may . argument deprecated favor min_size max_size. alpha Confidence threshold inclusion cluster. min_size Minimum number peaks cluster may . max_size Maximum number peaks cluster may . nboot Number bootstrap replicates pvclust. plot_dend Logical. TRUE, plots dendrogram bootstrap values. plot_spectra Logical. TRUE, plots overlapping spectra cluster. verbose Logical. TRUE, prints progress report console. save Logical. TRUE, saves pvclust object current directory. parallel Logical. TRUE, use parallel processing pvclust. max.Logical. TRUE, returns highest level nested dendrograms. output return. Either clusters return list clusters, pvclust return pvclust object, return items. ... Additional arguments pvclust.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/cluster_spectra.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cluster spectra — cluster_spectra","text":"Returns clusters /pvclust object according value output argument. output = clusters, returns list S4 cluster objects. output = pvclust, returns pvclust object. output = , returns nested list containing [[1]] pvclust object, [[2]] list S4 cluster objects. cluster objects consist following components: peaks: character vector containing names peaks contained given cluster. pval: numeric vector length 1 containing bootstrap p-value (au) given cluster.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/cluster_spectra.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cluster spectra — cluster_spectra","text":"Function cluster peaks spectral similarity. using function, reference spectra must attached peak_table using attach_ref_spectra function. reference spectra used construct distance matrix based spectral similarity (pearson correlation) peaks. Hierarchical clustering bootstrap resampling performed resulting correlation matrix classify peaks spectral similarity, implemented pvclust. Finally, bootstrap values can used select clusters exceed certain confidence threshold defined alpha. Clusters can filtered minimum maximum size cluster using min_size max_size arguments respectively. max_only TRUE, largest cluster nested tree clusters meeting specified confidence threshold returned.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/cluster_spectra.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Cluster spectra — cluster_spectra","text":"Users aware clustering algorithm often return nested clusters. Thus, individual peak appear one cluster. highly suggested use 100 bootstraps run clustering algorithm real data even though use nboot = 100 example reduce runtime. authors pvclust suggest nboot = 10000.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/cluster_spectra.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Cluster spectra — cluster_spectra","text":"R. Suzuki & H. Shimodaira. 2006. Pvclust: R package assessing uncertainty hierarchical clustering. Bioinformatics, 22(12):1540-1542. doi:10.1093/bioinformatics/btl117 .","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/cluster_spectra.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cluster spectra — cluster_spectra","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/cluster_spectra.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cluster spectra — cluster_spectra","text":"","code":"# \\donttest{ data(pk_tab) data(Sa_warp) pk_tab <- attach_ref_spectra(pk_tab, Sa_warp, ref = \"max.int\") cl <- cluster_spectra(pk_tab, nboot = 100, max.only = FALSE, save = FALSE, alpha = 0.03) # }"},{"path":"https://ethanbass.github.io/chromatographR/reference/combine_peaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Combine peaks — combine_peaks","title":"Combine peaks — combine_peaks","text":"Utility function combine duplicate peaks peak table, .e. peaks integrated one wavelength component. Specify tolerance (tol) retention time matching minimum spectral correlation (min.cor) match.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/combine_peaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Combine peaks — combine_peaks","text":"","code":"combine_peaks( peak_table, tol = 0.01, min.cor = 0.9, choose = \"max\", verbose = getOption(\"verbose\") )"},{"path":"https://ethanbass.github.io/chromatographR/reference/combine_peaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Combine peaks — combine_peaks","text":"peak_table Peak table get_peaktable. tol Tolerance matching retention times (maximum retention time difference). Defaults .01. min.cor Minimum spectral correlation confirm match. Defaults 0.9. choose max retain peak highest intensity. Otherwise, first column data.frame retained. verbose Logical. Whether print status console.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/combine_peaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Combine peaks — combine_peaks","text":"peak table similar input peak table, duplicate columns combined according specified criteria.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/combine_peaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Combine peaks — combine_peaks","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/combine_peaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Combine peaks — combine_peaks","text":"","code":"data(pk_tab) data(Sa_warp) pk_tab <- attach_ref_spectra(pk_tab) combine_peaks(pk_tab, tol = .02, min.cor = .9) #> V1 V2 V3 V4 V5 V6 V7 #> 119 547.5999 0.00000 64.73611 188.9210 1514.4775 31.08266 7972.271 #> 121 426.2768 109.41736 61.30032 0.0000 800.6312 0.00000 5742.089 #> 122 839.5934 94.67302 199.57845 0.0000 2595.0200 179.59510 5966.168 #> 458 620.1729 228.73095 198.89770 530.8515 1399.5000 28.75473 10987.963 #> V8 V9 V10 V11 V12 V13 V14 V15 #> 119 241.2644 4141.194 158.2482 147.14305 228.2495 3616.648 1406.7510 3251.616 #> 121 94.9273 1811.813 0.0000 81.06425 758.0809 1998.574 849.7337 2209.005 #> 122 136.7419 3567.244 0.0000 112.02525 402.7496 3061.476 1147.1180 2717.260 #> 458 362.4412 3319.526 346.4913 312.67651 539.1735 4205.752 2360.5469 2455.022 #> V16 V17 V18 V19 V20 V21 V22 V23 #> 119 0.00000 343.0051 296.6922 113.243756 1147.1798 1384.080 220.73047 0.000000 #> 121 0.00000 101.5689 161.9159 8.007096 656.8275 1189.811 83.93586 5.515938 #> 122 79.15089 159.8489 244.1269 36.488943 795.4071 1427.085 275.36463 5.266083 #> 458 42.90218 445.4984 454.3478 16.246979 1202.3318 1478.686 229.99456 2.937198 #> V24 V25 V26 V27 V28 V29 V30 V31 #> 119 0.7932897 15.283759 1703.289 156.39972 0.00000 49.41934 32.37732 71.26704 #> 121 0.0000000 41.785287 1365.711 34.63006 18.39123 14.90621 15.30085 28.80203 #> 122 0.0000000 11.908741 1589.343 71.47440 37.85030 19.71575 20.80656 23.50600 #> 458 3.5934152 2.675703 2324.971 47.70708 26.21671 41.10378 28.37305 13.11958 #> V32 V33 V34 V35 V36 V37 V38 V39 #> 119 18.098750 34.32758 24.20533 0.00000 40.94460 66.63341 1.560411 628.8432 #> 121 0.000000 25.78324 0.00000 0.00000 58.29037 35.70237 0.000000 313.3893 #> 122 4.146413 88.99537 0.00000 17.72865 63.09756 40.62970 30.633681 1083.3709 #> 458 21.856280 39.24938 0.00000 30.85831 80.37326 77.24610 134.060160 634.5378 #> V40 V41 V45 V50 V51 V52 V57 V58 #> 119 5.954668 3.185244 26.855908 1594.504 181.23686 68.35036 0.000000 6.765074 #> 121 0.000000 17.384465 4.328725 1107.869 46.57830 34.55536 1.169725 3.267406 #> 122 34.168541 0.000000 2.934368 1369.448 94.47697 88.13190 1.348439 4.906127 #> 458 0.000000 5.334132 58.508031 1217.711 254.76091 97.89059 4.839070 1.766295 #> V60 V61 V62 V67 #> 119 10.825399 5.025003 2.659547 9.931884 #> 121 5.880129 0.000000 6.603921 7.197999 #> 122 14.487687 2.717955 2.681821 19.382161 #> 458 11.990751 6.853318 8.433412 21.058001"},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_peaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Correct peak positions according to a PTW warping model — correct_peaks","title":"Correct peak positions according to a PTW warping model — correct_peaks","text":"Corrects retention time differences using parametric time warping implemented ptw.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_peaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correct peak positions according to a PTW warping model — correct_peaks","text":"","code":"correct_peaks(peak_list, mod_list, chrom_list, match_names = TRUE)"},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_peaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Correct peak positions according to a PTW warping model — correct_peaks","text":"peak_list `peak_list` object created get_peaks, containing nested list peak tables first level sample, second level spectral wavelength. Every component described matrix every row one peak, columns contain information retention time, peak width (FWHM), peak width, height, area. mod_list list ptw models. chrom_list List chromatograms supplied create ptw models. match_names Logical. Whether actively match names peak_list list models (mod_list). Defaults TRUE.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_peaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Correct peak positions according to a PTW warping model — correct_peaks","text":"input list peak tables returned extra columns containing corrected retention time.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_peaks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correct peak positions according to a PTW warping model — correct_peaks","text":"appropriate warping model established, corrected retention times can predicted peak. stored separate column list peak tables.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_peaks.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Correct peak positions according to a PTW warping model — correct_peaks","text":"function adapted getPeakTable function alsace package Ron Wehrens.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_peaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Correct peak positions according to a PTW warping model — correct_peaks","text":"Ron Wehrens, Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_rt.html","id":null,"dir":"Reference","previous_headings":"","what":"Correct retention time — correct_rt","title":"Correct retention time — correct_rt","text":"Aligns chromatograms using one two algorithms, according value alg: either parametric time warping, implemented ptw, variable penalty dynamic time warping, implemented VPdtw. init.coef n.traces arguments apply ptw warping, penalty maxshift apply vpdtw warping.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_rt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correct retention time — correct_rt","text":"","code":"correct_rt( chrom_list, lambdas, models = NULL, reference = \"best\", alg = c(\"ptw\", \"vpdtw\"), what = c(\"corrected.values\", \"models\"), init.coef = c(0, 1, 0), n.traces = NULL, n.zeros = 0, scale = FALSE, trwdth = 200, plot_it = FALSE, penalty = 5, maxshift = 50, verbose = getOption(\"verbose\"), show_progress = NULL, cl = 2, ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_rt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Correct retention time — correct_rt","text":"chrom_list List chromatograms matrix format. lambdas Select wavelengths use name. models List models warp . models provided () must match algorithm selected alg. reference Index sample considered reference sample. alg algorithm use: parametric time warping (ptw) variable penalty dynamic time warping (vpdtw). return: either 'corrected.values' (useful visual inspection) warping 'models' (programmatic use). init.coef Starting values optimization. n.traces Number traces use. n.zeros Number zeros add. scale Logical. true, scale chromatograms warping. trwdth width triangle WCC criterion. plot_it Logical. Whether plot alignment. penalty divisor used calculate penalty VPdtw. warping penalty calculated dividing dilation number. Thus, higher number produce lower penalty permissive, lower number produce higher penalty allow less warping. Defaults 5. maxshift Integer. Maximum allowable shift VPdtw. Defaults 50. verbose Whether print verbose output. show_progress Logical. Whether show progress bar. Defaults TRUE pbapply installed. Currently works ptw alignments. cl Argument pblapply mclapply. Either integer specifying number clusters use parallel processing cluster object created makeCluster. Defaults 2. Windows integer values ignored. ... Optional arguments ptw function. argument changed warp.type: always equal \"global\".","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_rt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Correct retention time — correct_rt","text":"list warping models list warped absorbance profiles, depending value argument.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_rt.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Correct retention time — correct_rt","text":"Adapted correctRT function alsace package Ron Wehrens.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_rt.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correct retention time — correct_rt","text":"Clifford, D., Stone, G., Montoliu, ., Rezzi, S., Martin, F. P., Guy, P., Bruce, S., & Kochhar, S. 2009. Alignment using variable penalty dynamic time warping. Analytical chemistry, 81(3):1000-1007. doi:10.1021/ac802041e . Clifford, D., & Stone, G. 2012. Variable Penalty Dynamic Time Warping Code Aligning Mass Spectrometry Chromatograms R. Journal Statistical Software, 47(8):1-17. doi:10.18637/jss.v047.i08 . Eilers, P.H.C. 2004. Parametric Time Warping. Anal. Chem., 76:404-411. doi:10.1021/ac034800e . Wehrens, R., Bloemberg, T.G., Eilers P.H.C. 2015. Fast parametric time warping peak lists. Bioinformatics, 31:3063-3065. doi:10.1093/bioinformatics/btv299 . Wehrens, R., Carvalho, E., Fraser, P.D. 2015. Metabolite profiling LC–DAD using multivariate curve resolution: alsace package R. Metabolomics, 11:143-154. doi:10.1007/s11306-014-0683-5 .","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_rt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Correct retention time — correct_rt","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_rt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Correct retention time — correct_rt","text":"","code":"if (FALSE) { # interactive() data(Sa_pr) warping.models <- correct_rt(Sa_pr, what = \"models\", lambdas=c(210)) warp <- correct_rt(chrom_list = Sa_pr, models = warping.models) }"},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter peak lists — filter_peaks","title":"Filter peak lists — filter_peaks","text":"Utility function remove peaks peak list (e.g., intensity low). Currently one can filter peak height, peak area, standard deviation, /retention time.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter peak lists — filter_peaks","text":"","code":"filter_peaks(peak_list, min_height, min_area, min_sd, max_sd, min_rt, max_rt)"},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter peak lists — filter_peaks","text":"peak_list peak_list object, consisting nested list peak tables, first level sample, second level spectral component. Every component described matrix every row one peak, columns contain information retention time, full width half maximum (FWHM), peak width, height, area. min_height Minimum peak height. min_area Minimum peak area. min_sd Minimal standard deviation. max_sd Maximum standard deviation. min_rt Minimum retention time. max_rt Maximum retention time.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filter peak lists — filter_peaks","text":"peak list similar input, rows removed satisfy specified criteria.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Filter peak lists — filter_peaks","text":"Ron Wehrens, Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaktable.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter peak table — filter_peaktable","title":"Filter peak table — filter_peaktable","text":"Utility function remove peaks peak table, e.g., intensity low. Currently one can filter mean median peak intensity, retention time.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaktable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter peak table — filter_peaktable","text":"","code":"filter_peaktable( peak_table, rts, min_rt, max_rt, min_value, lambda, what = c(\"median\", \"mean\", \"max\"), tol = 0 )"},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaktable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter peak table — filter_peaktable","text":"peak_table peak_table object get_peaktable. rts Vector retention times include peak table. min_rt Minimum retention time include peak table. max_rt Maximum retention time include peak table. min_value Minimal cutoff summarized peak intensity. lambda Component(s) include peak table (e.g. wavelengths using HPLC-DAD/UV). Whether summarize intensities using mean, median, max. tol Tolerance matching retention times rts.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaktable.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filter peak table — filter_peaktable","text":"peak table similar input, columns removed peak table satisfy specified criteria.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaktable.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Filter peak table — filter_peaktable","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaktable.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Filter peak table — filter_peaktable","text":"","code":"data(pk_tab) pk_tab <- filter_peaktable(pk_tab, min_rt = 10, max_rt = 16)"},{"path":"https://ethanbass.github.io/chromatographR/reference/find_peaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Find peaks — find_peaks","title":"Find peaks — find_peaks","text":"Find peaks chromatographic profile.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/find_peaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find peaks — find_peaks","text":"","code":"find_peaks( y, smooth_type = c(\"gaussian\", \"box\", \"savgol\", \"mva\", \"tmva\", \"none\"), smooth_window = 0.001, slope_thresh = 0, amp_thresh = 0, bounds = TRUE )"},{"path":"https://ethanbass.github.io/chromatographR/reference/find_peaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find peaks — find_peaks","text":"y Signal (numerical vector). smooth_type Type smoothing. Either gaussian kernel (\"gaussian\"), box kernel (\"box\"), savitzky-golay smoothing (\"savgol\"), moving average (\"mva\"), triangular moving average (\"tmva\"), smoothing (\"none\"). smooth_window Smoothing window. Larger values parameter exclude sharp, narrow features. supplied value 0 1, window interpreted proportion points include. Otherwise, window absolute number points include window. (Defaults .001). slope_thresh Minimum threshold slope smoothed first derivative. parameter filters basis peak width, larger values exclude broad peaks peak list. (Defaults 0). amp_thresh Minimum threshold peak amplitude. parameter filters basis peak height, larger values exclude small peaks peak list. (Defaults 0). bounds Logical. TRUE, includes peak boundaries data.frame. (Defaults TRUE).","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/find_peaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find peaks — find_peaks","text":"bounds == TRUE, returns data.frame containing center, start, end identified peak. Otherwise, returns numeric vector peak centers. locations expressed indices.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/find_peaks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find peaks — find_peaks","text":"Find peaks looking zero-crossings smoothed first derivative signal (y) exceed specified slope threshold (slope_thresh). Additionally, peaks can filtered supplying minimal amplitude threshold (amp_thresh), filtering peaks specified height. Smoothing intended prevent algorithm getting caught local minima maxima represent true features. Several smoothing options available, including \"gaussian\", box kernel (\"box\"), savitzky-golay smoothing (\"savgol\"), moving average (\"mva\"), triangular moving average (\"tmva\"), smoothing (\"none\"). recommended pre-processing using preprocess function peak detection. Overly high chromatographic resolution can sometimes cause peaks split multiple segments. case, recommended increase smooth_window reduce resolution along time axis adjusting dim1 argument preprocessing.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/find_peaks.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Find peaks — find_peaks","text":"find_peaks function adapted MATLAB code included Prof. Tom O'Haver's Pragmatic Introduction Signal Processing.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/find_peaks.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Find peaks — find_peaks","text":"O'Haver, Tom. Pragmatic Introduction Signal Processing: Applications scientific measurement. https://terpconnect.umd.edu/~toh/spectrum/ (Accessed January, 2022).","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/find_peaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find peaks — find_peaks","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/find_peaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find peaks — find_peaks","text":"","code":"data(Sa_pr) find_peaks(Sa_pr[[1]][,\"220\"]) #> pos lower upper #> 1 28 14 46 #> 2 49 46 52 #> 3 60 53 61 #> 4 69 61 78 #> 5 81 78 85 #> 6 89 85 93 #> 7 104 93 114 #> 8 115 114 118 #> 9 120 118 123 #> 10 131 123 139 #> 11 141 139 147 #> 12 155 149 161 #> 13 167 161 171 #> 14 182 171 188 #> 15 193 188 200 #> 16 215 200 228 #> 17 233 228 238 #> 18 243 238 254 #> 19 261 254 264 #> 20 272 264 279 #> 21 283 279 293 #> 22 297 293 303 #> 23 305 303 309 #> 24 319 315 323 #> 25 336 323 347 #> 26 351 347 363 #> 27 378 363 383 #> 28 388 383 390 #> 29 395 390 401 #> 30 408 401 411 #> 31 417 411 421"},{"path":"https://ethanbass.github.io/chromatographR/reference/fit_peaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","title":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","text":"Fit peak parameters using exponential-gaussian hybrid gaussian function.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/fit_peaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","text":"","code":"fit_peaks( x, lambda, pos = NULL, sd.max = 50, fit = c(\"egh\", \"gaussian\", \"raw\"), max.iter = 1000, estimate_purity = TRUE, noise_threshold = 0.001, ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/fit_peaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","text":"x chromatogram matrix format. lambda Wavelength fit peaks . pos Locations peaks vector y. NULL, find_peaks run automatically find peak positions. sd.max Maximum width (standard deviation) peaks. Defaults 50. fit Function peak fitting. (Currently exponential-gaussian hybrid egh, gaussian raw settings supported). raw selected, trapezoidal integration performed raw data without fitting peak shape. Defaults egh.) max.iter Maximum number iterations use nonlinear least squares peak-fitting. (Defaults 1000). estimate_purity Logical. Whether estimate purity . Defaults TRUE. noise_threshold Noise threshold. Input get_purity. ... Additional arguments find_peaks.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/fit_peaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","text":"fit_peaks function returns matrix, whose columns contain following information peak: rt Location peak maximum. start Start peak (included table bounds = TRUE). end End peak (included table bounds = TRUE). sd standard deviation peak. tau \\(\\tau\\) parameter (included table fit = \"egh\"). FWHM full width half maximum. height Peak height. area Peak area. r.squared R-squared value linear fit model data. purity spectral purity peak assessed get_purity. , first five elements (rt, start, end, sd FWHM) expressed indices, terms real retention times. transformation \"real\" time done function get_peaks.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/fit_peaks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","text":"Peak parameters calculated fitting data gaussian exponential-gaussian hybrid curve using non-linear least squares estimation implemented nlsLM. Area fitted curve estimated using trapezoidal approximation.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/fit_peaks.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","text":"fit_peaks function adapted Dr. Robert Morrison's DuffyTools package well code published Ron Wehrens' alsace package.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/fit_peaks.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","text":"* Lan, K. & Jorgenson, J. W. 2001. hybrid exponential gaussian functions simple model asymmetric chromatographic peaks. Journal Chromatography 915:1-13. doi:10.1016/S0021-9673(01)00594-5 . * Naish, P. J. & Hartwell, S. 1988. Exponentially Modified Gaussian functions - good model chromatographic peaks isocratic HPLC? Chromatographia, /bold26: 285-296. doi:10.1007/BF02268168 .","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/fit_peaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/fit_peaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","text":"","code":"data(Sa_pr) fit_peaks(Sa_pr[[1]], lambda = 220) #> rt start end sd tau FWHM height #> 1 30.69332 14 46 6.2865644 1.20769992 14.773426 8.9910726 #> 2 50.94330 46 52 0.5711967 -11.41366848 1.342312 0.3652505 #> 3 61.44532 53 61 3.2042222 2.37308275 7.529922 12.7874585 #> 4 69.97526 61 78 2.7067311 -1.01879444 6.360818 118.1461826 #> 5 82.42709 78 85 1.3744994 -0.73109961 3.230074 1.5745430 #> 6 89.64284 85 93 1.5296385 0.61202488 3.594650 2.3360448 #> 7 104.49707 93 114 2.1826134 -0.19394678 5.129142 878.3558848 #> 8 81.84177 114 118 2.4690722 22.61770113 5.802320 9.6411867 #> 9 119.85327 118 123 5.2832737 -13.86056689 12.415693 8.5707183 #> 10 131.85675 123 139 1.8315236 0.11513594 4.304081 418.7796260 #> 11 141.10828 139 147 4.1299082 -4.37157201 9.705284 8.5085781 #> 12 156.09501 149 161 1.7963783 -0.01487998 4.221489 5.8543152 #> 13 167.73853 161 171 1.6517982 -0.14556475 3.881726 25.5505898 #> 14 183.22815 171 188 2.0807233 -0.22145455 4.889700 350.1547326 #> 15 193.98654 188 200 2.4682084 -1.29245512 5.800290 119.6729349 #> 16 216.44045 200 228 1.8375563 -0.13007408 4.318257 319.6260534 #> 17 234.50440 228 238 1.9619252 -0.17648212 4.610524 35.8686113 #> 18 243.58113 238 254 4.9483859 0.66568143 11.628707 15.8252538 #> 19 262.00099 254 264 1.8302984 -0.98597515 4.301201 17.3957395 #> 20 272.87432 264 279 3.0837104 0.05107119 7.246719 96.9289225 #> 21 284.45995 279 293 1.8712197 -0.34947351 4.397366 121.3286776 #> 22 298.28530 293 303 2.0217365 -0.90317976 4.751081 14.6884289 #> 24 320.15708 315 323 1.2587749 0.34042184 2.958121 0.6212100 #> 25 336.89949 323 347 2.2339189 -0.82019092 5.249709 157.2481960 #> 26 351.82167 347 363 4.3854006 2.73641711 10.305691 7.1109632 #> 27 379.01651 363 383 9.6193330 -13.36671566 22.605432 3.8470521 #> 28 389.96461 383 390 0.4505398 -11.19848606 1.058768 5.0689224 #> 29 396.32753 390 401 7.3086188 -2.14825864 17.175254 6.6276427 #> 30 410.94947 401 411 1.7808715 -123.44165218 4.185048 5.5950637 #> 31 419.42472 411 421 4.8293966 -14.83514636 11.349082 7.4589610 #> area r.squared purity #> 1 141.609052 0.9869708 0.63636364 #> 2 1.533815 0.7267476 1.00000000 #> 3 44.203814 0.9997068 1.00000000 #> 4 844.468381 0.9954198 0.17647059 #> 5 7.929626 0.9529150 1.00000000 #> 6 9.913595 0.9974965 1.00000000 #> 7 4895.362421 0.9991512 0.08333333 #> 8 37.726631 0.8292605 0.60000000 #> 9 36.686028 0.9637970 1.00000000 #> 10 2149.825149 0.9991802 0.15384615 #> 11 42.867284 0.9910774 1.00000000 #> 12 31.941462 0.9960339 1.00000000 #> 13 116.325582 0.9997472 0.90909091 #> 14 2159.863516 0.9987345 0.15384615 #> 15 749.502596 0.9870224 0.18181818 #> 16 1996.653868 0.9988400 0.50000000 #> 17 231.767485 0.9889112 0.72727273 #> 18 148.058988 0.8325459 0.52941176 #> 19 88.004196 0.9912112 0.63636364 #> 20 713.899661 0.9118992 0.46666667 #> 21 753.063438 0.9843055 0.26666667 #> 22 84.486071 0.9455491 0.72727273 #> 24 2.923839 0.9897500 1.00000000 #> 25 972.579141 0.9950354 0.33333333 #> 26 70.695956 0.7701393 1.00000000 #> 27 63.752468 0.9955775 1.00000000 #> 28 30.677295 0.9392470 1.00000000 #> 29 64.992481 0.8411157 1.00000000 #> 30 54.963920 0.8662737 1.00000000 #> 31 67.504644 0.8950062 1.00000000"},{"path":"https://ethanbass.github.io/chromatographR/reference/get_agilent_threshold.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate purity thresholds — get_agilent_threshold","title":"Calculate purity thresholds — get_agilent_threshold","text":"Calculate purity thresholds","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_agilent_threshold.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate purity thresholds — get_agilent_threshold","text":"","code":"get_agilent_threshold( x, pos, weight = 1, noise_variance = NULL, noise_threshold = 0.005, lambdas )"},{"path":"https://ethanbass.github.io/chromatographR/reference/get_agilent_threshold.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate purity thresholds — get_agilent_threshold","text":"x chromatogram matrix format pos vector containing peak information weight Scaling parameter affecting stringency threshold. Defaults 1. noise_variance Variance noise. noise_threshold Threshold define noise. Highest proportion maximum absorbance. Defaults .005. lambdas Wavelengths include","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_agilent_threshold.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate purity thresholds — get_agilent_threshold","text":"Returns vector purity thresholds retention time index within peak specified pos.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_agilent_threshold.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate purity thresholds — get_agilent_threshold","text":"Stahl, Mark. “Peak Purity Analysis HPLC CE Using Diode-Array Technology.” Agilent Technologies, April 1, 2003, 16. /hrefhttps://www.agilent.com/cs/library/applications/5988-8647EN.pdf","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_agilent_threshold.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate purity thresholds — get_agilent_threshold","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_lambdas.html","id":null,"dir":"Reference","previous_headings":"","what":"Get lambdas — get_lambdas","title":"Get lambdas — get_lambdas","text":"Get wavelengths list chromatograms peak_table object.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_lambdas.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get lambdas — get_lambdas","text":"","code":"get_lambdas(x)"},{"path":"https://ethanbass.github.io/chromatographR/reference/get_lambdas.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get lambdas — get_lambdas","text":"x List chromatograms peak_table object.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_lambdas.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get lambdas — get_lambdas","text":"Numeric vector wavelengths.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Get peak list. — get_peaks","title":"Get peak list. — get_peaks","text":"Finds fits peaks extracts peak parameters list chromatograms specified wavelengths.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get peak list. — get_peaks","text":"","code":"get_peaks( chrom_list, lambdas, fit = c(\"egh\", \"gaussian\", \"raw\"), sd.max = 50, max.iter = 100, time.units = c(\"min\", \"s\", \"ms\"), estimate_purity = FALSE, noise_threshold = 0.001, show_progress = NULL, cl = 2, collapse = FALSE, ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get peak list. — get_peaks","text":"chrom_list list profile matrices, dimensions (timepoints × wavelengths). lambdas Character vector wavelengths find peaks . fit type fit use. Current options exponential-gaussian hybrid (egh), gaussian raw. raw setting performs trapezoidal integration directly raw data without fitting peak shape. sd.max Maximum width (standard deviation) peaks. Defaults 50. max.iter Maximum number iterations non-linear least squares fit_peaks. time.units Units sd, FWHM, area, tau (applicable). Options minutes (\"min\"), seconds (\"s\"), milliseconds (\"ms\"). estimate_purity Logical. Whether estimate purity . Defaults FALSE. (TRUE, slow function significantly). noise_threshold Noise threshold. Argument get_purity. show_progress Logical. Whether show progress bar. Defaults TRUE pbapply installed. cl Argument pblapply mclapply. Either integer specifying number clusters use parallel processing cluster object created makeCluster. Defaults 2. Windows integer values ignored. collapse Logical. Whether collapse multiple peak lists per sample single list multiple wavelengths (lambdas) provided. ... Additional arguments find_peaks. Arguments provided find_peaks can used fine-tune peak-finding algorithm. importantly, smooth_window increased features split multiple bins. arguments can used include smooth_type, slope_thresh, amp_thresh.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get peak list. — get_peaks","text":"result S3 object class peak_list, containing nested list data.frames containing information peaks fitted chromatogram wavelengths specified lamdas argument. row data.frames peak columns contain information various peak parameters: rt: retention time peak maximum. start: retention time peak estimated begin. end: retention time peak estimated end. sd: standard deviation fitted peak shape. tau value parameter \\(\\tau\\). parameter determines peak asymmetry peaks fit exponential-gaussian hybrid function. (column appear fit = egh. FWHM: full-width half maximum. height: height peak. area: area peak determined trapezoidal approximation. r.squared coefficient determination (\\(R^2\\)) fitted model raw data. (Note: value calculated fitting linear model fitted peak values raw data. approach statistically questionable, since models fit using non-linear least squares. Nevertheless, can still useful rough metric \"goodness--fit\"). purity peak purity.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get peak list. — get_peaks","text":"Peaks located finding zero-crossings smoothed first derivative specified chromatographic traces (function find_peaks). given positions, exponential-gaussian hybrid (regular gaussian) function fit signal using fit_peaks according value fit. Finally, area calculated using trapezoidal approximation. Additional arguments can provided find_peaks fine-tune peak-finding algorithm. example, smooth_window can increased prevent peaks split multiple features. Overly aggressive smoothing may cause small peaks overlooked. standard deviation (sd), full-width half maximum (FWHM), tau tau, area returned units determined time.units. default, units minutes. compare directly 'ChemStation' integration results, time units seconds.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaks.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Get peak list. — get_peaks","text":"bones function adapted getAllPeaks function authored Ron Wehrens (though underlying algorithms peak identification peak-fitting ).","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaks.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Get peak list. — get_peaks","text":"Lan, K. & Jorgenson, J. W. 2001. hybrid exponential gaussian functions simple model asymmetric chromatographic peaks. Journal Chromatography 915:1-13. doi:10.1016/S0021-9673(01)00594-5 . Naish, P. J. & Hartwell, S. 1988. Exponentially Modified Gaussian functions - good model chromatographic peaks isocratic HPLC? Chromatographia, 26: 285-296. doi:10.1007/BF02268168 . O'Haver, Tom. Pragmatic Introduction Signal Processing: Applications scientific measurement. https://terpconnect.umd.edu/~toh/spectrum/ (Accessed January, 2022). Wehrens, R., Carvalho, E., Fraser, P.D. 2015. Metabolite profiling LC–DAD using multivariate curve resolution: alsace package R. Metabolomics 11:143-154. doi:10.1007/s11306-014-0683-5 .","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get peak list. — get_peaks","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get peak list. — get_peaks","text":"","code":"if (FALSE) { # interactive() data(Sa_pr) pks <- get_peaks(Sa_pr, lambdas = c('210'), sd.max=50, fit=\"egh\") }"},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaktable.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert peak list into an ordered peak table. — get_peaktable","title":"Convert peak list into an ordered peak table. — get_peaktable","text":"Returns peak_table object. first slot contains matrix intensities, rows correspond samples columns correspond aligned features. rest slots contain various meta-data peaks, samples, experimental settings.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaktable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert peak list into an ordered peak table. — get_peaktable","text":"","code":"get_peaktable( peak_list, chrom_list, response = c(\"area\", \"height\"), use.cor = NULL, 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\") )"},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaktable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert peak list into an ordered peak table. — get_peaktable","text":"peak_list peak_list object created get_peaks, containing nested list peak tables: first level sample, second level spectral wavelength. Every component described data.frame row peak columns containing information various peak parameters. chrom_list list chromatographic matrices. response Indicates whether peak area peak height used intensity measure. Defaults area setting. use.cor Logical. Indicates whether use corrected retention times (rt.cor column) raw retention times (rt column). Unless otherwise specified, rt.cor column used default exists provided peak_list. hmax Height complete linkage dendrogram cut. Can interpreted maximal intercluster retention time difference. plot_it Logical. TRUE, every component strip plot shown indicating clustering. ask Logical. Ask showing new plot? Defaults TRUE. clust Specify whether perform hierarchical clustering based spectral similarity retention time (sp.rt) retention time alone (rt). Defaults rt. sp.rt option experimental used caution. sigma.t Width gaussian retention time distance function. Controls weight given retention time sp.rt selected. sigma.r Width gaussian spectral similarity function. Controls weight given spectral correlation sp.rt selected. deepSplit Logical. Controls sensitivity cluster splitting. TRUE, function return smaller clusters. See documentation cutreeDynamic additional information. verbose Logical. Whether print warning combining peaks single time window. Defaults FALSE. Specify data.frame matrix output. Defaults data.frame.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaktable.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert peak list into an ordered peak table. — get_peaktable","text":"function returns S3 peak_table object, containing following elements: tab: peak table – data-frame intensities sample x peak configuration. pk_meta: data.frame containing peak meta-data (e.g., spectral component, peak number, average retention time). sample_meta: data.frame sample meta-data. Must added using attach_metadata. ref_spectra: data.frame reference spectra (wavelength x peak configuration). Must added using attach_ref_spectra. args: vector arguments given get_peaktable generate peak table.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaktable.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Convert peak list into an ordered peak table. — get_peaktable","text":"function performs complete linkage clustering retention times across samples, cuts height given user (can understood maximal inter-cluster retention time difference) simple case based retention times. Clustering can also incorporate information spectral similarity using distance function adapted Broeckling et al., 2014: $$e^{-\\frac{(1-c_{ij})^2}{2\\sigma_r^2}} \\cdot e^{-\\frac{(1-(t_i-t_j)^2)}{2\\sigma_t^2}}$$ two peaks sample assigned cluster, warning message printed console. warnings can usually ignored, one also consider reducing hmax variable. However, may lead splitting peaks across multiple clusters. Another option filter peaks intensity remove small features.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaktable.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Convert peak list into an ordered peak table. — get_peaktable","text":"function adapted getPeakTable function alsace package Ron Wehrens.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaktable.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Convert peak list into an ordered peak table. — get_peaktable","text":"Broeckling, C. D., Afsar F.., Neumann S., Ben-Hur ., Prenni J.E. 2014. RAMClust: Novel Feature Clustering Method Enables Spectral-Matching-Based Annotation Metabolomics Data. Anal. Chem. 86:6812-6817. doi:10.1021/ac501530d . Wehrens, R., Carvalho, E., Fraser, P.D. 2015. Metabolite profiling LC–DAD using multivariate curve resolution: alsace package R. Metabolomics 11:143-154. doi:10.1007/s11306-014-0683-5 .","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaktable.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Convert peak list into an ordered peak table. — get_peaktable","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaktable.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert peak list into an ordered peak table. — get_peaktable","text":"","code":"if (FALSE) { # interactive() data(Sa_pr) pks <- get_peaks(Sa_pr, lambdas = c('210')) get_peaktable(pks, response = \"area\") }"},{"path":"https://ethanbass.github.io/chromatographR/reference/get_purity.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate mean peak purity — get_purity","title":"Calculate mean peak purity — get_purity","text":"Estimates peak purity assessing dissimilarity spectra comprising peak, using method described Stahl 2003.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_purity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate mean peak purity — get_purity","text":"","code":"get_purity( x, pos, weight = 1, cutoff = 0.05, noise_variance = NULL, noise_threshold = 0.01, lambdas, try = TRUE )"},{"path":"https://ethanbass.github.io/chromatographR/reference/get_purity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate mean peak purity — get_purity","text":"x chromatogram matrix format pos vector containing center, lower upper bounds peak numeric indices. weight Weight provided get_agilent_threshold. cutoff Proportion maximum absorbance use cutoff. Argument trim_peak. Defaults .05. noise_variance Variance noise. Argument get_agilent_threshold. noise_threshold Threshold define noise. Highest proportion maximum absorbance. Defaults .01. lambdas Wavelengths include calculations. try Logical. Whether estimate purity . Defaults TRUE.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_purity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate mean peak purity — get_purity","text":"Returns mean purity peak specified pos, defined proportion timepoints purity values 1.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_purity.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate mean peak purity — get_purity","text":"Stahl, Mark. “Peak Purity Analysis HPLC CE Using Diode-Array Technology.” Agilent Technologies, April 1, 2003, 16. /hrefhttps://www.agilent.com/cs/library/applications/5988-8647EN.pdf","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_purity.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate mean peak purity — get_purity","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_times.html","id":null,"dir":"Reference","previous_headings":"","what":"Get retention times — get_times","title":"Get retention times — get_times","text":"Get retention times list chromatograms peak_table object.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_times.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get retention times — get_times","text":"","code":"get_times(x, idx = 1)"},{"path":"https://ethanbass.github.io/chromatographR/reference/get_times.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get retention times — get_times","text":"x List chromatograms peak_table object. idx Index chromatogram extract times","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_times.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get retention times — get_times","text":"Numeric vector retention times chromatogram specified idx.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/merge_peaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Merge split peaks — merge_peaks","title":"Merge split peaks — merge_peaks","text":"Utility function combine split peaks single column peak table.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/merge_peaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Merge split peaks — merge_peaks","text":"","code":"merge_peaks(peak_table, peaks, method = c(\"max\", \"sum\"))"},{"path":"https://ethanbass.github.io/chromatographR/reference/merge_peaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Merge split peaks — merge_peaks","text":"peak_table Peak table get_peaktable. peaks vector specifying names indices peaks merged. method Method merge peaks. Either max select largest peak sample sum sum peaks together.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/merge_peaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Merge split peaks — merge_peaks","text":"peak table similar input peak table, specified columns combined.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/merge_peaks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Merge split peaks — merge_peaks","text":"Merges specified peaks peak table, selecting largest value column method \"max\". method \"sum\", merges peak summing values.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/merge_peaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Merge split peaks — merge_peaks","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/merge_peaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Merge split peaks — merge_peaks","text":"","code":"data(pk_tab) pk_tab <- merge_peaks(peak_table = pk_tab, peaks=c(\"V10\",\"V11\"))"},{"path":"https://ethanbass.github.io/chromatographR/reference/mirror_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Make mirror plot from peak table. — mirror_plot","title":"Make mirror plot from peak table. — mirror_plot","text":"Plots chromatograms mirror plot.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/mirror_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make mirror plot from peak table. — mirror_plot","text":"","code":"mirror_plot( x, chrom_list, lambdas = NULL, var, subset = NULL, print_legend = TRUE, legend_txt = NULL, legend_pos = \"topright\", legend_size = 1, mirror = TRUE, xlim = NULL, ylim = NULL, ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/mirror_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make mirror plot from peak table. — mirror_plot","text":"x peak table (output get_peaktable function). chrom_list list chromatograms matrix format (timepoints x wavelengths). argument provided , function try find chrom_list object used create peak_table. lambdas wavelength wish plot traces . var Variable index chromatograms. subset Character vector specifying levels use (2 levels present var). print_legend Logical. Whether print legend. Defaults TRUE. legend_txt Character vector containing labels legend. legend_pos Legend position. legend_size Legend size (cex argument). Default 1. mirror Logical. Whether plot mirror stacked plots. Defaults TRUE. xlim Numerical vector specifying limits x axis. ylim Numerical vector specifying limits y axis. ... Additional arguments matplot function.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/mirror_plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make mirror plot from peak table. — mirror_plot","text":"return value, called side effects.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/mirror_plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Make mirror plot from peak table. — mirror_plot","text":"Can used confirm identity peak check particular column peak table represents single compound. Can also used create simple box-plots examine distribution peak respect variables defined sample metadata.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/mirror_plot.html","id":"side-effects","dir":"Reference","previous_headings":"","what":"Side effects","title":"Make mirror plot from peak table. — mirror_plot","text":"mirror_plot TRUE, plots mirror plot comparing two treatments defined var subset (two factors present var). Otherwise, mirror_plot FALSE, treatments plotted two separate panes.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/mirror_plot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Make mirror plot from peak table. — mirror_plot","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/mirror_plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make mirror plot from peak table. — mirror_plot","text":"","code":"data(Sa_warp) data(pk_tab) path <- system.file(\"extdata\", \"Sa_metadata.csv\", package = \"chromatographR\") meta <- read.csv(path) pk_tab <- attach_metadata(peak_table = pk_tab, metadata = meta, column=\"vial\") mirror_plot(pk_tab,lambdas = c(\"210\",\"260\"), var = \"trt\", mirror = TRUE, col = c(\"green\",\"blue\"))"},{"path":"https://ethanbass.github.io/chromatographR/reference/normalize_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Normalize peak table or chromatograms — normalize_data","title":"Normalize peak table or chromatograms — normalize_data","text":"Normalizes peak table list chromatograms specified column sample metadata. Metadata must first attached peak_table using attach_metadata.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/normalize_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Normalize peak table or chromatograms — normalize_data","text":"","code":"normalize_data( peak_table, column, chrom_list, what = c(\"peak_table\", \"chrom_list\"), by = c(\"meta\", \"peak\") )"},{"path":"https://ethanbass.github.io/chromatographR/reference/normalize_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Normalize peak table or chromatograms — normalize_data","text":"peak_table `peak_table` object column name column containing weights. chrom_list List chromatograms normalization. samples must order peak_table. argument provided , function try find chrom_list object used create provided peak_table. `peak_table` list chromatograms (`chrom_list`). Whether normalize column sample metadata (meta) column peak table (peak).","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/normalize_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Normalize peak table or chromatograms — normalize_data","text":"peak_table object peaks normalized mass sample.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/normalize_data.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Normalize peak table or chromatograms — normalize_data","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/normalize_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Normalize peak table or chromatograms — normalize_data","text":"","code":"data(pk_tab) path <- system.file(\"extdata\", \"Sa_metadata.csv\", package = \"chromatographR\") meta <- read.csv(path) pk_tab <- attach_metadata(peak_table = pk_tab, metadata = meta, column=\"vial\") norm <- normalize_data(pk_tab, \"mass\", what = \"peak_table\")"},{"path":"https://ethanbass.github.io/chromatographR/reference/pk_tab.html","id":null,"dir":"Reference","previous_headings":"","what":"Goldenrod peak table — pk_tab","title":"Goldenrod peak table — pk_tab","text":"Peak table generated exemplary goldenrod root extracts.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/pk_tab.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Goldenrod peak table — pk_tab","text":"","code":"data(pk_tab)"},{"path":"https://ethanbass.github.io/chromatographR/reference/pk_tab.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Goldenrod peak table — pk_tab","text":"peak_table object.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot fitted peak shapes. — plot.peak_list","title":"Plot fitted peak shapes. — plot.peak_list","text":"Visually assess integration accuracy plotting fitted peaks trace.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot fitted peak shapes. — plot.peak_list","text":"","code":"# S3 method for class 'peak_list' plot( x, ..., chrom_list, idx = 1, lambda = NULL, points = FALSE, ticks = FALSE, a = 0.5, color = NULL, cex.points = 0.5, numbers = FALSE, cex.font = 0.5, y.offset = 25, plot_purity = FALSE, res, index = NULL )"},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot fitted peak shapes. — plot.peak_list","text":"x peak_list object. Output get_peaks function. ... Additional arguments main plot function. chrom_list List chromatograms (retention time x wavelength matrices) idx Index name chromatogram plotted. lambda Wavelength plotting. points Logical. TRUE, plot peak maxima. Defaults FALSE. ticks Logical. TRUE, mark beginning end peak. Defaults FALSE. Alpha parameter controlling transparency fitted shapes. color color fitted shapes. cex.points Size points. Defaults 0.5 numbers Whether number peaks. Defaults FALSE. cex.font Font size peaks numbered. Defaults 0.5. y.offset Y offset peak numbers. Defaults 25. plot_purity Whether add visualization peak purity. res time resolution peak fitting index argument deprecated. Please use idx instead.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot fitted peak shapes. — plot.peak_list","text":"return value, called side effects.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_list.html","id":"side-effects","dir":"Reference","previous_headings":"","what":"Side effects","title":"Plot fitted peak shapes. — plot.peak_list","text":"Plots chromatographic trace specified chromatogram (chr) specified wavelength (lambda) fitted peak shapes provided peak_list drawn underneath curve.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_list.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot fitted peak shapes. — plot.peak_list","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_table.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot spectrum from peak table — plot.peak_table","title":"Plot spectrum from peak table — plot.peak_table","text":"Plots trace /spectrum given peak peak table.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_table.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot spectrum from peak table — plot.peak_table","text":"","code":"# S3 method for class 'peak_table' plot( x, loc, chrom_list, what = \"peak\", idx = \"max\", lambda = \"max\", plot_spectrum = TRUE, plot_trace = TRUE, box_plot = FALSE, vars = NULL, spectrum_labels = TRUE, scale_spectrum = FALSE, export_spectrum = FALSE, verbose = TRUE, engine = c(\"base\", \"plotly\", \"ggplot\"), chr = NULL, ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_table.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot spectrum from peak table — plot.peak_table","text":"x peak table (output get_peaktable function). loc vector specifying peak(s) retention time(s) wish plot. chrom_list list chromatograms matrix format (timepoints x wavelengths). argument provided , function try find chrom_list object used create peak_table. look . Either peak extract spectral information certain peak, rt scan retention time, click manually select retention time clicking chromatogram. Defaults peak. idx Numerical index chromatogram wish plot; \"max\" plot chromatogram largest signal; \"\" plot spectra chromatograms. lambda wavelength wish plot trace (plot_chrom TRUE /wavelength used determination signal abundance. plot_spectrum Logical. TRUE, plots spectrum chosen peak. Defaults TRUE. plot_trace Logical. TRUE, plots trace chosen peak lambda. Defaults TRUE. box_plot Logical. TRUE, plots box plot using categories defined vars. vars Independent variables boxplot. Righthand side formula. spectrum_labels Logical. TRUE, plots labels maxima spectral plot. Defaults TRUE. scale_spectrum Logical. TRUE, scales spectrum unit height. Defaults FALSE. export_spectrum Logical. TRUE, exports spectrum console. Defaults FALSE. verbose Logical. TRUE, prints verbose output console. Defaults TRUE. engine plotting engine use: either base plotly. chr Deprecated. Please use idx instead. ... Additional arguments boxplot.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_table.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot spectrum from peak table — plot.peak_table","text":"export_spectrum TRUE, returns spectrum data.frame wavelengths rows columns encoding absorbance (normalized absorbance, scale_spectrum TRUE) specified sample(s). Otherwise, return value.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_table.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot spectrum from peak table — plot.peak_table","text":"Can used confirm identity peak check particular column peak table represents single compound. Can also used create simple box-plots examine distribution peak respect variables defined sample metadata.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_table.html","id":"side-effects","dir":"Reference","previous_headings":"","what":"Side effects","title":"Plot spectrum from peak table — plot.peak_table","text":"plot_trace TRUE, plots chromatographic trace specified chromatogram (idx), specified wavelength (lambda) dotted red line indicate retention time given loc. trace single column chromatographic matrix. plot_spectrum TRUE, plots spectrum specified chromatogram specified retention time. spectrum single row chromatographic matrix. box_plot TRUE, produces boxplot specified peak groups provided vars.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_table.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot spectrum from peak table — plot.peak_table","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.ptw_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot PTW alignments — plot.ptw_list","title":"Plot PTW alignments — plot.ptw_list","text":"Plot PTW alignments","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.ptw_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot PTW alignments — plot.ptw_list","text":"","code":"# S3 method for class 'ptw_list' plot(x, lambdas, legend = TRUE, ...)"},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.ptw_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot PTW alignments — plot.ptw_list","text":"x ptw_list object created correct_rt. lambdas lambdas plot. legend Logical. Whether label plots. ... Additional arguments matplot.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.ptw_list.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot PTW alignments — plot.ptw_list","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_all_spectra.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot all spectra for chosen peak. — plot_all_spectra","title":"Plot all spectra for chosen peak. — plot_all_spectra","text":"Plot multiple given peak peak table. Wrapper plot_spectrum.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_all_spectra.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot all spectra for chosen peak. — plot_all_spectra","text":"","code":"plot_all_spectra( peak, peak_table, chrom_list, idx = \"all\", chrs = NULL, engine = c(\"base\", \"ggplot2\", \"plotly\"), plot_spectrum = TRUE, export_spectrum = TRUE, scale_spectrum = TRUE, overlapping = TRUE, verbose = FALSE, what = c(\"peak\", \"rt\", \"idx\"), ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_all_spectra.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot all spectra for chosen peak. — plot_all_spectra","text":"peak name peak plot (character format) peak_table peak table (output get_peaktable function) chrom_list list chromatograms matrix format (timepoints x components). argument provided , function try find chrom_list object used create provided peak_table. idx Vector chromatograms plot. chrs Deprecated. Please use idx instead. engine plotting engine use: base, ggplot2, plotly. plot_spectrum Logical. TRUE, plots spectrum chosen peak. export_spectrum Logical. TRUE, exports spectrum console. Defaults FALSE. scale_spectrum Logical. TRUE, scales spectrum unit height. overlapping Logical. TRUE, plot spectra single plot. verbose Logical. TRUE, prints verbose output console. look . Either peak extract spectral information certain peak, rt scan retention time, idx scan numeric index. Defaults \"peak\" mode. ... Additional arguments plot_spectrum.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_all_spectra.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot all spectra for chosen peak. — plot_all_spectra","text":"export_spectrum TRUE, returns spectra data.frame wavelengths rows one column sample chrom_list encoding absorbance (normalized absorbance, scale_spectrum TRUE) wavelength. Otherwise, return value.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_all_spectra.html","id":"side-effects","dir":"Reference","previous_headings":"","what":"Side effects","title":"Plot all spectra for chosen peak. — plot_all_spectra","text":"plot_spectrum TRUE, plots spectra specified chromatogram (idx) given peak. spectrum single row chromatographic matrix.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_all_spectra.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot all spectra for chosen peak. — plot_all_spectra","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_all_spectra.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot all spectra for chosen peak. — plot_all_spectra","text":"","code":"if (FALSE) { # interactive() data(Sa_warp) pks <- get_peaks(Sa_warp, lambda=\"220\") pk_tab <- get_peaktable(pks) plot_all_spectra(peak=\"V13\", peak_table = pk_tab, overlapping=TRUE) }"},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_chroms.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot traces from list of chromatograms. — plot_chroms","title":"Plot traces from list of chromatograms. — plot_chroms","text":"Plots specified traces list chromatograms.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_chroms.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot traces from list of chromatograms. — plot_chroms","text":"","code":"plot_chroms( x, lambdas, idx, xlim, ylim, xlab = \"\", ylab = \"Absorbance\", engine = c(\"base\", \"ggplot\", \"plotly\"), linewidth = 1, show_legend = TRUE, legend_position = \"topright\", ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_chroms.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot traces from list of chromatograms. — plot_chroms","text":"x list chromatograms matrix format (timepoints x wavelengths). lambdas wavelength(s) wish plot trace . idx vector representing names numerical indices chromatograms plot. xlim Range x axis. ylim Range y axis. xlab X label. ylab Y label. Defaults \"Absorbance\". engine Plotting engine. Either base (matplot), plotly, ggplot2-package. linewidth Line width. show_legend Logical. Whether display legend . Defaults TRUE. legend_position Position legend. ... Additional arguments plotting function specified engine.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_chroms.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot traces from list of chromatograms. — plot_chroms","text":"return value, called side effects.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_chroms.html","id":"side-effects","dir":"Reference","previous_headings":"","what":"Side effects","title":"Plot traces from list of chromatograms. — plot_chroms","text":"Plots traces specified chromatograms idx specified wavelengths lambdas. Plots can produced using base graphics, ggplot2, plotly, according value engine.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_chroms.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot traces from list of chromatograms. — plot_chroms","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_chroms.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot traces from list of chromatograms. — plot_chroms","text":"","code":"data(Sa_pr) plot_chroms(Sa_pr, idx = c(1:2), lambdas = c(210))"},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_spectrum.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot spectrum from peak table — plot_spectrum","title":"Plot spectrum from peak table — plot_spectrum","text":"Plots trace /spectrum given peak peak.table object, plots spectrum particular retention time given chromatogram.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_spectrum.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot spectrum from peak table — plot_spectrum","text":"","code":"plot_spectrum( loc = NULL, peak_table, chrom_list, idx = \"max\", lambda = \"max\", plot_spectrum = TRUE, plot_trace = TRUE, spectrum_labels = TRUE, scale_spectrum = FALSE, export_spectrum = FALSE, verbose = TRUE, what = c(\"peak\", \"rt\", \"idx\", \"click\"), engine = c(\"base\", \"plotly\", \"ggplot2\"), chr = NULL, ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_spectrum.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot spectrum from peak table — plot_spectrum","text":"loc name peak retention time wish extract spectral data. peak_table peak table (output get_peaktable). chrom_list list chromatograms matrix format (timepoints x wavelengths). argument provided , function try find chrom_list object used create provided peak_table. idx Numerical index chromatogram wish plot, \"max\" automatically plot chromatogram largest signal. lambda wavelength wish plot trace plot_trace == TRUE /wavelength used determination signal abundance. plot_spectrum Logical. TRUE, plots spectrum chosen peak. Defaults TRUE. plot_trace Logical. TRUE, plots trace chosen peak lambda. Defaults TRUE. spectrum_labels Logical. TRUE, plots labels maxima spectral plot. Defaults TRUE. scale_spectrum Logical. TRUE, scales spectrum unit height. Defaults FALSE. export_spectrum Logical. TRUE, exports spectrum console. Defaults FALSE. verbose Logical. TRUE, prints verbose output console. Defaults TRUE. look . Either peak extract spectral information certain peak, rt scan retention time, idx scan numeric index, click manually select retention time clicking chromatogram. Defaults \"peak\" mode. engine plotting engine use: base, ggplot2, plotly. chr Deprecated. Please use idx instead. ... Additional arguments.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_spectrum.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot spectrum from peak table — plot_spectrum","text":"export_spectrum TRUE, returns spectrum data.frame wavelengths rows single column encoding absorbance (normalized absorbance, scale_spectrum TRUE) wavelength. export_spectrum FALSE, output depends plotting engine. engine == \"plotly\", returns plotly object containing specified plots. Otherwise, engine == \"base\", return value.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_spectrum.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot spectrum from peak table — plot_spectrum","text":"Can used confirm identity peak check particular column peak table represents single compound. Retention times can also selected clicking plotted trace == 'click'.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_spectrum.html","id":"side-effects","dir":"Reference","previous_headings":"","what":"Side effects","title":"Plot spectrum from peak table — plot_spectrum","text":"plot_trace TRUE, plots chromatographic trace specified chromatogram (idx), specified wavelength (lambda) dotted red line indicate retention time given loc. trace single column chromatographic matrix. plot_spectrum TRUE, plots spectrum specified chromatogram specified retention time. spectrum single row chromatographic matrix.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_spectrum.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot spectrum from peak table — plot_spectrum","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_spectrum.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot spectrum from peak table — plot_spectrum","text":"","code":"if (FALSE) { # interactive() data(Sa) pks <- get_peaks(Sa, lambda = \"220.00000\") pk_tab <- get_peaktable(pks) oldpar <- par(no.readonly = TRUE) par(mfrow = c(2, 1)) plot_spectrum(loc = \"V10\", peak_table = pk_tab, what = \"peak\") par(oldpar) }"},{"path":"https://ethanbass.github.io/chromatographR/reference/preprocess.html","id":null,"dir":"Reference","previous_headings":"","what":"Preprocess time/wavelength data — preprocess","title":"Preprocess time/wavelength data — preprocess","text":"Standard pre-processing response matrices, consisting time axis spectral axis (e.g. HPLC-DAD/UV data). smooth data, like UV-VIS data, size matrix can reduced interpolation. default, data baseline-corrected time direction (baseline.corr) smoothed spectral dimension using cubic smoothing splines (smooth.spline.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/preprocess.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Preprocess time/wavelength data — preprocess","text":"","code":"preprocess( X, dim1, dim2, remove.time.baseline = TRUE, spec.smooth = TRUE, maxI = NULL, parallel = NULL, interpolate_rows = TRUE, interpolate_cols = TRUE, mc.cores, cl = 2, show_progress = NULL, ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/preprocess.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Preprocess time/wavelength data — preprocess","text":"X numerical data matrix, list data matrices. Missing values allowed. rownames colnames attributes used, numerical signify time points wavelengths, respectively. dim1 new, usually shorter, set time points (numerical). range exceed range original time points. dim2 new, usually shorter, set wavelengths (numerical). range exceed range original wavelengths. remove.time.baseline Logical, indicating whether baseline correction done time direction, according baseline.corr. Default TRUE. spec.smooth Logical, indicating whether smoothing done spectral direction, according smooth.spline. Default TRUE. maxI given, maximum intensity matrix set value. parallel Logical, indicating whether use parallel processing. Defaults TRUE (unless Windows). interpolate_rows Logical. Whether interpolate along time axis (dim1). Defaults TRUE. interpolate_cols Logical. Whether interpolate along spectral axis (dim2). Defaults TRUE. mc.cores many cores use parallel processing. Defaults 2. argument deprecated replaces cl. cl Argument pblapply mclapply. Either integer specifying number clusters use parallel processing cluster object created makeCluster. Defaults 2. Windows integer values ignored. show_progress Logical. Whether show progress bar. Defaults TRUE pbapply installed. ... optional arguments baseline.corr.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/preprocess.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Preprocess time/wavelength data — preprocess","text":"function returns preprocessed data matrix (list matrices), row names column names indicating time points wavelengths, respectively.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/preprocess.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Preprocess time/wavelength data — preprocess","text":"Adapted preprocess function alsace package Ron Wehrens.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/preprocess.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Preprocess time/wavelength data — preprocess","text":"Wehrens, R., Bloemberg, T.G., Eilers P.H.C. 2015. Fast parametric time warping peak lists. Bioinformatics 31:3063-3065. doi:10.1093/bioinformatics/btv299 . Wehrens, R., Carvalho, E., Fraser, P.D. 2015. Metabolite profiling LC–DAD using multivariate curve resolution: alsace package R. Metabolomics 11:1:143-154. doi:10.1007/s11306-014-0683-5 .","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/preprocess.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Preprocess time/wavelength data — preprocess","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/preprocess.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Preprocess time/wavelength data — preprocess","text":"","code":"if (FALSE) { # interactive() data(Sa) new.ts <- seq(10,18.66,by=.01) # choose time-points new.lambdas <- seq(200, 318, by = 2) # choose wavelengths Sa_pr <- preprocess(Sa[[1]], dim1 = new.ts, dim2 = new.lambdas) }"},{"path":"https://ethanbass.github.io/chromatographR/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Read chromatograms. — reexports","title":"Read chromatograms. — reexports","text":"objects imported packages. Follow links see documentation. chromConverter read_chroms","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_chroms.html","id":null,"dir":"Reference","previous_headings":"","what":"Reshape chromatograms Reshapes a list of chromatograms from wide to long format. — reshape_chroms","title":"Reshape chromatograms Reshapes a list of chromatograms from wide to long format. — reshape_chroms","text":"Reshape chromatograms Reshapes list chromatograms wide long format.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_chroms.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reshape chromatograms Reshapes a list of chromatograms from wide to long format. — reshape_chroms","text":"","code":"reshape_chroms(x, idx, sample_var = \"sample\", lambdas = NULL, rts = NULL)"},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_chroms.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reshape chromatograms Reshapes a list of chromatograms from wide to long format. — reshape_chroms","text":"x list chromatographic matrices wide format. idx Indices chromatograms convert sample_var String name new column containing sample IDs. lambdas Vector specifying wavelength(s) include. rts Vector specifying retention times include.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_chroms.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reshape chromatograms Reshapes a list of chromatograms from wide to long format. — reshape_chroms","text":"list chromatographic matrices long format.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_chroms.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Reshape chromatograms Reshapes a list of chromatograms from wide to long format. — reshape_chroms","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_peaktable.html","id":null,"dir":"Reference","previous_headings":"","what":"Reshapes peak table from wide to long format — reshape_peaktable","title":"Reshapes peak table from wide to long format — reshape_peaktable","text":"Reshapes peak table wide long format","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_peaktable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reshapes peak table from wide to long format — reshape_peaktable","text":"","code":"reshape_peaktable(x, peaks, metadata, fixed_levels = TRUE)"},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_peaktable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reshapes peak table from wide to long format — reshape_peaktable","text":"x peak_table object. peaks character vector specifying peaks include. character vector named, names vector elements used place original peak names. metadata character vector specifying metadata fields include. fixed_levels Logical. Whether fix factor levels features order provided. Defaults TRUE.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_peaktable.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reshapes peak table from wide to long format — reshape_peaktable","text":"data.frame containing information specified peaks long format.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_peaktable.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Reshapes peak table from wide to long format — reshape_peaktable","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/scan_chrom.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot spectra by clicking on the chromatogram — scan_chrom","title":"Plot spectra by clicking on the chromatogram — scan_chrom","text":"Plot spectra clicking chromatogram","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/scan_chrom.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot spectra by clicking on the chromatogram — scan_chrom","text":"","code":"scan_chrom( chrom_list, idx, lambda, plot_spectrum = TRUE, peak_table = NULL, scale_spectrum = FALSE, spectrum_labels = TRUE, export_spectrum = FALSE, chr = NULL, ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/scan_chrom.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot spectra by clicking on the chromatogram — scan_chrom","text":"chrom_list list chromatograms matrix format (timepoints x wavelengths). argument provided , function try find chrom_list object used create provided peak_table. idx Numerical index chromatogram wish plot. lambda wavelength plot trace . plot_spectrum Logical. Whether plot spectrum . peak_table peak table (output get_peaktable function). scale_spectrum Logical. TRUE, scales spectrum unit height. Defaults FALSE. spectrum_labels Logical. TRUE, plots labels maxima spectral plot. Defaults TRUE. export_spectrum Logical. TRUE, exports spectrum console. Defaults FALSE. chr Deprecated. Please use idx instead. ... Additional arguments.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/scan_chrom.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot spectra by clicking on the chromatogram — scan_chrom","text":"export_spectrum TRUE, returns spectrum data.frame wavelengths rows single column encoding absorbance (normalized absorbance, scale_spectrum TRUE) wavelength. Otherwise, return value.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/scan_chrom.html","id":"side-effects","dir":"Reference","previous_headings":"","what":"Side effects","title":"Plot spectra by clicking on the chromatogram — scan_chrom","text":"Plots chromatographic trace specified chromatogram (idx), specified wavelength (lambda) dotted red line indicate user-selected retention time. trace single column chromatographic matrix. plot_spectrum TRUE, plots spectrum specified chromatogram user-specified retention time. spectrum single row chromatographic matrix.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/scan_chrom.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot spectra by clicking on the chromatogram — scan_chrom","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/scan_chrom.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot spectra by clicking on the chromatogram — scan_chrom","text":"","code":"if (FALSE) { # interactive() data(Sa_pr) scan_chrom(Sa_pr, lambda = \"210\", idx = 2, export_spectrum = TRUE) }"},{"path":"https://ethanbass.github.io/chromatographR/reference/subset.peak_table.html","id":null,"dir":"Reference","previous_headings":"","what":"Subset peak table Return subset of peak_table object. — subset.peak_table","title":"Subset peak table Return subset of peak_table object. — subset.peak_table","text":"Subset peak table Return subset peak_table object.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/subset.peak_table.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Subset peak table Return subset of peak_table object. — subset.peak_table","text":"","code":"# S3 method for class 'peak_table' subset(x, subset, select, drop = FALSE)"},{"path":"https://ethanbass.github.io/chromatographR/reference/subset.peak_table.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Subset peak table Return subset of peak_table object. — subset.peak_table","text":"x peak_table object subset Logical expression indicating rows (samples) keep peak_table; missing values taken false. select Logical expression indicating columns (peaks) select peak_table. drop Logical. Passed indexing operator.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/subset.peak_table.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Subset peak table Return subset of peak_table object. — subset.peak_table","text":"peak_table object samples specified subset peaks specified select.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/subset.peak_table.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Subset peak table Return subset of peak_table object. — subset.peak_table","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/trim_peak.html","id":null,"dir":"Reference","previous_headings":"","what":"Trim peak — trim_peak","title":"Trim peak — trim_peak","text":"Trim peak","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/trim_peak.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Trim peak — trim_peak","text":"","code":"trim_peak(x, pos, cutoff = 0.05)"},{"path":"https://ethanbass.github.io/chromatographR/reference/trim_peak.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Trim peak — trim_peak","text":"x chromatogram matrix format pos vector containing peak information cutoff Proportion maximum absorbance use cutoff. Defaults .05.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/trim_peak.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Trim peak — trim_peak","text":"Returns indices within peak specified pos higher signal intensity specified cutoff.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/trim_peak.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Trim peak — trim_peak","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/write_peaktable.html","id":null,"dir":"Reference","previous_headings":"","what":"Export peak table — write_peaktable","title":"Export peak table — write_peaktable","text":"Export peak table csv xlsx format according value format.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/write_peaktable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export peak table — write_peaktable","text":"","code":"write_peaktable( peak_table, path, filename = \"peak_table\", format = c(\"csv\", \"xlsx\"), what = c(\"tab\", \"pk_meta\", \"sample_meta\", \"ref_spectra\", \"args\") )"},{"path":"https://ethanbass.github.io/chromatographR/reference/write_peaktable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export peak table — write_peaktable","text":"peak_table Peak table object get_peaktable. path Path write file. filename File name. Defaults \"peak_table\". format File format export. Either csv xlsx. elements peak_table export.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/write_peaktable.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export peak table — write_peaktable","text":"return value. function called side effects.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/write_peaktable.html","id":"side-effects","dir":"Reference","previous_headings":"","what":"Side effects","title":"Export peak table — write_peaktable","text":"Exports peak_table object .csv .xlsx file according value format.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/write_peaktable.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Export peak table — write_peaktable","text":"","code":"# \\donttest{ data(pk_tab) path_out = tempdir() write_peaktable(pk_tab, path = path_out, what = c(\"tab\")) # }"},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-072","dir":"Changelog","previous_headings":"","what":"chromatographR 0.7.2","title":"chromatographR 0.7.2","text":"Export get_times get_lambdas functions. Small revisions documentation. Use tryCatch allow missing spectra plot_all_spectra. Fixed rounding p-values cluster_spectra. Changed alpha cluster_peaks match common usage, alpha parameter now specifies significance level rather confidence level (1-alpha). Deprecated peak_no argument cluster_peaks favor new min_size max_size arguments.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-071","dir":"Changelog","previous_headings":"","what":"chromatographR 0.7.1","title":"chromatographR 0.7.1","text":"Fixed bug get_peaks causing peaks erroneously filtered cases. Made small updates documentation (preprocess fit_peaks functions) better describe arguments. Added warning mirror_plot var contains two levels levels aren’t specified. Fixed bug allow mirror_plot work properly 2D data. Return dimnames 1D ptw model objects returned correct_rt. Minor updates vignette.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-070","dir":"Changelog","previous_headings":"","what":"chromatographR 0.7.0","title":"chromatographR 0.7.0","text":"Updated correct_peaks function works properly correcting retention times peak lists. Added fixed_levels argument reshape_peaktable features can plotted order ’re provided user. Added option summing split peaks using merge_peaks function selecting method = \"sum\". Updated get_peaktable use.cor argument works correctly (use corrected retention times stored separate column). Fixed mirror_plot can take numeric input lambdas. Changed default setting verbose argument correct_rt FALSE default setting. Removed load_chroms function. Use read_chroms instead. Eliminated spurious warning attach_ref_spectra function. Changed name index argument plot.peak_list idx. original argument now deprecated. Fixed bug affecting plot_purity argument plot.peak_list. Fixed bug reshape_chroms empty metadata column longer appears. plot_spectrum function now includes peak names plotting spectra. Fixed correct_rt longer requires user-provided lambdas 1D chromatograms. Added subset.peak_table function easily subsetting peak_tables (e.g. exclude specific peaks samples). Added argument plot_all_spectra (e.g. plot multiple spectra particular retention time).","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"refactoring-of-cluster_spectra-function-0-7-0","dir":"Changelog","previous_headings":"","what":"Refactoring of cluster_spectra function:","title":"chromatographR 0.7.0","text":"simplicity, cluster_spectra now requires reference spectra attached peak table. Accordingly, chrom_list argument longer needed. Saving RDS now turned default. pvclust package now suggested instead required.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"updates-to-vignette-and-documentation-0-7-0","dir":"Changelog","previous_headings":"","what":"Updates to vignette and documentation","title":"chromatographR 0.7.0","text":"Suggest numeric input lambdas instead character input reduce unnecessary confusion. Made minor changes text vignette (hopefully) improve clarity. Added short section attachment reference spectra.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-061","dir":"Changelog","previous_headings":"","what":"chromatographR 0.6.1","title":"chromatographR 0.6.1","text":"Fixed bug plot functions (e.g. plot_chroms plot_spectrum) causing error retention times inconsistent chromatograms. Eliminated spurious warning preprocess function. Updated read_chroms syntax vignette.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"new-features-0-6-0","dir":"Changelog","previous_headings":"","what":"New features","title":"chromatographR 0.6.0","text":"Enabled use parallel package parallel processing (addition current options using mcapply). (options require installation suggested package pbapply). Updated get_peaktable greater flexibility (e.g. usage ‘ChemStation’ peak lists input).","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"other-changes-0-6-0","dir":"Changelog","previous_headings":"","what":"Other changes","title":"chromatographR 0.6.0","text":"Made minor changes vignette improve clarity (e.g. using single wavelength integration, etc.)","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"bug-fixes-0-6-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"chromatographR 0.6.0","text":"Fixed error attach_metadata NA values merge column.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-056","dir":"Changelog","previous_headings":"","what":"chromatographR 0.5.6","title":"chromatographR 0.5.6","text":"Fixed bug preprocess function causing fatal error due misrecognition matrices. Fixed behavior plot_chroms correct_rt allow automatic detection lambda 1D chromatograms. Fixed bug combine_peaks (due misplaced parenthesis). Added new option filter maximum peak area height filter_peaktable (= \"max\"), suggested Katherine Holmes.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-055","dir":"Changelog","previous_headings":"","what":"chromatographR 0.5.5","title":"chromatographR 0.5.5","text":"Fixed bug get_peaktable causing failure print strip plot plot_it == TRUE.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-054","dir":"Changelog","previous_headings":"","what":"chromatographR 0.5.4","title":"chromatographR 0.5.4","text":"Added .zenodo.json file.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-053","dir":"Changelog","previous_headings":"","what":"chromatographR 0.5.3","title":"chromatographR 0.5.3","text":"Fixed bug plot_chroms causing mismatched legend labels base R plot. Added additional arguments plot_chroms function: xlim,ylim, legend_position. Added additional information arguments available get_peaks fine-tuning peak-finding algorithm (response #27).","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-052","dir":"Changelog","previous_headings":"","what":"chromatographR 0.5.2","title":"chromatographR 0.5.2","text":"Added metadata argument reshape_peaktable filtering metadata fields. Added option renaming peaks via reshape_peaktable providing named character vector.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-051","dir":"Changelog","previous_headings":"","what":"chromatographR 0.5.1","title":"chromatographR 0.5.1","text":"plot_chroms, show_legend now defaults FALSE prevent overloading plot.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"bug-fixes-0-5-1","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"chromatographR 0.5.1","text":"Fixed syntactical bug get_peaktable applied gaussian peak list. Fixed bug caused improper transfer time.units metadata filter_peaks function. Added default missing time.units plot.peak_list.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"new-features-0-5-0","dir":"Changelog","previous_headings":"","what":"New features","title":"chromatographR 0.5.0","text":"Added ggplot2 option plot_spectrum, plot.peak_table plot_all_spectra functions. Reworked write_chroms sensible handling paths added filename argument. Updated get_purity function improve speed. Added additional argument reshape_chroms function subsetting data retention times (rts). Added parallel processing pbapply package correct_rt, get_peaks, preprocess functions setting cl argument.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"other-changes-0-5-0","dir":"Changelog","previous_headings":"","what":"Other changes","title":"chromatographR 0.5.0","text":"Changed behavior preprocess inferring retention times chromatograms longer rounded largest integer. preprocess, spectral smoothing longer applied 2D chromatograms, removing error message preprocess used default settings. Moved position ... argument end plot.peak_table. Changed progress_bar argument show_progress correct_rt, preprocess get_peaks fix strange pmatch behavior additional arguments preprocess. Changed orientation “plotly” plots generated plot_spectrum match plotting engines. Deprecated mc.cores argument correct_rt now deprecated favor new cl argument. Deprecated parallel argument preprocess favor just using cl. Changed name first argument mirror_plot peak_table x. Otherwise function changed. Added additional tests, improving test coverage 80%. Updated get_chrom_list (internal) allow parsing subsetted lists.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-048","dir":"Changelog","previous_headings":"","what":"chromatographR 0.4.8","title":"chromatographR 0.4.8","text":"Fixed bug merge_peaks function works properly (combine 2 peaks peak table). Fixed bugs plot_chroms preventing plotting ggplot2 plotting wrong chromatograms base R. Added additional tests plot_chroms reshape functions.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-047","dir":"Changelog","previous_headings":"","what":"chromatographR 0.4.7","title":"chromatographR 0.4.7","text":"Added reshape_peaktable function conversion peak tables long format. Turned estimate_purity get_peaks function default. Added option filter wavelength reshape_chroms, speeding plot_chroms.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"new-features-0-4-6","dir":"Changelog","previous_headings":"","what":"New Features","title":"chromatographR 0.4.6","text":"Added plot_chroms function easily plotting multiple traces list chromatograms. Minor changes internal syntax correct_rt give informative error messages. Added estimate_purity argument get_peaks toggle peak purity estimation. Changed default setting progress_bar correct_rt get_peaks. Now defaults TRUE pbapply installed. Added additional tests utility functions new plot_chroms function. Minor changes vignette. Minor changes documentation.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"bug-fixes-0-4-6","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"chromatographR 0.4.6","text":"Fixed bug causing mismatched time axes alignment issues VPdtw warping (), returns matrices consistent time axis. Fixed y unit label boxplot.peak_table function. Fixed behavior plot_spectrum spectrum exported properly engine == plotly. Fixed bug write_peaktable writing xlsx.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"new-features-0-4-5","dir":"Changelog","previous_headings":"","what":"New Features","title":"chromatographR 0.4.5","text":"Added reshape_chroms function converting chromatograms “long” format. Added write_peaktable function easily write peak_table csv xlsx. Added get_purity function assessing peak purity. Allow multiple peaks arguments plot.peaktable. Added functions plotting traces spectra plotly: plotly_trace plotly_spec. Fixed preprocess longer try interpolate along columns 2D data. Added stand-alone boxplot function peak_table objects. Added new class (ptw_list) plotting function lists ptw alignment objects. Added plot_it argument correct_rt plotting alignments. Added VPdtw dependency (instead suggested). Added progress_bar option get_peaks correct_rt. Improved error handling plot.peaklist. Updated find_peaks function better smoothing options improve peak-finding. Now defaults gaussian smoothing. Changed fit_peaks function syntax (see ). Minor updates vignette.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"changes-to-fit_peaks-function-0-4-5","dir":"Changelog","previous_headings":"New Features","what":"Changes to fit_peaks function:","title":"chromatographR 0.4.5","text":"Simplified logic fit_peaks function. Modified fit_peaks syntax now takes matrix (x) wavelength (lambda) instead numeric vector (y). Incorporated assessment peak purity peak fitting. Added wavelength (lambda) peak_list peak_table metadata. Fixed bug allow fitting single peak fit_peaks.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"bug-fixes-0-4-5","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"chromatographR 0.4.5","text":"Fixed bug causing mismatched time axes (improper alignment chromatograms) variable penalty dynamic time warping (VPdtw). Fixed bug attach_metadata result disordered rows. Fixed occasional test failure MKL server skipping cluster_spectra test CRAN. Adjusted cluster_spectra combine_peaks functions messages can suppressed verbose == FALSE.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-044","dir":"Changelog","previous_headings":"","what":"chromatographR 0.4.4","title":"chromatographR 0.4.4","text":"CRAN release: 2022-08-24 Fixed issue tests run certain machines (MKL).","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-043","dir":"Changelog","previous_headings":"","what":"chromatographR 0.4.3","title":"chromatographR 0.4.3","text":"CRAN release: 2022-08-22 Minor changes documentation. Added additional check chrom_list dimensions names.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"new-features-0-4-2","dir":"Changelog","previous_headings":"","what":"New features","title":"chromatographR 0.4.2","text":"Added option select time.units peak area get_peaks function facilitating better comparison vendor software. Now allow preservation instrumental metadata pre-processing alignment steps. Added filter_peaktable function.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"minor-changes-0-4-2","dir":"Changelog","previous_headings":"","what":"Minor changes:","title":"chromatographR 0.4.2","text":"Deprecated load_chroms function. Please use read_chroms chromConverter import files instead. Changed default behavior correct_rt corrected_values rather models. Added informative warnings error messages various functions. Now recommend installation VPdtw CRAN instead https://ethanbass.github.io/drat/ Fixed typos vignette","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"bug-fixes-0-4-2","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"chromatographR 0.4.2","text":"Fixed bug cluster_spectra affecting peaks 0 standard deviation. Fixed bug affecting peak_list metadata.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-041","dir":"Changelog","previous_headings":"","what":"chromatographR 0.4.1","title":"chromatographR 0.4.1","text":"CRAN release: 2022-05-19 Extended package DESCRIPTION added citations relevant references. Added \\value \\section{Side effects} fields docs various plot functions. Fixed bug mirror_plot legend can fully hidden setting plot_legend FALSE. Fixed bug scan_chrom additional arguments passed plot_spectrum. Added color argument customize color fitted peaks plot.peak_list. Fixed plot functions examples don’t change par settings. small updates documents (mostly formatting small clarifications). Fixed plot.peak_table can return spectra export_spectrum TRUE. Added error box_plot option plot.peak_table metadata attached. Added error box_plot option plot.peak_table peak provided loc. Added error plot_spectrum function user-supplied retention times beyond edges chromatogram. Added error plot_spectrum function unspecified lambda (==\"click). Released CRAN","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-040","dir":"Changelog","previous_headings":"","what":"chromatographR 0.4.0","title":"chromatographR 0.4.0","text":"Added support variable penalty dynamic time warping (VPdtw) correct_rt function. Fixed bug get_peaks function. Allow preprocessing without interpolation. Fixed bug preprocess can work Windows (without parallel processing). Allow use raw data peak integration get_peaks. Added verbose option correct_rt print reference chromatogram.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-030","dir":"Changelog","previous_headings":"","what":"chromatographR 0.3.0","title":"chromatographR 0.3.0","text":"Added NEWS.md file track changes package.","code":""}]
+[{"path":"https://ethanbass.github.io/chromatographR/articles/FAQ.html","id":"how-should-i-format-my-data-for-analysis-in-chromatographr","dir":"Articles","previous_headings":"","what":"1. How should I format my data for analysis in chromatographR?","title":"Frequently asked questions","text":"chromatographR functions expect chromatograms wide format retention times rownames. Thus, csv file retention times first column, able read files R follows: chromatograms “long” format, need reshape wide format proceeding analysis.","code":"lapply(vector_of_file_paths, function(f){ read.csv(f, row.names = 1) })"},{"path":"https://ethanbass.github.io/chromatographR/articles/FAQ.html","id":"some-of-my-peaks-arent-being-integrated-when-i-run-get_peaks-","dir":"Articles","previous_headings":"","what":"2. Some of my peaks aren’t being integrated when I run get_peaks.","title":"Frequently asked questions","text":"Try adjusting value sd.max argument, especially seeing wider peaks ones aren’t integrated. argument controls maximum peak width. tried set default value (sd.max = 50) sensible number, “sensible” can vary resolution data. example, example shown , wider peaks picked sd.max = 2.5 increase sd.max 10, able successfully integrate peaks. fails, try adjusting smooth_window.","code":"data(Sa_pr) par(mfrow=c(2,1)) pks <- get_peaks(Sa_warp, lambdas = \"210\", fit = \"egh\", sd.max = 2.5) plot(pks, main = \"'sd.max' = 3\") pks <- get_peaks(Sa_warp, lambdas = \"210\", fit = \"egh\", sd.max = 10) plot(pks, main = \"'sd.max' = 10\")"},{"path":"https://ethanbass.github.io/chromatographR/articles/GC-FID.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Analysis of Polistes cuticular hydrocarbons with GC-FID","text":"basic workflow similar analyzing different types chromatographic data chromatographR, important differences analyzing GC-FID data (1-dimensional data). vignette highlights important considerations using chromatographR analyze GC-FID data (2D chromatography data). demonstrate use chromatographR analysis GC-FID data, analyze dataset cuticular hydrocarbons (CHCs) composition four species paper wasps (Polistes spp.) collected Dr. Andrew Legan (Andrew W. Legan 2022; . Legan et al. 2022). dataset includes CHCs collected Polistes dominula (european paper wasp), Polistes exclamans (common paper wasp), P. fuscatus (northern paper wasp), P. metricus (metric paper wasp). social insects, cuticular hydrocarbons serve chemical cues mediating number social behaviors paper wasps (Andrew W. Legan et al. 2021), including nestmate recognition (G. J. Gamboa, Reeve, Pfennig 1986; George J. Gamboa et al. 1996; Bruschini et al. 2011), establishment social hierarchies (Jandt, Tibbetts, Toth 2014) mate choice (Reed Landolt 1990). P. dominula (Kranz 2020) P. exclamans (© Andrew Legan) P. fuscatus (Cook 2022) P. metricus (Drabik-Hamshare 2022) Figure 1: Polistes species includes study. order get good alignment, helpful remove solvent peak. accomplish , can use preprocess function remove first four minutes chromatogram. also reduce time-axis resolution .005 minutes since drastically reduces computation time seemingly little effect accuracy integration results. can group chromatograms species analysis. can extract peaks alkane ladder using get_peaks function plot integrated peak areas. eliminate small peaks part alkane ladder, use filter_peaks function remove features amplitude least 10^4 response units. case, also integration results ‘Shimadzu LabSolutions’, can check integration results provided chromatographR results LabSolutions. Reassuringly, peak areas heights estimated chromatographR similar results provided LabSolutions.","code":"# load chromatograms from Legan et al 2022 files <- rdryad::dryad_download(\"10.5061/dryad.wpzgmsbr8\")[[1]] chrom_paths <- grep(\"README|METADATA|ANNOTATED\", files, invert = TRUE, value = TRUE) dat <- read_chroms(chrom_paths, format_in = \"shimadzu_fid\") # load metadata path_to_metadata <- grep(\"METADATA\", files, value = TRUE) meta <- read.csv(path_to_metadata, sep = \"\\t\") dat.pr <- preprocess(dat, spec.smooth = FALSE, dim1 = seq(4, 59.9, .005), cl = 1) species <- c(dominula = \"DOMINULA\", exclamans.= \"EXCLAMANS\", fuscatus = \"FUSCATUS\", metricus = \"METRICUS\") species_idx <- lapply(species, function(sp){ which(names(dat.pr) %in% gsub(\".txt\", \"\", meta[which(meta$POLISTES_SPECIES == sp), \"SAMPLE_ID\"])) }) ladder <- grep(\"LADDER\", names(dat.pr)) pks <- get_peaks(dat.pr[ladder], time.units = \"s\") plot(pks, chrom_list = dat.pr[ladder]) pks_f <- filter_peaks(pks, min_height = 10000) path_to_annotated_alkanes <- grep(\"ANNOTATED\", files[[1]], value = TRUE) alkanes <- read.csv(path_to_annotated_alkanes, sep=\"\\t\") # check equality of retention times # all.equal(alkanes$RT[-1],pks_f$ALKANE_LADDER$Intensity$rt) par(mfrow=c(1,2)) plot(pks_f$ALKANE_LADDER$Intensity$area ~ alkanes$Area[-1], pch = 20, xlab = \"Area (LabSolutions)\", ylab = \"Area (chromatographR)\", main = \"Area\") m <- lm(pks_f$ALKANE_LADDER$Intensity$area ~ alkanes$Area[-1]) abline(m) legend(\"bottomright\", bty = \"n\", legend = bquote(R^2 == .(format(summary(m)$adj.r.squared, digits = 4)))) plot(pks_f$ALKANE_LADDER$Intensity$height ~ alkanes$Height[-1], pch = 20, xlab = \"Area (LabSolutions)\", ylab = \"Area (chromatographR)\", main = \"Height\") m <- lm(pks_f$ALKANE_LADDER$Intensity$height ~ alkanes$Height[-1]) abline(m) legend(\"bottomright\", bty = \"n\", legend = bquote(R^2 == .(format(summary(m)$adj.r.squared, digits = 4))))"},{"path":"https://ethanbass.github.io/chromatographR/articles/GC-FID.html","id":"alignment-of-chromatograms","dir":"Articles","previous_headings":"","what":"Alignment of chromatograms","title":"Analysis of Polistes cuticular hydrocarbons with GC-FID","text":"can align chromatograms species using variable dynamic time warping. sanity check, can compare single species alignments species multi-species alignment corresponding chromatograms. general, results quite similar multispecies single species alignments.","code":"warp_dominula <- suppressWarnings(correct_rt(dat.pr[species_idx$dominula], alg = \"vpdtw\", what = \"corrected.values\", plot_it = TRUE, verbose = TRUE, penalty = 1, maxshift = 100)) #> Selected chromatogram 9 as best reference. warp_metricus <- suppressWarnings(correct_rt(dat.pr[species_idx$metricus], alg = \"vpdtw\", what = \"corrected.values\", plot_it = FALSE, verbose = FALSE, penalty = 2, maxshift = 100)) warp_exclamans <- suppressWarnings(correct_rt(dat.pr[species_idx$exclamans], alg = \"vpdtw\", what = \"corrected.values\", plot_it = FALSE, verbose = FALSE, penalty = 2, maxshift = 200)) warp_fuscatus <- suppressWarnings(correct_rt(dat.pr[species_idx$fuscatus], alg = \"vpdtw\", what = \"corrected.values\", plot_it = FALSE, verbose = FALSE, penalty = 2, maxshift = 200)) warp_all <- suppressWarnings(correct_rt(dat.pr[-1], alg = \"vpdtw\", what = \"corrected.values\", plot_it = FALSE, verbose = FALSE, penalty = 2, maxshift = 200)) par(mfrow=c(3,1)) plot_chroms(warp_all[grep(\"PMET\",names(warp_all))],show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. metricus\"), \" (multi-species)\")), bty = \"n\") plot_chroms(warp_metricus, show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. metricus\"), \" (single-species)\")), bty = \"n\") plot_chroms(dat.pr[species_idx$metricus], show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. metricus\"), \" (raw)\")), bty = \"n\") par(mfrow=c(3,1)) plot_chroms(warp_all[grep(\"PFUS\",names(warp_all))],show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. fuscatus\"), \" (multi-species)\")), bty = \"n\") plot_chroms(warp_fuscatus, show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. fuscatus\"), \" (single-species)\")), bty = \"n\") plot_chroms(dat.pr[species_idx$fuscatus], show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. fuscatus\"), \" (raw)\")), bty = \"n\") par(mfrow=c(3,1)) plot_chroms(warp_all[grep(\"PDOM\", names(warp_all))],show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. dominula\"), \" (multi-species)\")), bty=\"n\") plot_chroms(warp_dominula, show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. dominula\"), \" (single-species)\")), bty=\"n\") plot_chroms(dat.pr[species_idx$dominula], show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. dominula\"), \" (raw)\")), bty=\"n\") par(mfrow = c(3,1)) plot_chroms(warp_all[grep(\"PEXC\", names(warp_all))],show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. exclamans\"), \" (multi-species)\")), bty = \"n\") plot_chroms(warp_exclamans, show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. exclamans\"), \" (single-species)\")), bty = \"n\") plot_chroms(dat.pr[species_idx$exclamans], show_legend = FALSE) legend(\"topright\", expression(paste(italic(\"P. exclamans\"), \" (raw)\")), bty = \"n\")"},{"path":"https://ethanbass.github.io/chromatographR/articles/GC-FID.html","id":"integration-and-peaktable-assembly","dir":"Articles","previous_headings":"","what":"Integration and peaktable assembly","title":"Analysis of Polistes cuticular hydrocarbons with GC-FID","text":"","code":"pks <- get_peaks(warp_all) pktab <- get_peaktable(pks) #> Warning in cbind(lambda = rep(as.numeric(names(peak_list[[1]])[comp]), ncl), : #> NAs introduced by coercion pktab <- attach_metadata(pktab, metadata = meta, column = \"SAMPLE_ID\")"},{"path":"https://ethanbass.github.io/chromatographR/articles/GC-FID.html","id":"analysis-of-peaktable","dir":"Articles","previous_headings":"","what":"Analysis of peaktable","title":"Analysis of Polistes cuticular hydrocarbons with GC-FID","text":"one expect, permanova shows species largest contributor variance CHC profiles (R2 = 0.52), followed state origin (R2 = 0.48) sex (R2 = 1). Principal componenets analysis shows decent separation species, P. dominula, P. fuscatus P. dominula separating along PC2 P. exclamans separating species along PC1. can get even better separation break data sex, though considerable intraspecific variation.","code":"m <- vegan::adonis2(pktab$tab ~ POLISTES_SPECIES + STATE + SEX + LAT + LON, data = pktab$sample_meta, method = \"manhattan\", na.action = na.omit) m #> Permutation test for adonis under reduced model #> Permutation: free #> Number of permutations: 999 #> #> vegan::adonis2(formula = pktab$tab ~ POLISTES_SPECIES + STATE + SEX + LAT + LON, data = pktab$sample_meta, method = \"manhattan\", na.action = na.omit) #> Df SumOfSqs R2 F Pr(>F) #> Model 13 5.8841e+11 0.51582 8.6048 0.001 *** #> Residual 105 5.5231e+11 0.48418 #> Total 118 1.1407e+12 1.00000 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 # ggordiplot function (modified from https://github.com/jfq3/ggordiplots/blob/master/R/gg_ordiplot.R) with added shape argument gg_ordiplot <- function (ord, groups, shape = NULL, scaling = 1, choices = c(1, 2), kind = c(\"sd\", \"se\", \"ehull\"), conf = NULL, show.groups = \"all\", ellipse = TRUE, label = FALSE, hull = FALSE, spiders = FALSE, pt.size = 3, plot = TRUE) { x <- y <- cntr.x <- cntr.y <- Group <- NULL groups <- as.factor(groups) if (show.groups[1] == \"all\") { show.groups <- as.vector(levels(groups)) } df_ord <- vegan::scores(ord, display = \"sites\", scaling = scaling, choices = choices) axis.labels <- ggordiplots::ord_labels(ord)[choices] df_ord <- data.frame(x = df_ord[, 1], y = df_ord[, 2], Group = groups) if (!is.null(shape)){ df_ord <- data.frame(df_ord, shape = shape) } df_mean.ord <- aggregate(df_ord[, 1:2], by = list(df_ord$Group), mean) colnames(df_mean.ord) <- c(\"Group\", \"x\", \"y\") df_mean.ord <- df_mean.ord[df_mean.ord$Group %in% show.groups, ] if (is.null(conf)) { rslt <- vegan::ordiellipse(ord, groups = groups, display = \"sites\", scaling = scaling, choices = choices, kind = kind, show.groups = show.groups, draw = \"none\", label = label) } else { rslt <- vegan::ordiellipse(ord, groups = groups, display = \"sites\", scaling = scaling, choices = choices, kind = kind, show.groups = show.groups, draw = \"none\", conf = conf, label = label) } df_ellipse <- data.frame() for (g in show.groups) { df_ellipse <- rbind(df_ellipse, cbind(as.data.frame(with(df_ord[df_ord$Group == g, ], vegan:::veganCovEllipse(rslt[[g]]$cov, rslt[[g]]$center, rslt[[g]]$scale))), Group = g)) } colnames(df_ellipse) <- c(\"x\", \"y\", \"Group\") df_ellipse <- df_ellipse[, c(3, 1, 2)] rslt.hull <- vegan::ordihull(ord, groups = groups, scaling = scaling, choices = choices, show.groups = show.groups, draw = \"none\") df_hull <- data.frame() df_temp <- data.frame() for (g in show.groups) { x <- rslt.hull[[g]][, 1] y <- rslt.hull[[g]][, 2] Group <- rep(g, length(x)) df_temp <- data.frame(Group = Group, x = x, y = y) df_hull <- rbind(df_hull, df_temp) } df_spiders <- df_ord df_spiders$cntr.x <- NA df_spiders$cntr.y <- NA for (g in show.groups) { df_spiders[which(df_spiders$Group == g), 4:5] <- df_mean.ord[which(df_mean.ord == g), 2:3] } df_spiders <- df_spiders[, c(3, 4, 5, 1, 2)] df_spiders <- df_spiders[order(df_spiders$Group), ] df_spiders <- df_spiders[df_spiders$Group %in% show.groups, ] xlab <- axis.labels[1] ylab <- axis.labels[2] plt <- ggplot2::ggplot() + geom_point(data = df_ord, aes(x = x, y = y, color = Group, shape = shape), size = pt.size) + xlab(xlab) + ylab(ylab) if (ellipse == TRUE) { plt <- plt + geom_path(data = df_ellipse, aes(x = x, y = y, color = Group), show.legend = FALSE) } if (label == TRUE) { plt <- plt + geom_text(data = df_mean.ord, aes(x = x, y = y, label = Group, color = Group), show.legend = FALSE) } if (hull == TRUE) { plt <- plt + geom_path(data = df_hull, aes(x = x, y = y, color = Group), show.legend = FALSE) } if (spiders == TRUE) { plt <- plt + geom_segment(data = df_spiders, aes(x = cntr.x, xend = x, y = cntr.y, yend = y, color = Group), show.legend = FALSE) } plt <- plt + coord_fixed(ratio = 1) if (plot) { print(plt) } invisible(list(df_ord = df_ord, df_mean.ord = df_mean.ord, df_ellipse = df_ellipse, df_hull = df_hull, df_spiders = df_spiders, plot = plt)) } ord <- vegan::rda(pktab$tab, scale = TRUE) pktab$sample_meta$SEX_SP <- interaction(pktab$sample_meta$SEX, pktab$sample_meta$POLISTES_SPECIES) gg_ordiplot(ord, groups = pktab$sample_meta[,\"POLISTES_SPECIES\"], shape = pktab$sample_meta[,\"SEX\"], plot = FALSE)$plot + scale_shape_manual(values = c(19, 21), name = \"Sex\") + labs(colour = \"Species\") cond <- which(pktab$sample_meta$SEX == \"M\") ord_m <- vegan::rda(pktab$tab[cond,], scale = TRUE) gg_ordiplot(ord_m, groups = pktab$sample_meta[cond,\"POLISTES_SPECIES\"], plot = FALSE)$plot + ggtitle(\"Males\") + theme_classic() + theme(legend.position=\"bottom\", plot.title = element_text(hjust = 0.5)) + labs(colour = \"Species\") cond <- which(pktab$sample_meta$SEX == \"F\") ord_f <- vegan::rda(pktab$tab[cond,],scale=TRUE) gg_ordiplot(ord_f, groups = pktab$sample_meta[cond,\"POLISTES_SPECIES\"], plot = FALSE)$plot + ggtitle(\"Females\") + theme_classic() + theme(legend.position=\"bottom\", plot.title = element_text(hjust = 0.5)) + labs(colour = \"Species\")"},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/articles/GC-FID.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session Information","title":"Analysis of Polistes cuticular hydrocarbons with GC-FID","text":"","code":"sessionInfo() #> R version 4.4.2 (2024-10-31) #> Platform: x86_64-pc-linux-gnu #> Running under: Ubuntu 22.04.5 LTS #> #> Matrix products: default #> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 #> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 #> #> locale: #> [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 #> [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8 #> [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C #> [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C #> #> time zone: UTC #> tzcode source: system (glibc) #> #> attached base packages: #> [1] stats graphics grDevices utils datasets methods base #> #> other attached packages: #> [1] ggplot2_3.5.1 vegan_2.6-8 lattice_0.22-6 #> [4] permute_0.9-7 rdryad_1.0.0 chromatographR_0.7.2 #> #> loaded via a namespace (and not attached): #> [1] gtable_0.3.6 xfun_0.49 caTools_1.18.3 #> [4] vctrs_0.6.5 tools_4.4.2 bitops_1.0-9 #> [7] generics_0.1.3 curl_6.0.1 parallel_4.4.2 #> [10] tibble_3.2.1 fansi_1.0.6 cluster_2.1.6 #> [13] pkgconfig_2.0.3 Matrix_1.7-1 readxl_1.4.3 #> [16] lifecycle_1.0.4 farver_2.1.2 compiler_4.4.2 #> [19] stringr_1.5.1 ptw_1.9-16 munsell_0.5.1 #> [22] RcppDE_0.1.7 minpack.lm_1.2-4 htmltools_0.5.8.1 #> [25] yaml_2.3.10 Formula_1.2-5 pillar_1.9.0 #> [28] tidyr_1.3.1 MASS_7.3-61 nlme_3.1-166 #> [31] mime_0.12 tidyselect_1.2.1 zip_2.3.1 #> [34] digest_0.6.37 stringi_1.8.4 dplyr_1.1.4 #> [37] purrr_1.0.2 labeling_0.4.3 VPdtw_2.2.1 #> [40] splines_4.4.2 fastmap_1.2.0 grid_4.4.2 #> [43] colorspace_2.1-1 cli_3.6.3 chromConverter_0.2.1 #> [46] magrittr_2.0.3 triebeard_0.4.1 crul_1.5.0 #> [49] dynamicTreeCut_1.63-1 utf8_1.2.4 withr_3.0.2 #> [52] ggordiplots_0.4.3 scales_1.3.0 rappdirs_0.3.3 #> [55] rmarkdown_2.29 reticulate_1.40.0 cellranger_1.1.0 #> [58] fastcluster_1.2.6 png_0.1-8 pbapply_1.7-2 #> [61] evaluate_1.0.1 knitr_1.49 hoardr_0.5.4 #> [64] mgcv_1.9-1 urltools_1.7.3 rlang_1.1.4 #> [67] Rcpp_1.0.13-1 glue_1.8.0 httpcode_0.3.0 #> [70] xml2_1.3.6 jsonlite_1.8.9 R6_2.5.1"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"chromatographR package reproducible analysis HPLC-DAD data R. Liquid chromatography coupled diode-array detection (HPLC-DAD) remains one popular analytical methodologies due convenience low-cost. However, currently open-source tools available analyzing HPLC-DAD chromatograms “simple” chromatographic data. use proprietary software analysis HPLC-DAD data currently significant barrier reproducible science, since tools widely accessible, usually require users select complicated options graphical user interface easily repeated. Reproducibility much higher command line workflows, like chromatographR, entire analysis can stored easily repeated anyone using publicly available software. chromatographR package began fork previously published alsace package (Wehrens, Carvalho, Fraser 2015), reworked improved functions peak-finding, integration peak table generation well number new tools data visualization downstream analysis. Unlike alsace, emphasized multivariate curve resolution alternating least squares (MCR-ALS), chromatographR developed around conventional workflow seem familiar users standard software tools HPLC-DAD analysis. chromatographR includes tools ) pre-processing, b) retention-time alignment, c) peak-finding, d) peak-integration e) peak-table construction, well additional functions useful analyzing resulting peak table.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"loading-data","dir":"Articles","previous_headings":"Workflow","what":"Loading data","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"chromatographR can import data growing list proprietary file formats using read_chroms function. Supported file formats include ‘Agilent ChemStation’ ‘MassHunter’ (.D) files, ‘Thermo Raw’ (.raw), ‘Chromeleon’ UV ASCII (.txt), ‘Waters ARW’ (.arw), ‘Shimadzu’ ASCII (.txt), . (full list, see chromConverter documentation). Select appropriate file format specifying format_in argument (e.g. csv, chemstation_uv, masshunter_dad, chromeleon_uv, waters_arw, etc).","code":"> # single folder > read_chroms(paths = path, format_in = \"chemstation_uv\") > > # multiple folders > path <- 'foo' # path to parent directory > folders <- list.files(path = path, full.names = TRUE) > dat <- read_chroms(folders, format_in = \"chemstation_uv\")"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"example-data","dir":"Articles","previous_headings":"Workflow","what":"Example data","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"package includes example data consisting root extracts tall goldenrod (Solidago altissima). Roots extracted 90% methanol run Agilent 1100 HPLC coupled DAD detector, according previously described method (Uesugi Kessler 2013). dataset called Sa (abbreviated Solidago altissima).","code":"> data(Sa)"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"pre-processing-data","dir":"Articles","previous_headings":"Workflow","what":"Pre-processing data","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"Data liquid chromatography often suffer variety non-informative artifacts, noise drifting baseline. addition, data produced instrument may higher resolution wider range (along either time spectral dimensions) require. Fortunately, issues can remedied fairly easily. example, smoothing can reduce noise spectral direction baseline subtraction can help correct drifting baseline. Interpolation wavelengths retention times can used reduce dimensionality data, facilitating comparison across samples reducing time computational load required downstream analyses. functions (smoothing, baseline correction, interpolation) available preprocess function enabled default. select narrower range times /wavelengths, arguments can provided optional dim1 dim2 arguments. baseline_cor function ptw package (Bloemberg et al. 2010) takes arguments p (asymmetry parameter) lambda (smoothing parameter). can read documentation ptw::asysm. may want experiment parameters choosing values use whole dataset. selecting parameters baseline correction, can proceed pre-processing step shown .","code":"> i <- 2 # chromatogram number in list of data > tpoints <- as.numeric(rownames(Sa[[i]])) > lambda <- '200.00000' > > matplot(x = tpoints, y = Sa[[i]][,lambda], + type = 'l', ylab = 'Abs (mAU)', xlab = 'Time (min)') > matplot(x = tpoints, y = ptw::baseline.corr(Sa[[i]][,lambda], p = .001, lambda = 1e5), + type = 'l', add = TRUE, col='blue', lty = 3) > # choose dimensions for interpolation > new.ts <- seq(10, 18.66, by = .01) # choose time-points > new.lambdas <- seq(200, 318, by = 2) # choose wavelengths > > dat.pr <- preprocess(Sa, dim1 = new.ts, dim2 = new.lambdas, p = .001, lambda = 1e5, cl = 1) Warning in preprocess(Sa, dim1 = new.ts, dim2 = new.lambdas, p = 0.001, : The `parallel` argument is deprecated. Just use the `cl` argument to enable parallel processing."},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"alignment","dir":"Articles","previous_headings":"Workflow","what":"Alignment","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"many cases, liquid chromatography can suffer retention time shifts (e.g. due temperature fluctuations, column degradation, subtle changes mobile-phase composition), can make difficult compare peaks across samples. Luckily, number “time-warping” algorithms developed correcting kinds shifts. chromatographR, parametric time warping (ptw) (Eilers 2004; Bloemberg et al. 2010) variable penalty dynamic time warping (vpdtw) (Clifford et al. 2009; Clifford Stone 2012) available correcting retention time shifts correct_rt function. warping functions aim produce better alignment features “warping” time-axis supplied chromatogram match reference chromatogram. (reference chromatogram can either determined algorithmically selected manually setting reference argument). First, check alignment chromatograms using plot_chroms function. chromatograms appear shifted, shown poor overlap chromatograms across four samples. remedy problem, can try “warp” chromatograms using one two options described .","code":"> plot_chroms(dat.pr, lambdas = 210)"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"parametric-time-warping","dir":"Articles","previous_headings":"Workflow > Alignment","what":"Parametric time warping","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"ptw option can take single wavelength list wavelengths provided user using lambdas argument. chromatogram, ptw produces “global” warping function across wavelengths supplied user. code block creates warping models samples provided list data matrices. function used warp chromatogram according corresponding model, setting models parameter. Depending variety samples severity retention time shifts, may take experimentation warping parameters get satisfactory results. Sometimes less can actually – example, wavelengths fewer peaks may sometimes yield better warping models. (Also see documentation ptw guidance warp function optimization). can use following code snippet compare alignment warped (top panel) unwarped (bottom panel) chromatograms. Clearly, alignment considerably improved warping. can also use correct_rt function global alignment multiple wavelengths, providing list wavelengths lambdas argument, always improve results. alignment still isn’t perfect warping, probably good enough align peaks assemble peak table, primary goal.","code":"> warping.models <- correct_rt(dat.pr, what = \"models\", lambdas = c(210), scale = TRUE) > warp <- correct_rt(chrom_list = dat.pr, models = warping.models, what = \"corrected.values\") > par(mfrow=c(2,1)) > # plot warped data > plot_chroms(warp, lambdas = c(210)) > legend(\"topleft\", legend = \"ptw\", bty = \"n\") > > # plot unwarped data > plot_chroms(dat.pr, lambdas = c(210)) > legend(\"topleft\", legend = \"raw\", bty = \"n\")"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"variable-penalty-dynamic-time-warping","dir":"Articles","previous_headings":"Workflow > Alignment","what":"Variable penalty dynamic time warping","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"Variable penalty dynamic time warping another algorithm can effective correcting retention time shifts (Clifford et al. 2009; Clifford Stone 2012). Instead calculating explicit warping function, dynamic time warping (DTW) works repeatedly shifting, expanding contracting time axis small steps satisfactory alignment attained. process can result close matching peaks, can also lead severe peak distortion time axis repeatedly expanded /contracted (Tomasi, van den Berg, Andersson 2004). Variable penalty dynamic time warping derivative DTW constrains expansion contraction time-axis applying penalty types “risky” moves. can often achieve good alignment minimal peak distortion. VPdtw package suggested dependency since requires working C++ compiler. Unlike ptw, VPdtw can take single wavelength input (returns global warping whole chromatographic matrix). code snippet uses VPdtw warp example chromatograms using first chromatogram reference. penalty maxshift parameters can adjusted control degree warping. case alignments produced two algorithms similar, cases one algorithm may dramatically outperform .","code":"> warp <- correct_rt(chrom_list = dat.pr, alg = \"vpdtw\", lambdas = 210, + what = \"corrected.values\", reference = 1) > par(mfrow=c(2,1)) > plot_chroms(warp, lambdas = c(210)) > legend(\"topleft\", legend = \"vpdtw\", bty = \"n\") > > plot_chroms(dat.pr, lambdas = c(210)) > legend(\"topleft\", legend = \"raw\", bty = \"n\")"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"peak-detection-and-integration","dir":"Articles","previous_headings":"Workflow","what":"Peak detection and integration","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"get_peaks function produced nested list peaks looping supplied chromatograms specified wavelengths, finding peaks, fitting specified function using non-linear least squares. area curve peak estimated using trapezoidal approximation. fit argument can used specify peak-fitting model. current options exponential-gaussian hybrid (egh) (Lan Jorgenson 2001) (default setting) gaussian. Alternatively, peak areas can integrated without applying model (fit = raw). function returns nested list data.frames containing parameters peaks identified chromatogram.","code":"> # find and integrate peaks using gaussian peak fitting > pks_gauss <- get_peaks(warp, lambdas = c(210), sd.max = 40, fit = \"gaussian\") > > # find and integrate peaks using exponential-gaussian hybrid model > pks_egh <- get_peaks(warp, lambdas = c(210), sd.max = 40, fit = \"egh\") > > # find and integrate peaks without modeling peak shape > pks_raw <- get_peaks(warp, lambdas = c(210), sd.max = 100, fit = \"raw\")"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"filtering","dir":"Articles","previous_headings":"Workflow > Peak detection and integration","what":"Filtering","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"peak-finding algorithm may often detect lot peaks little noise. Thus, recommended filter extraneous peaks stage (especially processing lot samples) can greatly reduce computational load peak table construction. can accomplished directly using arguments sd_max (filter peak width) /amp_thresh (filter peak height). Alternatively, filter_peaks function can used filter peaks peak_list already created.","code":""},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"visualization","dir":"Articles","previous_headings":"Workflow > Peak detection and integration","what":"Visualization","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"plot.peak_list function allows visually assess peak integration accuracy. compare peaks fitted first chromatogram (idx = 1) using two algorithms. Usually egh function performs slightly better asymmetrical peaks. Even though peaks fully filled raw setting selected, results may necessarily accurate.","code":"> par(mfrow=c(3,1)) > plot(pks_gauss, idx = 1, lambda = 210) > legend(\"topright\", \"Gaussian\", bty = \"n\") > > plot(pks_egh, idx = 1, lambda = 210) > legend(\"topright\", \"Exponential-gaussian hybrid\", bty = \"n\") > > plot(pks_raw, idx = 1, lambda = 210) > legend(\"topright\", \"Raw\", bty = \"n\")"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"peak-table-assembly","dir":"Articles","previous_headings":"Workflow","what":"Peak table assembly","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"obtaining peak_list, get_peaks function performs complete-linkage hierarchical clustering link peaks across samples. returns peak_table object samples rows peaks columns. peak_table object also slots holding metadata peaks, samples, parameters used analysis. lot samples, step can quite computationally expensive. Thus, suggested filter peak_list provided get_peaktable order remove extraneous peaks (see Peak finding fitting section ). Peaks can also filtered peak_table assembly using filter_peaktable function. important parameter hmax controls stringency retention times matched across samples. low value hmax increase odds splitting single peaks across multiple columns, high value hmax increase odds erroneously combining multiple peaks column.","code":"> # assembly peak table from peak_list saved in `pks_egh` > pk_tab <- get_peaktable(pks_egh, response = \"area\", hmax = 0.2) > > # print first six columns of peak table > head(pk_tab$tab[,1:6]) V1 V2 V3 V4 V5 V6 119 5.496455 0.0000000 0.6572183 1.991365 15.199917 0.3114568 121 4.200859 1.0746359 0.6078366 0.000000 7.908693 0.0000000 122 8.261218 0.9544689 1.9510595 0.000000 25.772683 1.7912076 458 6.201729 2.2880101 1.9889770 5.308515 13.995000 0.2875473"},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"attaching-metadata","dir":"Articles","previous_headings":"Workflow > Further analysis and data-visualization","what":"Attaching metadata","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"begin analyzing peak table, usually want attach sample metadata peak_table object. can easily accomplished using attach_metadata function. function takes metadata argument supplied data.frame containing experimental metadata, one columns matches names samples. column specified supplying column name string column argument. attach ordered metadata sample_meta slot peak table. peak table can normalized (e.g. dividing sample weight) using normalize_data function.","code":"> # load example metadata > path <- system.file(\"extdata\", \"Sa_metadata.csv\", package = \"chromatographR\") > meta <- read.csv(path) > # attach metadata > pk_tab <- attach_metadata(peak_table = pk_tab, metadata = meta, column = \"vial\") > # normalize peak table by sample mass > pk_tab <- normalize_data(peak_table = pk_tab, column = \"mass\")"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"attaching-reference-spectra","dir":"Articles","previous_headings":"Workflow > Further analysis and data-visualization","what":"Attaching reference spectra","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"Optionally, can attach scaled reference spectra peak_table using attach_ref_spectra function. can helpful working UV spectra programmatically (e.g. sort peaks chromophores). Reference spectra defined either spectrum highest intensity peak (ref = \"max.int\") spectrum highest average correlation spectra associated peak (ref = \"max.cor\"). , show spectra can used construct correlation matrix find peaks matching particular chromophore.","code":"> pk_tab <- attach_ref_spectra(pk_tab, ref = \"max.int\") > cor_matrix <- cor(pk_tab$ref_spectra) > hx <- names(which(cor_matrix[,\"V20\"] > .99)) > matplot(x = as.numeric(rownames(pk_tab$ref_spectra)), + y = pk_tab$ref_spectra[, hx], type = 'l', + ylab = \"Abs (mAU)\", + xlab = \"Wavelength (nm)\")"},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"mirror-plot","dir":"Articles","previous_headings":"Workflow > Further analysis and data-visualization > Data visualization","what":"Mirror plot","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"mirror_plot function provides quick way visually compare results across treatment groups.","code":"> mirror_plot(pk_tab, lambdas = c(210), var = \"trt\", legend_size = 2)"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"plotting-spectra","dir":"Articles","previous_headings":"Workflow > Further analysis and data-visualization > Data visualization","what":"Plotting spectra","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"plot_spectrum function allows easily plot record spectra associated particular peak peak table. useful interpreting results /checking errors peak table. example, may want check spectra particular peak match across different samples, may want compare spectrum known standard. plot_spectrum function can used plot spectrum chromatographic trace using arguments plot_spectrum plot_trace. default plot trace spectrum chromatogram largest peak peak table. Alternatively, can choose chromatogram index wavelength using idx lambda arguments. plot_spectrum function can also used generate interactive plots using plotly. plot_all_spectra function can used visually compare spectra specified peak across samples.","code":"> par(mfrow = c(2,1)) > peak <- \"V7\" > plot_spectrum(peak, peak_table = pk_tab, chrom_list = warp, + verbose = FALSE) > plot_spectrum(peak, peak_table = pk_tab, chrom_list = warp, + verbose = FALSE, engine = \"plotly\") > peak <- \"V13\" > plot_all_spectra(peak, peak_table = pk_tab, export = FALSE)"},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"plot-peak-table-function","dir":"Articles","previous_headings":"Workflow > Further analysis and data-visualization > Data visualization","what":"Plot peak table function","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"plot.peak_table function provides simplified interface various options plotting data peak_table. example, can used quick interface plot_spectrum plot_all_spectra functions shown . can also used quickly compare results across treatments calling boxplot.","code":"> plot(pk_tab, loc = \"V13\", box_plot = TRUE, vars = \"trt\", verbose = FALSE)"},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/articles/chromatographR.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session Information","title":"chromatographR: An introduction to HPLC-DAD analysis","text":"","code":"> sessionInfo() R version 4.4.2 (2024-10-31) Platform: x86_64-pc-linux-gnu Running under: Ubuntu 22.04.5 LTS Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 locale: [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8 [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C time zone: UTC tzcode source: system (glibc) attached base packages: [1] parallel stats graphics grDevices utils datasets methods [8] base other attached packages: [1] chromatographR_0.7.2 knitr_1.49 loaded via a namespace (and not attached): [1] sass_0.4.9 utf8_1.2.4 generics_0.1.3 [4] tidyr_1.3.1 bitops_1.0-9 xml2_1.3.6 [7] fastcluster_1.2.6 stringi_1.8.4 lattice_0.22-6 [10] digest_0.6.37 magrittr_2.0.3 caTools_1.18.3 [13] chromConverter_0.2.1 evaluate_1.0.1 grid_4.4.2 [16] dynamicTreeCut_1.63-1 fastmap_1.2.0 cellranger_1.1.0 [19] jsonlite_1.8.9 Matrix_1.7-1 Formula_1.2-5 [22] purrr_1.0.2 fansi_1.0.6 scales_1.3.0 [25] pbapply_1.7-2 textshaping_0.4.0 jquerylib_0.1.4 [28] cli_3.6.3 rlang_1.1.4 munsell_0.5.1 [31] ptw_1.9-16 cachem_1.1.0 yaml_2.3.10 [34] tools_4.4.2 minpack.lm_1.2-4 dplyr_1.1.4 [37] colorspace_2.1-1 RcppDE_0.1.7 reticulate_1.40.0 [40] vctrs_0.6.5 R6_2.5.1 png_0.1-8 [43] lifecycle_1.0.4 stringr_1.5.1 fs_1.6.5 [46] htmlwidgets_1.6.4 ragg_1.3.3 pkgconfig_2.0.3 [49] desc_1.4.3 pkgdown_2.1.1.9000 bslib_0.8.0 [52] pillar_1.9.0 VPdtw_2.2.1 glue_1.8.0 [55] Rcpp_1.0.13-1 systemfonts_1.1.0 tidyselect_1.2.1 [58] xfun_0.49 tibble_3.2.1 farver_2.1.2 [61] htmltools_0.5.8.1 rmarkdown_2.29 compiler_4.4.2 [64] readxl_1.4.3"},{"path":"https://ethanbass.github.io/chromatographR/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Ethan Bass. Author, maintainer. Hans W Borchers. Contributor, copyright holder. Author savgol pinv functions bundled pracma","code":""},{"path":"https://ethanbass.github.io/chromatographR/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Bass, E. (2023). chromatographR: Chromatographic Data Analysis Toolset (version 0.7.2). http://doi.org/10.5281/zenodo.6944334","code":"@Manual{, title = {chromatographR: Chromatographic Data Analysis Toolset}, author = {Ethan Bass}, year = {2023}, note = {version 0.7.2}, url = {https://ethanbass.github.io/chromatographR/}, doi = {10.5281/zenodo.6944334}, }"},{"path":"https://ethanbass.github.io/chromatographR/contributing.html","id":"how-to-contribute","dir":"","previous_headings":"","what":"How to contribute","title":"NA","text":"Contributions package welcome. Please get touch (preferable opening GitHub issue) discuss suggestions file bug report. good reasons file issue: found actual bug. ’re getting cryptic error message don’t understand. file format ’d like read isn’t currently supported chromatographR. (, please make sure include link example file!) new feature ’d like see implemented.","code":""},{"path":"https://ethanbass.github.io/chromatographR/contributing.html","id":"reporting-bugs","dir":"","previous_headings":"How to contribute","what":"Reporting Bugs","title":"NA","text":"Please check existing issues filing bug report. ’re bug hasn’t yet reported, please include many details possible, including preferably code snippet can used reproduce issue error messages printed console. Please include version chromatographR running. Version information can obtained R session running packageVersion(\"chromatographR\").","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/index.html","id":"overview","dir":"","previous_headings":"","what":"Overview","title":"Chromatographic Data Analysis Toolset","text":"chromatographR package reproducible analysis HPLC-DAD chromatographic data R. can also used analyze “simple” chromatographic data like GC-FID, HPLC-UV, HPLC-FD.","code":""},{"path":"https://ethanbass.github.io/chromatographR/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Chromatographic Data Analysis Toolset","text":"chromatographR can now installed CRAN: However, ’s recommended install latest development version chromatographR GitHub using devtools package: R Universe:","code":"install.packages(\"chromatographR\") install.packages(\"remotes\") remotes::install_github(\"https://github.com/ethanbass/chromatographR/\") install.packages(\"chromatographR\", repos=\"https://ethanbass.r-universe.dev/\", type=\"source\")"},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/index.html","id":"importing-data","dir":"","previous_headings":"Usage","what":"Importing data","title":"Chromatographic Data Analysis Toolset","text":"chromatographR can import variety vendor formats, including ‘Agilent ChemStation’ ‘MassHunter’ files. accomplished using parsers chromConverter package. See chromConverter page detailed list supported formats. Alternatively, chromatographR can also used regular csv files.","code":""},{"path":"https://ethanbass.github.io/chromatographR/index.html","id":"analysis","dir":"","previous_headings":"Usage","what":"Analysis","title":"Chromatographic Data Analysis Toolset","text":"Please see vignette included package details application chromatographR analysis HPLC data. second vignette suggested workflow analysis GC-FID data forthcoming soon.","code":""},{"path":"https://ethanbass.github.io/chromatographR/index.html","id":"contributing","dir":"","previous_headings":"","what":"Contributing","title":"Chromatographic Data Analysis Toolset","text":"Contributions always welcome. Please get touch (preferable opening GitHub issue) discuss suggestions file bug report. good reasons file issue: ’ve found actual bug. ’re getting cryptic error message don’t understand. file format ’d like read isn’t currently supported chromatographR. (, please make sure include link example file!) new feature ’d like see implemented. Also see contributing.md page details. (Note: Please post questions file conversions chromConverter page).","code":""},{"path":"https://ethanbass.github.io/chromatographR/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation:","title":"Chromatographic Data Analysis Toolset","text":"use chromatographR published work, please cite follows: Bass, E. (2023). chromatographR: Chromatographic Data Analysis Toolset (version 0.7.2). http://doi.org/10.5281/zenodo.6944334","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/Sa.html","id":null,"dir":"Reference","previous_headings":"","what":"Raw goldenrod root chromatograms — Sa","title":"Raw goldenrod root chromatograms — Sa","text":"list four HPLC-DAD data matrices Solidago altissima roots extracted 90% methanol. Retention times stored rows wavelengths stored columns.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/Sa.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Raw goldenrod root chromatograms — Sa","text":"","code":"data(Sa)"},{"path":"https://ethanbass.github.io/chromatographR/reference/Sa.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Raw goldenrod root chromatograms — Sa","text":"list four matrices (1301 times x 60 wavelengths).","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/Sa_pr.html","id":null,"dir":"Reference","previous_headings":"","what":"Preprocessed goldenrod root chromatograms — Sa_pr","title":"Preprocessed goldenrod root chromatograms — Sa_pr","text":"list four pre-processed HPLC-DAD chromatograms derived raw data stored Sa. Retention times stored rows wavelengths stored columns. time axis compressed save space processing time data little choppy.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/Sa_pr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Preprocessed goldenrod root chromatograms — Sa_pr","text":"","code":"data(Sa_pr)"},{"path":"https://ethanbass.github.io/chromatographR/reference/Sa_pr.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Preprocessed goldenrod root chromatograms — Sa_pr","text":"list four pre-processed matrices (434 retention times x 60 wavelengths).","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/Sa_warp.html","id":null,"dir":"Reference","previous_headings":"","what":"Warped goldenrod root chromatograms. — Sa_warp","title":"Warped goldenrod root chromatograms. — Sa_warp","text":"list four pre-processed warped goldenrod root chromatograms derived raw data stored Sa.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/Sa_warp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Warped goldenrod root chromatograms. — Sa_warp","text":"","code":"data(Sa_warp)"},{"path":"https://ethanbass.github.io/chromatographR/reference/Sa_warp.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Warped goldenrod root chromatograms. — Sa_warp","text":"list four pre-processed warped matrices (434 times x 60 wavelengths).","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_metadata.html","id":null,"dir":"Reference","previous_headings":"","what":"Attach experimental metadata — attach_metadata","title":"Attach experimental metadata — attach_metadata","text":"Attaches sample metadata `peak_table` object. Metadata provided data.frame object. One columns supplied metadata must match exactly row names peak table.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_metadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Attach experimental metadata — attach_metadata","text":"","code":"attach_metadata(peak_table, metadata, column)"},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_metadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Attach experimental metadata — attach_metadata","text":"peak_table `peak_table` object. metadata `data.frame` containing sample metadata. column name column metadata object containing sample names. Sample names must match row names peak_table$tab.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_metadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Attach experimental metadata — attach_metadata","text":"peak_table object attached metadata $sample_meta slot.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_metadata.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Attach experimental metadata — attach_metadata","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_metadata.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Attach experimental metadata — attach_metadata","text":"","code":"data(pk_tab) path <- system.file(\"extdata\", \"Sa_metadata.csv\", package = \"chromatographR\") meta <- read.csv(path) pk_tab <- attach_metadata(peak_table = pk_tab, metadata = meta, column=\"vial\")"},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_ref_spectra.html","id":null,"dir":"Reference","previous_headings":"","what":"Attach reference spectra — attach_ref_spectra","title":"Attach reference spectra — attach_ref_spectra","text":"Gathers reference spectra attaches peak_table object. Reference spectra defined either spectrum highest intensity ( max.int) spectrum highest average correlation spectra peak_table (max.cor).","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_ref_spectra.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Attach reference spectra — attach_ref_spectra","text":"","code":"attach_ref_spectra(peak_table, chrom_list, ref = c(\"max.cor\", \"max.int\"))"},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_ref_spectra.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Attach reference spectra — attach_ref_spectra","text":"peak_table Peak table get_peaktable. chrom_list list chromatograms matrix format (timepoints x wavelengths). argument provided , function try find chrom_list object used create provided peak_table. ref criterion use select reference spectra. Current options maximum correlation (max.cor) maximum signal intensity (max.int).","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_ref_spectra.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Attach reference spectra — attach_ref_spectra","text":"peak_table object reference spectra attached $ref_spectra slot.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_ref_spectra.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Attach reference spectra — attach_ref_spectra","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/attach_ref_spectra.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Attach reference spectra — attach_ref_spectra","text":"","code":"data(pk_tab) pk_tab <- attach_ref_spectra(pk_tab, ref=\"max.int\") pk_tab <- attach_ref_spectra(pk_tab, ref = \"max.cor\")"},{"path":"https://ethanbass.github.io/chromatographR/reference/boxplot.peak_table.html","id":null,"dir":"Reference","previous_headings":"","what":"Make boxplot from peak table. — boxplot.peak_table","title":"Make boxplot from peak table. — boxplot.peak_table","text":"function can take multiple response variables left hand side formula (separated +). case, separate boxplot produced response variable.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/boxplot.peak_table.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make boxplot from peak table. — boxplot.peak_table","text":"","code":"# S3 method for class 'peak_table' boxplot(x, formula, ...)"},{"path":"https://ethanbass.github.io/chromatographR/reference/boxplot.peak_table.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make boxplot from peak table. — boxplot.peak_table","text":"x peak_table object formula formula object ... Additional arguments boxplot","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/boxplot.peak_table.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make boxplot from peak table. — boxplot.peak_table","text":"","code":"data(pk_tab) path <- system.file(\"extdata\", \"Sa_metadata.csv\", package = \"chromatographR\") meta <- read.csv(path) pk_tab <- attach_metadata(peak_table = pk_tab, metadata = meta, column=\"vial\") boxplot(pk_tab, formula=V11 ~ trt)"},{"path":"https://ethanbass.github.io/chromatographR/reference/chromatographR-package.html","id":null,"dir":"Reference","previous_headings":"","what":"chromatographR — chromatographR-package","title":"chromatographR — chromatographR-package","text":"Chromatographic Data Analysis Toolset","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/chromatographR-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"chromatographR — chromatographR-package","text":"Tools high-throughput analysis HPLC-DAD/UV chromatograms (similar data). Includes functions preprocessing, alignment, peak-finding fitting, peak-table construction, data-visualization, etc. Preprocessing peak-table construction follow rough formula laid alsace (Wehrens, R., Bloemberg, T.G., Eilers P.H.C., 2015. doi:10.1093/bioinformatics/btv299 ). Alignment chromatograms available using parametric time warping (ptw) (Wehrens, R., Bloemberg, T.G., Eilers P.H.C. 2015. doi:10.1093/bioinformatics/btv299 ) variable penalty dynamic time warping (VPdtw) (Clifford, D., & Stone, G. 2012. doi:10.18637/jss.v047.i08 ). Peak-finding relies algorithm suggested Tom O'Haver Pragmatic Introduction Signal Processing. Peaks fitted gaussian exponential-gaussian hybrid peak shape using non-linear least squares (Lan, K. & Jorgenson, J. W. 2001. doi:10.1016/S0021-9673(01)00594-5 ). details package usage suggested workflow can found vignette.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/chromatographR-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"chromatographR — chromatographR-package","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/cluster_spectra.html","id":null,"dir":"Reference","previous_headings":"","what":"Cluster spectra — cluster_spectra","title":"Cluster spectra — cluster_spectra","text":"Cluster peaks spectral similarity.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/cluster_spectra.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cluster spectra — cluster_spectra","text":"","code":"cluster_spectra( peak_table, peak_no = NULL, alpha = 0.05, min_size = 5, max_size = NULL, nboot = 1000, plot_dend = TRUE, plot_spectra = TRUE, verbose = getOption(\"verbose\"), save = FALSE, parallel = TRUE, max.only = FALSE, output = c(\"pvclust\", \"clusters\"), ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/cluster_spectra.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cluster spectra — cluster_spectra","text":"peak_table Peak table get_peaktable. peak_no Minimum maximum thresholds number peaks cluster may . argument deprecated favor min_size max_size. alpha Confidence threshold inclusion cluster. min_size Minimum number peaks cluster may . max_size Maximum number peaks cluster may . nboot Number bootstrap replicates pvclust. plot_dend Logical. TRUE, plots dendrogram bootstrap values. plot_spectra Logical. TRUE, plots overlapping spectra cluster. verbose Logical. TRUE, prints progress report console. save Logical. TRUE, saves pvclust object current directory. parallel Logical. TRUE, use parallel processing pvclust. max.Logical. TRUE, returns highest level nested dendrograms. output return. Either clusters return list clusters, pvclust return pvclust object, return items. ... Additional arguments pvclust.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/cluster_spectra.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cluster spectra — cluster_spectra","text":"Returns clusters /pvclust object according value output argument. output = clusters, returns list S4 cluster objects. output = pvclust, returns pvclust object. output = , returns nested list containing [[1]] pvclust object, [[2]] list S4 cluster objects. cluster objects consist following components: peaks: character vector containing names peaks contained given cluster. pval: numeric vector length 1 containing bootstrap p-value (au) given cluster.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/cluster_spectra.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cluster spectra — cluster_spectra","text":"Function cluster peaks spectral similarity. using function, reference spectra must attached peak_table using attach_ref_spectra function. reference spectra used construct distance matrix based spectral similarity (pearson correlation) peaks. Hierarchical clustering bootstrap resampling performed resulting correlation matrix classify peaks spectral similarity, implemented pvclust. Finally, bootstrap values can used select clusters exceed certain confidence threshold defined alpha. Clusters can filtered minimum maximum size cluster using min_size max_size arguments respectively. max_only TRUE, largest cluster nested tree clusters meeting specified confidence threshold returned.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/cluster_spectra.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Cluster spectra — cluster_spectra","text":"Users aware clustering algorithm often return nested clusters. Thus, individual peak appear one cluster. highly suggested use 100 bootstraps run clustering algorithm real data even though use nboot = 100 example reduce runtime. authors pvclust suggest nboot = 10000.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/cluster_spectra.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Cluster spectra — cluster_spectra","text":"R. Suzuki & H. Shimodaira. 2006. Pvclust: R package assessing uncertainty hierarchical clustering. Bioinformatics, 22(12):1540-1542. doi:10.1093/bioinformatics/btl117 .","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/cluster_spectra.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cluster spectra — cluster_spectra","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/cluster_spectra.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cluster spectra — cluster_spectra","text":"","code":"# \\donttest{ data(pk_tab) data(Sa_warp) pk_tab <- attach_ref_spectra(pk_tab, Sa_warp, ref = \"max.int\") cl <- cluster_spectra(pk_tab, nboot = 100, max.only = FALSE, save = FALSE, alpha = 0.03) # }"},{"path":"https://ethanbass.github.io/chromatographR/reference/combine_peaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Combine peaks — combine_peaks","title":"Combine peaks — combine_peaks","text":"Utility function combine duplicate peaks peak table, .e. peaks integrated one wavelength component. Specify tolerance (tol) retention time matching minimum spectral correlation (min.cor) match.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/combine_peaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Combine peaks — combine_peaks","text":"","code":"combine_peaks( peak_table, tol = 0.01, min.cor = 0.9, choose = \"max\", verbose = getOption(\"verbose\") )"},{"path":"https://ethanbass.github.io/chromatographR/reference/combine_peaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Combine peaks — combine_peaks","text":"peak_table Peak table get_peaktable. tol Tolerance matching retention times (maximum retention time difference). Defaults .01. min.cor Minimum spectral correlation confirm match. Defaults 0.9. choose max retain peak highest intensity. Otherwise, first column data.frame retained. verbose Logical. Whether print status console.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/combine_peaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Combine peaks — combine_peaks","text":"peak table similar input peak table, duplicate columns combined according specified criteria.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/combine_peaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Combine peaks — combine_peaks","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/combine_peaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Combine peaks — combine_peaks","text":"","code":"data(pk_tab) data(Sa_warp) pk_tab <- attach_ref_spectra(pk_tab) combine_peaks(pk_tab, tol = .02, min.cor = .9) #> V1 V2 V3 V4 V5 V6 V7 V8 #> 119 0.000000 5.111190 0.0000000 0.5864823 1.858693 15.079233 0.000000 0.4135257 #> 121 0.000000 4.033081 0.9163944 0.5221266 0.000000 7.705485 0.000000 0.0000000 #> 122 3.368245 8.228498 0.9735932 0.0000000 1.963956 25.888893 0.000000 1.8394472 #> 458 0.000000 5.655876 1.8309616 0.0000000 1.735467 14.650605 1.459654 0.3488550 #> V9 V10 V11 V12 V13 V14 V15 V16 #> 119 79.71546 2.637016 41.60604 1.724824 1.3743838 2.273449 36.58533 15.189655 #> 121 57.27332 1.042586 18.33105 0.000000 0.8614246 7.504094 20.56684 8.879872 #> 122 59.62042 1.417466 35.83855 0.000000 1.2422142 4.241067 31.60616 12.910084 #> 458 108.93550 4.157266 33.22952 3.405194 3.1656321 5.231752 42.99198 23.968663 #> V17 V18 V19 V20 V21 V22 V23 #> 119 33.71629 4.186043 3.890605 1.7999191 12.435065 15.09572 2.5155590 #> 121 22.59679 1.169449 1.750044 0.1143296 6.619292 12.54686 0.7921663 #> 122 28.40685 2.232165 3.037413 0.4855545 7.976247 14.88744 2.7807659 #> 458 25.33267 5.011990 5.348641 0.2741214 12.648599 15.42859 2.3459283 #> V24 V25 V26 V27 V28 V29 V30 #> 119 0.00000000 0.11261310 17.80024 2.0024282 0.0000000 0.7981487 0.8774407 #> 121 0.01374328 0.43874747 14.41614 0.6184847 0.5505384 0.4542899 0.5315334 #> 122 0.01900430 0.11078837 16.60867 0.9699587 1.2199894 1.2251103 0.8634827 #> 458 0.00512731 0.02601551 24.77821 1.0894581 1.0049019 1.5687582 1.7486409 #> V31 V32 V33 V34 V35 V36 V39 #> 119 1.819662 1.023753 1.541590 0.0000000 0.2105941 0.5041651 0.1046104 #> 121 1.085835 0.000000 1.811022 0.0000000 0.5440478 0.2934669 0.0000000 #> 122 1.288960 0.000000 4.117218 0.1280478 0.5797748 0.3649663 0.3733894 #> 458 1.459723 1.647317 3.730485 0.2736762 0.7127212 0.6514810 0.0000000 #> V40 V42 V43 V44 V46 V49 V50 #> 119 0.09932078 0.2558299 14.841595 0.00000000 0.8899389 16.64689 0.0000000 #> 121 0.18110972 0.0000000 6.941289 0.03897730 1.8268337 11.45662 0.1379431 #> 122 0.00000000 0.3773357 14.120471 0.03016515 1.7424893 14.23811 0.7083038 #> 458 0.07382435 0.7167379 11.020983 0.53962131 0.7439920 12.98416 0.6251158 #> V52 V54 V55 V57 V58 V60 V62 #> 119 1.1409371 5.373707 6.566692 0.000000000 0.059937260 0.1983225 0.3076778 #> 121 0.4724857 2.819725 5.966240 0.002892882 0.023415605 0.1066713 0.1992947 #> 122 1.1684493 3.438104 7.081215 0.004187678 0.041697073 0.2845064 0.0000000 #> 458 1.6551325 5.200684 7.292224 0.023957666 0.005351955 0.2704478 0.3774084 #> V63 V64 #> 119 0.6844486 0.5443093 #> 121 0.9549370 0.0000000 #> 122 0.9325107 0.0000000 #> 458 0.5895916 0.6156869"},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_peaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Correct peak positions according to a PTW warping model — correct_peaks","title":"Correct peak positions according to a PTW warping model — correct_peaks","text":"Corrects retention time differences using parametric time warping implemented ptw.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_peaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correct peak positions according to a PTW warping model — correct_peaks","text":"","code":"correct_peaks(peak_list, mod_list, chrom_list, match_names = TRUE)"},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_peaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Correct peak positions according to a PTW warping model — correct_peaks","text":"peak_list `peak_list` object created get_peaks, containing nested list peak tables first level sample, second level spectral wavelength. Every component described matrix every row one peak, columns contain information retention time, peak width (FWHM), peak width, height, area. mod_list list ptw models. chrom_list List chromatograms supplied create ptw models. match_names Logical. Whether actively match names peak_list list models (mod_list). Defaults TRUE.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_peaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Correct peak positions according to a PTW warping model — correct_peaks","text":"input list peak tables returned extra columns containing corrected retention time.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_peaks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correct peak positions according to a PTW warping model — correct_peaks","text":"appropriate warping model established, corrected retention times can predicted peak. stored separate column list peak tables.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_peaks.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Correct peak positions according to a PTW warping model — correct_peaks","text":"function adapted getPeakTable function alsace package Ron Wehrens.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_peaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Correct peak positions according to a PTW warping model — correct_peaks","text":"Ron Wehrens, Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_rt.html","id":null,"dir":"Reference","previous_headings":"","what":"Correct retention time — correct_rt","title":"Correct retention time — correct_rt","text":"Aligns chromatograms using one two algorithms, according value alg: either parametric time warping, implemented ptw, variable penalty dynamic time warping, implemented VPdtw. init.coef n.traces arguments apply ptw warping, penalty maxshift apply vpdtw warping.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_rt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correct retention time — correct_rt","text":"","code":"correct_rt( chrom_list, lambdas, models = NULL, reference = \"best\", alg = c(\"ptw\", \"vpdtw\"), what = c(\"corrected.values\", \"models\"), init.coef = c(0, 1, 0), n.traces = NULL, n.zeros = 0, scale = FALSE, trwdth = 200, plot_it = FALSE, penalty = 5, maxshift = 50, verbose = getOption(\"verbose\"), show_progress = NULL, cl = 2, ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_rt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Correct retention time — correct_rt","text":"chrom_list List chromatograms matrix format. lambdas Select wavelengths use name. models List models warp . models provided () must match algorithm selected alg. reference Index sample considered reference sample. alg algorithm use: parametric time warping (ptw) variable penalty dynamic time warping (vpdtw). return: either 'corrected.values' (useful visual inspection) warping 'models' (programmatic use). init.coef Starting values optimization. n.traces Number traces use. n.zeros Number zeros add. scale Logical. true, scale chromatograms warping. trwdth width triangle WCC criterion. plot_it Logical. Whether plot alignment. penalty divisor used calculate penalty VPdtw. warping penalty calculated dividing dilation number. Thus, higher number produce lower penalty permissive, lower number produce higher penalty allow less warping. Defaults 5. maxshift Integer. Maximum allowable shift VPdtw. Defaults 50. verbose Whether print verbose output. show_progress Logical. Whether show progress bar. Defaults TRUE pbapply installed. Currently works ptw alignments. cl Argument pblapply mclapply. Either integer specifying number clusters use parallel processing cluster object created makeCluster. Defaults 2. Windows integer values ignored. ... Optional arguments ptw function. argument changed warp.type: always equal \"global\".","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_rt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Correct retention time — correct_rt","text":"list warping models list warped absorbance profiles, depending value argument.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_rt.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Correct retention time — correct_rt","text":"Adapted correctRT function alsace package Ron Wehrens.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_rt.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correct retention time — correct_rt","text":"Clifford, D., Stone, G., Montoliu, ., Rezzi, S., Martin, F. P., Guy, P., Bruce, S., & Kochhar, S. 2009. Alignment using variable penalty dynamic time warping. Analytical chemistry, 81(3):1000-1007. doi:10.1021/ac802041e . Clifford, D., & Stone, G. 2012. Variable Penalty Dynamic Time Warping Code Aligning Mass Spectrometry Chromatograms R. Journal Statistical Software, 47(8):1-17. doi:10.18637/jss.v047.i08 . Eilers, P.H.C. 2004. Parametric Time Warping. Anal. Chem., 76:404-411. doi:10.1021/ac034800e . Wehrens, R., Bloemberg, T.G., Eilers P.H.C. 2015. Fast parametric time warping peak lists. Bioinformatics, 31:3063-3065. doi:10.1093/bioinformatics/btv299 . Wehrens, R., Carvalho, E., Fraser, P.D. 2015. Metabolite profiling LC–DAD using multivariate curve resolution: alsace package R. Metabolomics, 11:143-154. doi:10.1007/s11306-014-0683-5 .","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_rt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Correct retention time — correct_rt","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/correct_rt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Correct retention time — correct_rt","text":"","code":"if (FALSE) { # interactive() data(Sa_pr) warping.models <- correct_rt(Sa_pr, what = \"models\", lambdas=c(210)) warp <- correct_rt(chrom_list = Sa_pr, models = warping.models) }"},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter peak lists — filter_peaks","title":"Filter peak lists — filter_peaks","text":"Utility function remove peaks peak list (e.g., intensity low). Currently one can filter peak height, peak area, standard deviation, /retention time.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter peak lists — filter_peaks","text":"","code":"filter_peaks(peak_list, min_height, min_area, min_sd, max_sd, min_rt, max_rt)"},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter peak lists — filter_peaks","text":"peak_list peak_list object, consisting nested list peak tables, first level sample, second level spectral component. Every component described matrix every row one peak, columns contain information retention time, full width half maximum (FWHM), peak width, height, area. min_height Minimum peak height. min_area Minimum peak area. min_sd Minimal standard deviation. max_sd Maximum standard deviation. min_rt Minimum retention time. max_rt Maximum retention time.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filter peak lists — filter_peaks","text":"peak list similar input, rows removed satisfy specified criteria.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Filter peak lists — filter_peaks","text":"Ron Wehrens, Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaktable.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter peak table — filter_peaktable","title":"Filter peak table — filter_peaktable","text":"Utility function remove peaks peak table, e.g., intensity low. Currently one can filter mean median peak intensity, retention time.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaktable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter peak table — filter_peaktable","text":"","code":"filter_peaktable( peak_table, rts, min_rt, max_rt, min_value, lambda, what = c(\"median\", \"mean\", \"max\"), tol = 0 )"},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaktable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter peak table — filter_peaktable","text":"peak_table peak_table object get_peaktable. rts Vector retention times include peak table. min_rt Minimum retention time include peak table. max_rt Maximum retention time include peak table. min_value Minimal cutoff summarized peak intensity. lambda Component(s) include peak table (e.g. wavelengths using HPLC-DAD/UV). Whether summarize intensities using mean, median, max. tol Tolerance matching retention times rts.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaktable.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filter peak table — filter_peaktable","text":"peak table similar input, columns removed peak table satisfy specified criteria.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaktable.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Filter peak table — filter_peaktable","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/filter_peaktable.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Filter peak table — filter_peaktable","text":"","code":"data(pk_tab) pk_tab <- filter_peaktable(pk_tab, min_rt = 10, max_rt = 16)"},{"path":"https://ethanbass.github.io/chromatographR/reference/find_peaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Find peaks — find_peaks","title":"Find peaks — find_peaks","text":"Find peaks chromatographic profile.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/find_peaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find peaks — find_peaks","text":"","code":"find_peaks( y, smooth_type = c(\"gaussian\", \"box\", \"savgol\", \"mva\", \"tmva\", \"none\"), smooth_window = 0.001, slope_thresh = 0, amp_thresh = 0, bounds = TRUE )"},{"path":"https://ethanbass.github.io/chromatographR/reference/find_peaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find peaks — find_peaks","text":"y Signal (numerical vector). smooth_type Type smoothing. Either gaussian kernel (\"gaussian\"), box kernel (\"box\"), savitzky-golay smoothing (\"savgol\"), moving average (\"mva\"), triangular moving average (\"tmva\"), smoothing (\"none\"). smooth_window Smoothing window. Larger values parameter exclude sharp, narrow features. supplied value 0 1, window interpreted proportion points include. Otherwise, window absolute number points include window. (Defaults .001). slope_thresh Minimum threshold slope smoothed first derivative. parameter filters basis peak width, larger values exclude broad peaks peak list. (Defaults 0). amp_thresh Minimum threshold peak amplitude. parameter filters basis peak height, larger values exclude small peaks peak list. (Defaults 0). bounds Logical. TRUE, includes peak boundaries data.frame. (Defaults TRUE).","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/find_peaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find peaks — find_peaks","text":"bounds == TRUE, returns data.frame containing center, start, end identified peak. Otherwise, returns numeric vector peak centers. locations expressed indices.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/find_peaks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find peaks — find_peaks","text":"Find peaks looking zero-crossings smoothed first derivative signal (y) exceed specified slope threshold (slope_thresh). Additionally, peaks can filtered supplying minimal amplitude threshold (amp_thresh), filtering peaks specified height. Smoothing intended prevent algorithm getting caught local minima maxima represent true features. Several smoothing options available, including \"gaussian\", box kernel (\"box\"), savitzky-golay smoothing (\"savgol\"), moving average (\"mva\"), triangular moving average (\"tmva\"), smoothing (\"none\"). recommended pre-processing using preprocess function peak detection. Overly high chromatographic resolution can sometimes cause peaks split multiple segments. case, recommended increase smooth_window reduce resolution along time axis adjusting dim1 argument preprocessing.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/find_peaks.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Find peaks — find_peaks","text":"find_peaks function adapted MATLAB code included Prof. Tom O'Haver's Pragmatic Introduction Signal Processing.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/find_peaks.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Find peaks — find_peaks","text":"O'Haver, Tom. Pragmatic Introduction Signal Processing: Applications scientific measurement. https://terpconnect.umd.edu/~toh/spectrum/ (Accessed January, 2022).","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/find_peaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find peaks — find_peaks","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/find_peaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find peaks — find_peaks","text":"","code":"data(Sa_pr) find_peaks(Sa_pr[[1]][,\"220\"]) #> pos lower upper #> 1 28 14 46 #> 2 49 46 52 #> 3 60 53 61 #> 4 69 61 78 #> 5 81 78 85 #> 6 89 85 93 #> 7 104 93 114 #> 8 115 114 118 #> 9 120 118 123 #> 10 131 123 139 #> 11 141 139 147 #> 12 155 149 161 #> 13 167 161 171 #> 14 182 171 188 #> 15 193 188 200 #> 16 215 200 228 #> 17 233 228 238 #> 18 243 238 254 #> 19 261 254 264 #> 20 272 264 279 #> 21 283 279 293 #> 22 297 293 303 #> 23 305 303 309 #> 24 319 315 323 #> 25 336 323 347 #> 26 351 347 363 #> 27 378 363 383 #> 28 388 383 390 #> 29 395 390 401 #> 30 408 401 411 #> 31 417 411 421"},{"path":"https://ethanbass.github.io/chromatographR/reference/fit_peaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","title":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","text":"Fit peak parameters using exponential-gaussian hybrid gaussian function.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/fit_peaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","text":"","code":"fit_peaks( x, lambda, pos = NULL, sd.max = 50, fit = c(\"egh\", \"gaussian\", \"raw\"), max.iter = 1000, estimate_purity = TRUE, noise_threshold = 0.001, ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/fit_peaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","text":"x chromatogram matrix format. lambda Wavelength fit peaks . pos Locations peaks vector y. NULL, find_peaks run automatically find peak positions. sd.max Maximum width (standard deviation) peaks. Defaults 50. fit Function peak fitting. (Currently exponential-gaussian hybrid egh, gaussian raw settings supported). raw selected, trapezoidal integration performed raw data without fitting peak shape. Defaults egh.) max.iter Maximum number iterations use nonlinear least squares peak-fitting. (Defaults 1000). estimate_purity Logical. Whether estimate purity . Defaults TRUE. noise_threshold Noise threshold. Input get_purity. ... Additional arguments find_peaks.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/fit_peaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","text":"fit_peaks function returns matrix, whose columns contain following information peak: rt Location peak maximum. start Start peak (included table bounds = TRUE). end End peak (included table bounds = TRUE). sd standard deviation peak. tau \\(\\tau\\) parameter (included table fit = \"egh\"). FWHM full width half maximum. height Peak height. area Peak area. r.squared R-squared value linear fit model data. purity spectral purity peak assessed get_purity. , first five elements (rt, start, end, sd FWHM) expressed indices, terms real retention times. transformation \"real\" time done function get_peaks.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/fit_peaks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","text":"Peak parameters calculated fitting data gaussian exponential-gaussian hybrid curve using non-linear least squares estimation implemented nlsLM. Area fitted curve estimated using trapezoidal approximation.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/fit_peaks.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","text":"fit_peaks function adapted Dr. Robert Morrison's DuffyTools package well code published Ron Wehrens' alsace package.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/fit_peaks.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","text":"* Lan, K. & Jorgenson, J. W. 2001. hybrid exponential gaussian functions simple model asymmetric chromatographic peaks. Journal Chromatography 915:1-13. doi:10.1016/S0021-9673(01)00594-5 . * Naish, P. J. & Hartwell, S. 1988. Exponentially Modified Gaussian functions - good model chromatographic peaks isocratic HPLC? Chromatographia, /bold26: 285-296. doi:10.1007/BF02268168 .","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/fit_peaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/fit_peaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fit chromatographic peaks to an exponential-gaussian hybrid or gaussian profile — fit_peaks","text":"","code":"data(Sa_pr) fit_peaks(Sa_pr[[1]], lambda = 220) #> rt start end sd tau FWHM height #> 1 30.69332 14 46 6.2865644 1.20769992 14.773426 8.9910726 #> 2 50.94330 46 52 0.5711967 -11.41366848 1.342312 0.3652505 #> 3 61.44532 53 61 3.2042222 2.37308275 7.529922 12.7874585 #> 4 69.97526 61 78 2.7067311 -1.01879444 6.360818 118.1461826 #> 5 82.42709 78 85 1.3744994 -0.73109961 3.230074 1.5745430 #> 6 89.64284 85 93 1.5296385 0.61202488 3.594650 2.3360448 #> 7 104.49707 93 114 2.1826134 -0.19394678 5.129142 878.3558848 #> 8 81.84177 114 118 2.4690722 22.61770113 5.802320 9.6411867 #> 9 119.85327 118 123 5.2832737 -13.86056689 12.415693 8.5707183 #> 10 131.85675 123 139 1.8315236 0.11513594 4.304081 418.7796260 #> 11 141.10828 139 147 4.1299082 -4.37157201 9.705284 8.5085781 #> 12 156.09501 149 161 1.7963783 -0.01487998 4.221489 5.8543152 #> 13 167.73853 161 171 1.6517982 -0.14556475 3.881726 25.5505898 #> 14 183.22815 171 188 2.0807233 -0.22145455 4.889700 350.1547326 #> 15 193.98654 188 200 2.4682084 -1.29245512 5.800290 119.6729349 #> 16 216.44045 200 228 1.8375563 -0.13007408 4.318257 319.6260534 #> 17 234.50440 228 238 1.9619252 -0.17648212 4.610524 35.8686113 #> 18 243.58113 238 254 4.9483859 0.66568143 11.628707 15.8252538 #> 19 262.00099 254 264 1.8302984 -0.98597515 4.301201 17.3957395 #> 20 272.87432 264 279 3.0837104 0.05107119 7.246719 96.9289225 #> 21 284.45995 279 293 1.8712197 -0.34947351 4.397366 121.3286776 #> 22 298.28530 293 303 2.0217365 -0.90317976 4.751081 14.6884289 #> 24 320.15708 315 323 1.2587749 0.34042184 2.958121 0.6212100 #> 25 336.89949 323 347 2.2339189 -0.82019092 5.249709 157.2481960 #> 26 351.82167 347 363 4.3854006 2.73641711 10.305691 7.1109632 #> 27 379.01651 363 383 9.6193330 -13.36671566 22.605432 3.8470521 #> 28 389.96461 383 390 0.4505398 -11.19848606 1.058768 5.0689224 #> 29 396.32753 390 401 7.3086188 -2.14825864 17.175254 6.6276427 #> 30 410.94947 401 411 1.7808715 -123.44165218 4.185048 5.5950637 #> 31 419.42472 411 421 4.8293966 -14.83514636 11.349082 7.4589610 #> area r.squared purity #> 1 141.609052 0.9869708 0.63636364 #> 2 1.533815 0.7267476 1.00000000 #> 3 44.203814 0.9997068 1.00000000 #> 4 844.468381 0.9954198 0.17647059 #> 5 7.929626 0.9529150 1.00000000 #> 6 9.913595 0.9974965 1.00000000 #> 7 4895.362421 0.9991512 0.08333333 #> 8 37.726631 0.8292605 0.60000000 #> 9 36.686028 0.9637970 1.00000000 #> 10 2149.825149 0.9991802 0.15384615 #> 11 42.867284 0.9910774 1.00000000 #> 12 31.941462 0.9960339 1.00000000 #> 13 116.325582 0.9997472 0.90909091 #> 14 2159.863516 0.9987345 0.15384615 #> 15 749.502596 0.9870224 0.18181818 #> 16 1996.653868 0.9988400 0.50000000 #> 17 231.767485 0.9889112 0.72727273 #> 18 148.058988 0.8325459 0.52941176 #> 19 88.004196 0.9912112 0.63636364 #> 20 713.899661 0.9118992 0.46666667 #> 21 753.063438 0.9843055 0.26666667 #> 22 84.486071 0.9455491 0.72727273 #> 24 2.923839 0.9897500 1.00000000 #> 25 972.579141 0.9950354 0.33333333 #> 26 70.695956 0.7701393 1.00000000 #> 27 63.752468 0.9955775 1.00000000 #> 28 30.677295 0.9392470 1.00000000 #> 29 64.992481 0.8411157 1.00000000 #> 30 54.963920 0.8662737 1.00000000 #> 31 67.504644 0.8950062 1.00000000"},{"path":"https://ethanbass.github.io/chromatographR/reference/get_agilent_threshold.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate purity thresholds — get_agilent_threshold","title":"Calculate purity thresholds — get_agilent_threshold","text":"Calculate purity thresholds","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_agilent_threshold.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate purity thresholds — get_agilent_threshold","text":"","code":"get_agilent_threshold( x, pos, weight = 1, noise_variance = NULL, noise_threshold = 0.005, lambdas )"},{"path":"https://ethanbass.github.io/chromatographR/reference/get_agilent_threshold.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate purity thresholds — get_agilent_threshold","text":"x chromatogram matrix format pos vector containing peak information weight Scaling parameter affecting stringency threshold. Defaults 1. noise_variance Variance noise. noise_threshold Threshold define noise. Highest proportion maximum absorbance. Defaults .005. lambdas Wavelengths include","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_agilent_threshold.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate purity thresholds — get_agilent_threshold","text":"Returns vector purity thresholds retention time index within peak specified pos.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_agilent_threshold.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate purity thresholds — get_agilent_threshold","text":"Stahl, Mark. “Peak Purity Analysis HPLC CE Using Diode-Array Technology.” Agilent Technologies, April 1, 2003, 16. /hrefhttps://www.agilent.com/cs/library/applications/5988-8647EN.pdf","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_agilent_threshold.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate purity thresholds — get_agilent_threshold","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_lambdas.html","id":null,"dir":"Reference","previous_headings":"","what":"Get lambdas — get_lambdas","title":"Get lambdas — get_lambdas","text":"Get wavelengths list chromatograms peak_table object.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_lambdas.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get lambdas — get_lambdas","text":"","code":"get_lambdas(x)"},{"path":"https://ethanbass.github.io/chromatographR/reference/get_lambdas.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get lambdas — get_lambdas","text":"x List chromatograms peak_table object.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_lambdas.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get lambdas — get_lambdas","text":"Numeric vector wavelengths.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Get peak list. — get_peaks","title":"Get peak list. — get_peaks","text":"Finds fits peaks extracts peak parameters list chromatograms specified wavelengths.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get peak list. — get_peaks","text":"","code":"get_peaks( chrom_list, lambdas, fit = c(\"egh\", \"gaussian\", \"raw\"), sd.max = 50, max.iter = 100, time.units = c(\"min\", \"s\", \"ms\"), estimate_purity = FALSE, noise_threshold = 0.001, show_progress = NULL, cl = 2, collapse = FALSE, ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get peak list. — get_peaks","text":"chrom_list list profile matrices, dimensions (timepoints × wavelengths). lambdas Character vector wavelengths find peaks . fit type fit use. Current options exponential-gaussian hybrid (egh), gaussian raw. raw setting performs trapezoidal integration directly raw data without fitting peak shape. sd.max Maximum width (standard deviation) peaks. Defaults 50. max.iter Maximum number iterations non-linear least squares fit_peaks. time.units Units sd, FWHM, area, tau (applicable). Options minutes (\"min\"), seconds (\"s\"), milliseconds (\"ms\"). estimate_purity Logical. Whether estimate purity . Defaults FALSE. (TRUE, slow function significantly). noise_threshold Noise threshold. Argument get_purity. show_progress Logical. Whether show progress bar. Defaults TRUE pbapply installed. cl Argument pblapply mclapply. Either integer specifying number clusters use parallel processing cluster object created makeCluster. Defaults 2. Windows integer values ignored. collapse Logical. Whether collapse multiple peak lists per sample single list multiple wavelengths (lambdas) provided. ... Additional arguments find_peaks. Arguments provided find_peaks can used fine-tune peak-finding algorithm. importantly, smooth_window increased features split multiple bins. arguments can used include smooth_type, slope_thresh, amp_thresh.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get peak list. — get_peaks","text":"result S3 object class peak_list, containing nested list data.frames containing information peaks fitted chromatogram wavelengths specified lamdas argument. row data.frames peak columns contain information various peak parameters: rt: retention time peak maximum. start: retention time peak estimated begin. end: retention time peak estimated end. sd: standard deviation fitted peak shape. tau value parameter \\(\\tau\\). parameter determines peak asymmetry peaks fit exponential-gaussian hybrid function. (column appear fit = egh. FWHM: full-width half maximum. height: height peak. area: area peak determined trapezoidal approximation. r.squared coefficient determination (\\(R^2\\)) fitted model raw data. (Note: value calculated fitting linear model fitted peak values raw data. approach statistically questionable, since models fit using non-linear least squares. Nevertheless, can still useful rough metric \"goodness--fit\"). purity peak purity.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get peak list. — get_peaks","text":"Peaks located finding zero-crossings smoothed first derivative specified chromatographic traces (function find_peaks). given positions, exponential-gaussian hybrid (regular gaussian) function fit signal using fit_peaks according value fit. Finally, area calculated using trapezoidal approximation. Additional arguments can provided find_peaks fine-tune peak-finding algorithm. example, smooth_window can increased prevent peaks split multiple features. Overly aggressive smoothing may cause small peaks overlooked. standard deviation (sd), full-width half maximum (FWHM), tau tau, area returned units determined time.units. default, units minutes. compare directly 'ChemStation' integration results, time units seconds.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaks.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Get peak list. — get_peaks","text":"bones function adapted getAllPeaks function authored Ron Wehrens (though underlying algorithms peak identification peak-fitting ).","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaks.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Get peak list. — get_peaks","text":"Lan, K. & Jorgenson, J. W. 2001. hybrid exponential gaussian functions simple model asymmetric chromatographic peaks. Journal Chromatography 915:1-13. doi:10.1016/S0021-9673(01)00594-5 . Naish, P. J. & Hartwell, S. 1988. Exponentially Modified Gaussian functions - good model chromatographic peaks isocratic HPLC? Chromatographia, 26: 285-296. doi:10.1007/BF02268168 . O'Haver, Tom. Pragmatic Introduction Signal Processing: Applications scientific measurement. https://terpconnect.umd.edu/~toh/spectrum/ (Accessed January, 2022). Wehrens, R., Carvalho, E., Fraser, P.D. 2015. Metabolite profiling LC–DAD using multivariate curve resolution: alsace package R. Metabolomics 11:143-154. doi:10.1007/s11306-014-0683-5 .","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get peak list. — get_peaks","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get peak list. — get_peaks","text":"","code":"if (FALSE) { # interactive() data(Sa_pr) pks <- get_peaks(Sa_pr, lambdas = c('210'), sd.max=50, fit=\"egh\") }"},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaktable.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert peak list into an ordered peak table. — get_peaktable","title":"Convert peak list into an ordered peak table. — get_peaktable","text":"Returns peak_table object. first slot contains matrix intensities, rows correspond samples columns correspond aligned features. rest slots contain various meta-data peaks, samples, experimental settings.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaktable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert peak list into an ordered peak table. — get_peaktable","text":"","code":"get_peaktable( peak_list, chrom_list, response = c(\"area\", \"height\"), use.cor = NULL, 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\") )"},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaktable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert peak list into an ordered peak table. — get_peaktable","text":"peak_list peak_list object created get_peaks, containing nested list peak tables: first level sample, second level spectral wavelength. Every component described data.frame row peak columns containing information various peak parameters. chrom_list list chromatographic matrices. response Indicates whether peak area peak height used intensity measure. Defaults area setting. use.cor Logical. Indicates whether use corrected retention times (rt.cor column) raw retention times (rt column). Unless otherwise specified, rt.cor column used default exists provided peak_list. hmax Height complete linkage dendrogram cut. Can interpreted maximal intercluster retention time difference. plot_it Logical. TRUE, every component strip plot shown indicating clustering. ask Logical. Ask showing new plot? Defaults TRUE. clust Specify whether perform hierarchical clustering based spectral similarity retention time (sp.rt) retention time alone (rt). Defaults rt. sp.rt option experimental used caution. sigma.t Width gaussian retention time distance function. Controls weight given retention time sp.rt selected. sigma.r Width gaussian spectral similarity function. Controls weight given spectral correlation sp.rt selected. deepSplit Logical. Controls sensitivity cluster splitting. TRUE, function return smaller clusters. See documentation cutreeDynamic additional information. verbose Logical. Whether print warning combining peaks single time window. Defaults FALSE. Specify data.frame matrix output. Defaults data.frame.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaktable.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert peak list into an ordered peak table. — get_peaktable","text":"function returns S3 peak_table object, containing following elements: tab: peak table – data-frame intensities sample x peak configuration. pk_meta: data.frame containing peak meta-data (e.g., spectral component, peak number, average retention time). sample_meta: data.frame sample meta-data. Must added using attach_metadata. ref_spectra: data.frame reference spectra (wavelength x peak configuration). Must added using attach_ref_spectra. args: vector arguments given get_peaktable generate peak table.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaktable.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Convert peak list into an ordered peak table. — get_peaktable","text":"function performs complete linkage clustering retention times across samples, cuts height given user (can understood maximal inter-cluster retention time difference) simple case based retention times. Clustering can also incorporate information spectral similarity using distance function adapted Broeckling et al., 2014: $$e^{-\\frac{(1-c_{ij})^2}{2\\sigma_r^2}} \\cdot e^{-\\frac{(1-(t_i-t_j)^2)}{2\\sigma_t^2}}$$ two peaks sample assigned cluster, warning message printed console. warnings can usually ignored, one also consider reducing hmax variable. However, may lead splitting peaks across multiple clusters. Another option filter peaks intensity remove small features.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaktable.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Convert peak list into an ordered peak table. — get_peaktable","text":"function adapted getPeakTable function alsace package Ron Wehrens.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaktable.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Convert peak list into an ordered peak table. — get_peaktable","text":"Broeckling, C. D., Afsar F.., Neumann S., Ben-Hur ., Prenni J.E. 2014. RAMClust: Novel Feature Clustering Method Enables Spectral-Matching-Based Annotation Metabolomics Data. Anal. Chem. 86:6812-6817. doi:10.1021/ac501530d . Wehrens, R., Carvalho, E., Fraser, P.D. 2015. Metabolite profiling LC–DAD using multivariate curve resolution: alsace package R. Metabolomics 11:143-154. doi:10.1007/s11306-014-0683-5 .","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaktable.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Convert peak list into an ordered peak table. — get_peaktable","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_peaktable.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert peak list into an ordered peak table. — get_peaktable","text":"","code":"if (FALSE) { # interactive() data(Sa_pr) pks <- get_peaks(Sa_pr, lambdas = c('210')) get_peaktable(pks, response = \"area\") }"},{"path":"https://ethanbass.github.io/chromatographR/reference/get_purity.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate mean peak purity — get_purity","title":"Calculate mean peak purity — get_purity","text":"Estimates peak purity assessing dissimilarity spectra comprising peak, using method described Stahl 2003.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_purity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate mean peak purity — get_purity","text":"","code":"get_purity( x, pos, weight = 1, cutoff = 0.05, noise_variance = NULL, noise_threshold = 0.01, lambdas, try = TRUE )"},{"path":"https://ethanbass.github.io/chromatographR/reference/get_purity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate mean peak purity — get_purity","text":"x chromatogram matrix format pos vector containing center, lower upper bounds peak numeric indices. weight Weight provided get_agilent_threshold. cutoff Proportion maximum absorbance use cutoff. Argument trim_peak. Defaults .05. noise_variance Variance noise. Argument get_agilent_threshold. noise_threshold Threshold define noise. Highest proportion maximum absorbance. Defaults .01. lambdas Wavelengths include calculations. try Logical. Whether estimate purity . Defaults TRUE.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_purity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate mean peak purity — get_purity","text":"Returns mean purity peak specified pos, defined proportion timepoints purity values 1.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_purity.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate mean peak purity — get_purity","text":"Stahl, Mark. “Peak Purity Analysis HPLC CE Using Diode-Array Technology.” Agilent Technologies, April 1, 2003, 16. /hrefhttps://www.agilent.com/cs/library/applications/5988-8647EN.pdf","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_purity.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate mean peak purity — get_purity","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_times.html","id":null,"dir":"Reference","previous_headings":"","what":"Get retention times — get_times","title":"Get retention times — get_times","text":"Get retention times list chromatograms peak_table object.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_times.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get retention times — get_times","text":"","code":"get_times(x, idx = 1)"},{"path":"https://ethanbass.github.io/chromatographR/reference/get_times.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get retention times — get_times","text":"x List chromatograms peak_table object. idx Index chromatogram extract times","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/get_times.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get retention times — get_times","text":"Numeric vector retention times chromatogram specified idx.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/merge_peaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Merge split peaks — merge_peaks","title":"Merge split peaks — merge_peaks","text":"Utility function combine split peaks single column peak table.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/merge_peaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Merge split peaks — merge_peaks","text":"","code":"merge_peaks(peak_table, peaks, method = c(\"max\", \"sum\"))"},{"path":"https://ethanbass.github.io/chromatographR/reference/merge_peaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Merge split peaks — merge_peaks","text":"peak_table Peak table get_peaktable. peaks vector specifying names indices peaks merged. method Method merge peaks. Either max select largest peak sample sum sum peaks together.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/merge_peaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Merge split peaks — merge_peaks","text":"peak table similar input peak table, specified columns combined.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/merge_peaks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Merge split peaks — merge_peaks","text":"Merges specified peaks peak table, selecting largest value column method \"max\". method \"sum\", merges peak summing values.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/merge_peaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Merge split peaks — merge_peaks","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/merge_peaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Merge split peaks — merge_peaks","text":"","code":"data(pk_tab) pk_tab <- merge_peaks(peak_table = pk_tab, peaks=c(\"V10\",\"V11\"))"},{"path":"https://ethanbass.github.io/chromatographR/reference/mirror_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Make mirror plot from peak table. — mirror_plot","title":"Make mirror plot from peak table. — mirror_plot","text":"Plots chromatograms mirror plot.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/mirror_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make mirror plot from peak table. — mirror_plot","text":"","code":"mirror_plot( x, chrom_list, lambdas = NULL, var, subset = NULL, print_legend = TRUE, legend_txt = NULL, legend_pos = \"topright\", legend_size = 1, mirror = TRUE, xlim = NULL, ylim = NULL, ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/mirror_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make mirror plot from peak table. — mirror_plot","text":"x peak table (output get_peaktable function). chrom_list list chromatograms matrix format (timepoints x wavelengths). argument provided , function try find chrom_list object used create peak_table. lambdas wavelength wish plot traces . var Variable index chromatograms. subset Character vector specifying levels use (2 levels present var). print_legend Logical. Whether print legend. Defaults TRUE. legend_txt Character vector containing labels legend. legend_pos Legend position. legend_size Legend size (cex argument). Default 1. mirror Logical. Whether plot mirror stacked plots. Defaults TRUE. xlim Numerical vector specifying limits x axis. ylim Numerical vector specifying limits y axis. ... Additional arguments matplot function.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/mirror_plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make mirror plot from peak table. — mirror_plot","text":"return value, called side effects.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/mirror_plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Make mirror plot from peak table. — mirror_plot","text":"Can used confirm identity peak check particular column peak table represents single compound. Can also used create simple box-plots examine distribution peak respect variables defined sample metadata.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/mirror_plot.html","id":"side-effects","dir":"Reference","previous_headings":"","what":"Side effects","title":"Make mirror plot from peak table. — mirror_plot","text":"mirror_plot TRUE, plots mirror plot comparing two treatments defined var subset (two factors present var). Otherwise, mirror_plot FALSE, treatments plotted two separate panes.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/mirror_plot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Make mirror plot from peak table. — mirror_plot","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/mirror_plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make mirror plot from peak table. — mirror_plot","text":"","code":"data(Sa_warp) data(pk_tab) path <- system.file(\"extdata\", \"Sa_metadata.csv\", package = \"chromatographR\") meta <- read.csv(path) pk_tab <- attach_metadata(peak_table = pk_tab, metadata = meta, column=\"vial\") mirror_plot(pk_tab,lambdas = c(\"210\",\"260\"), var = \"trt\", mirror = TRUE, col = c(\"green\",\"blue\"))"},{"path":"https://ethanbass.github.io/chromatographR/reference/normalize_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Normalize peak table or chromatograms — normalize_data","title":"Normalize peak table or chromatograms — normalize_data","text":"Normalizes peak table list chromatograms specified column sample metadata. Metadata must first attached peak_table using attach_metadata.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/normalize_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Normalize peak table or chromatograms — normalize_data","text":"","code":"normalize_data( peak_table, column, chrom_list, what = c(\"peak_table\", \"chrom_list\"), by = c(\"meta\", \"peak\") )"},{"path":"https://ethanbass.github.io/chromatographR/reference/normalize_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Normalize peak table or chromatograms — normalize_data","text":"peak_table `peak_table` object column name column containing weights. chrom_list List chromatograms normalization. samples must order peak_table. argument provided , function try find chrom_list object used create provided peak_table. `peak_table` list chromatograms (`chrom_list`). Whether normalize column sample metadata (meta) column peak table (peak).","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/normalize_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Normalize peak table or chromatograms — normalize_data","text":"peak_table object peaks normalized mass sample.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/normalize_data.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Normalize peak table or chromatograms — normalize_data","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/normalize_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Normalize peak table or chromatograms — normalize_data","text":"","code":"data(pk_tab) path <- system.file(\"extdata\", \"Sa_metadata.csv\", package = \"chromatographR\") meta <- read.csv(path) pk_tab <- attach_metadata(peak_table = pk_tab, metadata = meta, column=\"vial\") norm <- normalize_data(pk_tab, \"mass\", what = \"peak_table\")"},{"path":"https://ethanbass.github.io/chromatographR/reference/pk_tab.html","id":null,"dir":"Reference","previous_headings":"","what":"Goldenrod peak table — pk_tab","title":"Goldenrod peak table — pk_tab","text":"Peak table generated exemplary goldenrod root extracts.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/pk_tab.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Goldenrod peak table — pk_tab","text":"","code":"data(pk_tab)"},{"path":"https://ethanbass.github.io/chromatographR/reference/pk_tab.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Goldenrod peak table — pk_tab","text":"peak_table object.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot fitted peak shapes. — plot.peak_list","title":"Plot fitted peak shapes. — plot.peak_list","text":"Visually assess integration accuracy plotting fitted peaks trace.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot fitted peak shapes. — plot.peak_list","text":"","code":"# S3 method for class 'peak_list' plot( x, ..., chrom_list, idx = 1, lambda = NULL, points = FALSE, ticks = FALSE, a = 0.5, color = NULL, cex.points = 0.5, numbers = FALSE, cex.font = 0.5, y.offset = 25, plot_purity = FALSE, res, index = NULL )"},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot fitted peak shapes. — plot.peak_list","text":"x peak_list object. Output get_peaks function. ... Additional arguments main plot function. chrom_list List chromatograms (retention time x wavelength matrices) idx Index name chromatogram plotted. lambda Wavelength plotting. points Logical. TRUE, plot peak maxima. Defaults FALSE. ticks Logical. TRUE, mark beginning end peak. Defaults FALSE. Alpha parameter controlling transparency fitted shapes. color color fitted shapes. cex.points Size points. Defaults 0.5 numbers Whether number peaks. Defaults FALSE. cex.font Font size peaks numbered. Defaults 0.5. y.offset Y offset peak numbers. Defaults 25. plot_purity Whether add visualization peak purity. res time resolution peak fitting index argument deprecated. Please use idx instead.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot fitted peak shapes. — plot.peak_list","text":"return value, called side effects.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_list.html","id":"side-effects","dir":"Reference","previous_headings":"","what":"Side effects","title":"Plot fitted peak shapes. — plot.peak_list","text":"Plots chromatographic trace specified chromatogram (chr) specified wavelength (lambda) fitted peak shapes provided peak_list drawn underneath curve.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_list.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot fitted peak shapes. — plot.peak_list","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_table.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot spectrum from peak table — plot.peak_table","title":"Plot spectrum from peak table — plot.peak_table","text":"Plots trace /spectrum given peak peak table.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_table.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot spectrum from peak table — plot.peak_table","text":"","code":"# S3 method for class 'peak_table' plot( x, loc, chrom_list, what = \"peak\", idx = \"max\", lambda = \"max\", plot_spectrum = TRUE, plot_trace = TRUE, box_plot = FALSE, vars = NULL, spectrum_labels = TRUE, scale_spectrum = FALSE, export_spectrum = FALSE, verbose = TRUE, engine = c(\"base\", \"plotly\", \"ggplot\"), chr = NULL, ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_table.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot spectrum from peak table — plot.peak_table","text":"x peak table (output get_peaktable function). loc vector specifying peak(s) retention time(s) wish plot. chrom_list list chromatograms matrix format (timepoints x wavelengths). argument provided , function try find chrom_list object used create peak_table. look . Either peak extract spectral information certain peak, rt scan retention time, click manually select retention time clicking chromatogram. Defaults peak. idx Numerical index chromatogram wish plot; \"max\" plot chromatogram largest signal; \"\" plot spectra chromatograms. lambda wavelength wish plot trace (plot_chrom TRUE /wavelength used determination signal abundance. plot_spectrum Logical. TRUE, plots spectrum chosen peak. Defaults TRUE. plot_trace Logical. TRUE, plots trace chosen peak lambda. Defaults TRUE. box_plot Logical. TRUE, plots box plot using categories defined vars. vars Independent variables boxplot. Righthand side formula. spectrum_labels Logical. TRUE, plots labels maxima spectral plot. Defaults TRUE. scale_spectrum Logical. TRUE, scales spectrum unit height. Defaults FALSE. export_spectrum Logical. TRUE, exports spectrum console. Defaults FALSE. verbose Logical. TRUE, prints verbose output console. Defaults TRUE. engine plotting engine use: either base plotly. chr Deprecated. Please use idx instead. ... Additional arguments boxplot.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_table.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot spectrum from peak table — plot.peak_table","text":"export_spectrum TRUE, returns spectrum data.frame wavelengths rows columns encoding absorbance (normalized absorbance, scale_spectrum TRUE) specified sample(s). Otherwise, return value.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_table.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot spectrum from peak table — plot.peak_table","text":"Can used confirm identity peak check particular column peak table represents single compound. Can also used create simple box-plots examine distribution peak respect variables defined sample metadata.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_table.html","id":"side-effects","dir":"Reference","previous_headings":"","what":"Side effects","title":"Plot spectrum from peak table — plot.peak_table","text":"plot_trace TRUE, plots chromatographic trace specified chromatogram (idx), specified wavelength (lambda) dotted red line indicate retention time given loc. trace single column chromatographic matrix. plot_spectrum TRUE, plots spectrum specified chromatogram specified retention time. spectrum single row chromatographic matrix. box_plot TRUE, produces boxplot specified peak groups provided vars.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.peak_table.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot spectrum from peak table — plot.peak_table","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.ptw_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot PTW alignments — plot.ptw_list","title":"Plot PTW alignments — plot.ptw_list","text":"Plot PTW alignments","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.ptw_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot PTW alignments — plot.ptw_list","text":"","code":"# S3 method for class 'ptw_list' plot(x, lambdas, legend = TRUE, ...)"},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.ptw_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot PTW alignments — plot.ptw_list","text":"x ptw_list object created correct_rt. lambdas lambdas plot. legend Logical. Whether label plots. ... Additional arguments matplot.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot.ptw_list.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot PTW alignments — plot.ptw_list","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_all_spectra.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot all spectra for chosen peak. — plot_all_spectra","title":"Plot all spectra for chosen peak. — plot_all_spectra","text":"Plot multiple given peak peak table. Wrapper plot_spectrum.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_all_spectra.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot all spectra for chosen peak. — plot_all_spectra","text":"","code":"plot_all_spectra( peak, peak_table, chrom_list, idx = \"all\", chrs = NULL, engine = c(\"base\", \"ggplot2\", \"plotly\"), plot_spectrum = TRUE, export_spectrum = TRUE, scale_spectrum = TRUE, overlapping = TRUE, verbose = FALSE, what = c(\"peak\", \"rt\", \"idx\"), ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_all_spectra.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot all spectra for chosen peak. — plot_all_spectra","text":"peak name peak plot (character format) peak_table peak table (output get_peaktable function) chrom_list list chromatograms matrix format (timepoints x components). argument provided , function try find chrom_list object used create provided peak_table. idx Vector chromatograms plot. chrs Deprecated. Please use idx instead. engine plotting engine use: base, ggplot2, plotly. plot_spectrum Logical. TRUE, plots spectrum chosen peak. export_spectrum Logical. TRUE, exports spectrum console. Defaults FALSE. scale_spectrum Logical. TRUE, scales spectrum unit height. overlapping Logical. TRUE, plot spectra single plot. verbose Logical. TRUE, prints verbose output console. look . Either peak extract spectral information certain peak, rt scan retention time, idx scan numeric index. Defaults \"peak\" mode. ... Additional arguments plot_spectrum.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_all_spectra.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot all spectra for chosen peak. — plot_all_spectra","text":"export_spectrum TRUE, returns spectra data.frame wavelengths rows one column sample chrom_list encoding absorbance (normalized absorbance, scale_spectrum TRUE) wavelength. Otherwise, return value.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_all_spectra.html","id":"side-effects","dir":"Reference","previous_headings":"","what":"Side effects","title":"Plot all spectra for chosen peak. — plot_all_spectra","text":"plot_spectrum TRUE, plots spectra specified chromatogram (idx) given peak. spectrum single row chromatographic matrix.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_all_spectra.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot all spectra for chosen peak. — plot_all_spectra","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_all_spectra.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot all spectra for chosen peak. — plot_all_spectra","text":"","code":"if (FALSE) { # interactive() data(Sa_warp) pks <- get_peaks(Sa_warp, lambda=\"220\") pk_tab <- get_peaktable(pks) plot_all_spectra(peak=\"V13\", peak_table = pk_tab, overlapping=TRUE) }"},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_chroms.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot traces from list of chromatograms. — plot_chroms","title":"Plot traces from list of chromatograms. — plot_chroms","text":"Plots specified traces list chromatograms.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_chroms.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot traces from list of chromatograms. — plot_chroms","text":"","code":"plot_chroms( x, lambdas, idx, xlim, ylim, xlab = \"\", ylab = \"Absorbance\", engine = c(\"base\", \"ggplot\", \"plotly\"), linewidth = 1, show_legend = TRUE, legend_position = \"topright\", ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_chroms.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot traces from list of chromatograms. — plot_chroms","text":"x list chromatograms matrix format (timepoints x wavelengths). lambdas wavelength(s) wish plot trace . idx vector representing names numerical indices chromatograms plot. xlim Range x axis. ylim Range y axis. xlab X label. ylab Y label. Defaults \"Absorbance\". engine Plotting engine. Either base (matplot), plotly, ggplot2-package. linewidth Line width. show_legend Logical. Whether display legend . Defaults TRUE. legend_position Position legend. ... Additional arguments plotting function specified engine.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_chroms.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot traces from list of chromatograms. — plot_chroms","text":"return value, called side effects.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_chroms.html","id":"side-effects","dir":"Reference","previous_headings":"","what":"Side effects","title":"Plot traces from list of chromatograms. — plot_chroms","text":"Plots traces specified chromatograms idx specified wavelengths lambdas. Plots can produced using base graphics, ggplot2, plotly, according value engine.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_chroms.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot traces from list of chromatograms. — plot_chroms","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_chroms.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot traces from list of chromatograms. — plot_chroms","text":"","code":"data(Sa_pr) plot_chroms(Sa_pr, idx = c(1:2), lambdas = c(210))"},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_spectrum.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot spectrum from peak table — plot_spectrum","title":"Plot spectrum from peak table — plot_spectrum","text":"Plots trace /spectrum given peak peak.table object, plots spectrum particular retention time given chromatogram.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_spectrum.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot spectrum from peak table — plot_spectrum","text":"","code":"plot_spectrum( loc = NULL, peak_table, chrom_list, idx = \"max\", lambda = \"max\", plot_spectrum = TRUE, plot_trace = TRUE, spectrum_labels = TRUE, scale_spectrum = FALSE, export_spectrum = FALSE, verbose = TRUE, what = c(\"peak\", \"rt\", \"idx\", \"click\"), engine = c(\"base\", \"plotly\", \"ggplot2\"), chr = NULL, ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_spectrum.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot spectrum from peak table — plot_spectrum","text":"loc name peak retention time wish extract spectral data. peak_table peak table (output get_peaktable). chrom_list list chromatograms matrix format (timepoints x wavelengths). argument provided , function try find chrom_list object used create provided peak_table. idx Numerical index chromatogram wish plot, \"max\" automatically plot chromatogram largest signal. lambda wavelength wish plot trace plot_trace == TRUE /wavelength used determination signal abundance. plot_spectrum Logical. TRUE, plots spectrum chosen peak. Defaults TRUE. plot_trace Logical. TRUE, plots trace chosen peak lambda. Defaults TRUE. spectrum_labels Logical. TRUE, plots labels maxima spectral plot. Defaults TRUE. scale_spectrum Logical. TRUE, scales spectrum unit height. Defaults FALSE. export_spectrum Logical. TRUE, exports spectrum console. Defaults FALSE. verbose Logical. TRUE, prints verbose output console. Defaults TRUE. look . Either peak extract spectral information certain peak, rt scan retention time, idx scan numeric index, click manually select retention time clicking chromatogram. Defaults \"peak\" mode. engine plotting engine use: base, ggplot2, plotly. chr Deprecated. Please use idx instead. ... Additional arguments.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_spectrum.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot spectrum from peak table — plot_spectrum","text":"export_spectrum TRUE, returns spectrum data.frame wavelengths rows single column encoding absorbance (normalized absorbance, scale_spectrum TRUE) wavelength. export_spectrum FALSE, output depends plotting engine. engine == \"plotly\", returns plotly object containing specified plots. Otherwise, engine == \"base\", return value.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_spectrum.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot spectrum from peak table — plot_spectrum","text":"Can used confirm identity peak check particular column peak table represents single compound. Retention times can also selected clicking plotted trace == 'click'.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_spectrum.html","id":"side-effects","dir":"Reference","previous_headings":"","what":"Side effects","title":"Plot spectrum from peak table — plot_spectrum","text":"plot_trace TRUE, plots chromatographic trace specified chromatogram (idx), specified wavelength (lambda) dotted red line indicate retention time given loc. trace single column chromatographic matrix. plot_spectrum TRUE, plots spectrum specified chromatogram specified retention time. spectrum single row chromatographic matrix.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_spectrum.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot spectrum from peak table — plot_spectrum","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/plot_spectrum.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot spectrum from peak table — plot_spectrum","text":"","code":"if (FALSE) { # interactive() data(Sa) pks <- get_peaks(Sa, lambda = \"220.00000\") pk_tab <- get_peaktable(pks) oldpar <- par(no.readonly = TRUE) par(mfrow = c(2, 1)) plot_spectrum(loc = \"V10\", peak_table = pk_tab, what = \"peak\") par(oldpar) }"},{"path":"https://ethanbass.github.io/chromatographR/reference/preprocess.html","id":null,"dir":"Reference","previous_headings":"","what":"Preprocess time/wavelength data — preprocess","title":"Preprocess time/wavelength data — preprocess","text":"Standard pre-processing response matrices, consisting time axis spectral axis (e.g. HPLC-DAD/UV data). smooth data, like UV-VIS data, size matrix can reduced interpolation. default, data baseline-corrected time direction (baseline.corr) smoothed spectral dimension using cubic smoothing splines (smooth.spline.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/preprocess.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Preprocess time/wavelength data — preprocess","text":"","code":"preprocess( X, dim1, dim2, remove.time.baseline = TRUE, spec.smooth = TRUE, maxI = NULL, parallel = NULL, interpolate_rows = TRUE, interpolate_cols = TRUE, mc.cores, cl = 2, show_progress = NULL, ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/preprocess.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Preprocess time/wavelength data — preprocess","text":"X numerical data matrix, list data matrices. Missing values allowed. rownames colnames attributes used, numerical signify time points wavelengths, respectively. dim1 new, usually shorter, set time points (numerical). range exceed range original time points. dim2 new, usually shorter, set wavelengths (numerical). range exceed range original wavelengths. remove.time.baseline Logical, indicating whether baseline correction done time direction, according baseline.corr. Default TRUE. spec.smooth Logical, indicating whether smoothing done spectral direction, according smooth.spline. Default TRUE. maxI given, maximum intensity matrix set value. parallel Logical, indicating whether use parallel processing. Defaults TRUE (unless Windows). interpolate_rows Logical. Whether interpolate along time axis (dim1). Defaults TRUE. interpolate_cols Logical. Whether interpolate along spectral axis (dim2). Defaults TRUE. mc.cores many cores use parallel processing. Defaults 2. argument deprecated replaces cl. cl Argument pblapply mclapply. Either integer specifying number clusters use parallel processing cluster object created makeCluster. Defaults 2. Windows integer values ignored. show_progress Logical. Whether show progress bar. Defaults TRUE pbapply installed. ... optional arguments baseline.corr.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/preprocess.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Preprocess time/wavelength data — preprocess","text":"function returns preprocessed data matrix (list matrices), row names column names indicating time points wavelengths, respectively.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/preprocess.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Preprocess time/wavelength data — preprocess","text":"Adapted preprocess function alsace package Ron Wehrens.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/preprocess.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Preprocess time/wavelength data — preprocess","text":"Wehrens, R., Bloemberg, T.G., Eilers P.H.C. 2015. Fast parametric time warping peak lists. Bioinformatics 31:3063-3065. doi:10.1093/bioinformatics/btv299 . Wehrens, R., Carvalho, E., Fraser, P.D. 2015. Metabolite profiling LC–DAD using multivariate curve resolution: alsace package R. Metabolomics 11:1:143-154. doi:10.1007/s11306-014-0683-5 .","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/preprocess.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Preprocess time/wavelength data — preprocess","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/preprocess.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Preprocess time/wavelength data — preprocess","text":"","code":"if (FALSE) { # interactive() data(Sa) new.ts <- seq(10,18.66,by=.01) # choose time-points new.lambdas <- seq(200, 318, by = 2) # choose wavelengths Sa_pr <- preprocess(Sa[[1]], dim1 = new.ts, dim2 = new.lambdas) }"},{"path":"https://ethanbass.github.io/chromatographR/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Read chromatograms. — reexports","title":"Read chromatograms. — reexports","text":"objects imported packages. Follow links see documentation. chromConverter read_chroms","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_chroms.html","id":null,"dir":"Reference","previous_headings":"","what":"Reshape chromatograms Reshapes a list of chromatograms from wide to long format. — reshape_chroms","title":"Reshape chromatograms Reshapes a list of chromatograms from wide to long format. — reshape_chroms","text":"Reshape chromatograms Reshapes list chromatograms wide long format.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_chroms.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reshape chromatograms Reshapes a list of chromatograms from wide to long format. — reshape_chroms","text":"","code":"reshape_chroms(x, idx, sample_var = \"sample\", lambdas = NULL, rts = NULL)"},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_chroms.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reshape chromatograms Reshapes a list of chromatograms from wide to long format. — reshape_chroms","text":"x list chromatographic matrices wide format. idx Indices chromatograms convert sample_var String name new column containing sample IDs. lambdas Vector specifying wavelength(s) include. rts Vector specifying retention times include.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_chroms.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reshape chromatograms Reshapes a list of chromatograms from wide to long format. — reshape_chroms","text":"list chromatographic matrices long format.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_chroms.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Reshape chromatograms Reshapes a list of chromatograms from wide to long format. — reshape_chroms","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_peaktable.html","id":null,"dir":"Reference","previous_headings":"","what":"Reshapes peak table from wide to long format — reshape_peaktable","title":"Reshapes peak table from wide to long format — reshape_peaktable","text":"Reshapes peak table wide long format","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_peaktable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reshapes peak table from wide to long format — reshape_peaktable","text":"","code":"reshape_peaktable(x, peaks, metadata, fixed_levels = TRUE)"},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_peaktable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reshapes peak table from wide to long format — reshape_peaktable","text":"x peak_table object. peaks character vector specifying peaks include. character vector named, names vector elements used place original peak names. metadata character vector specifying metadata fields include. fixed_levels Logical. Whether fix factor levels features order provided. Defaults TRUE.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_peaktable.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reshapes peak table from wide to long format — reshape_peaktable","text":"data.frame containing information specified peaks long format.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/reshape_peaktable.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Reshapes peak table from wide to long format — reshape_peaktable","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/scan_chrom.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot spectra by clicking on the chromatogram — scan_chrom","title":"Plot spectra by clicking on the chromatogram — scan_chrom","text":"Plot spectra clicking chromatogram","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/scan_chrom.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot spectra by clicking on the chromatogram — scan_chrom","text":"","code":"scan_chrom( chrom_list, idx, lambda, plot_spectrum = TRUE, peak_table = NULL, scale_spectrum = FALSE, spectrum_labels = TRUE, export_spectrum = FALSE, chr = NULL, ... )"},{"path":"https://ethanbass.github.io/chromatographR/reference/scan_chrom.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot spectra by clicking on the chromatogram — scan_chrom","text":"chrom_list list chromatograms matrix format (timepoints x wavelengths). argument provided , function try find chrom_list object used create provided peak_table. idx Numerical index chromatogram wish plot. lambda wavelength plot trace . plot_spectrum Logical. Whether plot spectrum . peak_table peak table (output get_peaktable function). scale_spectrum Logical. TRUE, scales spectrum unit height. Defaults FALSE. spectrum_labels Logical. TRUE, plots labels maxima spectral plot. Defaults TRUE. export_spectrum Logical. TRUE, exports spectrum console. Defaults FALSE. chr Deprecated. Please use idx instead. ... Additional arguments.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/scan_chrom.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot spectra by clicking on the chromatogram — scan_chrom","text":"export_spectrum TRUE, returns spectrum data.frame wavelengths rows single column encoding absorbance (normalized absorbance, scale_spectrum TRUE) wavelength. Otherwise, return value.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/scan_chrom.html","id":"side-effects","dir":"Reference","previous_headings":"","what":"Side effects","title":"Plot spectra by clicking on the chromatogram — scan_chrom","text":"Plots chromatographic trace specified chromatogram (idx), specified wavelength (lambda) dotted red line indicate user-selected retention time. trace single column chromatographic matrix. plot_spectrum TRUE, plots spectrum specified chromatogram user-specified retention time. spectrum single row chromatographic matrix.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/scan_chrom.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot spectra by clicking on the chromatogram — scan_chrom","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/scan_chrom.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot spectra by clicking on the chromatogram — scan_chrom","text":"","code":"if (FALSE) { # interactive() data(Sa_pr) scan_chrom(Sa_pr, lambda = \"210\", idx = 2, export_spectrum = TRUE) }"},{"path":"https://ethanbass.github.io/chromatographR/reference/subset.peak_table.html","id":null,"dir":"Reference","previous_headings":"","what":"Subset peak table Return subset of peak_table object. — subset.peak_table","title":"Subset peak table Return subset of peak_table object. — subset.peak_table","text":"Subset peak table Return subset peak_table object.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/subset.peak_table.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Subset peak table Return subset of peak_table object. — subset.peak_table","text":"","code":"# S3 method for class 'peak_table' subset(x, subset, select, drop = FALSE)"},{"path":"https://ethanbass.github.io/chromatographR/reference/subset.peak_table.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Subset peak table Return subset of peak_table object. — subset.peak_table","text":"x peak_table object subset Logical expression indicating rows (samples) keep peak_table; missing values taken false. select Logical expression indicating columns (peaks) select peak_table. drop Logical. Passed indexing operator.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/subset.peak_table.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Subset peak table Return subset of peak_table object. — subset.peak_table","text":"peak_table object samples specified subset peaks specified select.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/subset.peak_table.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Subset peak table Return subset of peak_table object. — subset.peak_table","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/trim_peak.html","id":null,"dir":"Reference","previous_headings":"","what":"Trim peak — trim_peak","title":"Trim peak — trim_peak","text":"Trim peak","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/trim_peak.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Trim peak — trim_peak","text":"","code":"trim_peak(x, pos, cutoff = 0.05)"},{"path":"https://ethanbass.github.io/chromatographR/reference/trim_peak.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Trim peak — trim_peak","text":"x chromatogram matrix format pos vector containing peak information cutoff Proportion maximum absorbance use cutoff. Defaults .05.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/trim_peak.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Trim peak — trim_peak","text":"Returns indices within peak specified pos higher signal intensity specified cutoff.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/trim_peak.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Trim peak — trim_peak","text":"Ethan Bass","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/write_peaktable.html","id":null,"dir":"Reference","previous_headings":"","what":"Export peak table — write_peaktable","title":"Export peak table — write_peaktable","text":"Export peak table csv xlsx format according value format.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/write_peaktable.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export peak table — write_peaktable","text":"","code":"write_peaktable( peak_table, path, filename = \"peak_table\", format = c(\"csv\", \"xlsx\"), what = c(\"tab\", \"pk_meta\", \"sample_meta\", \"ref_spectra\", \"args\") )"},{"path":"https://ethanbass.github.io/chromatographR/reference/write_peaktable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export peak table — write_peaktable","text":"peak_table Peak table object get_peaktable. path Path write file. filename File name. Defaults \"peak_table\". format File format export. Either csv xlsx. elements peak_table export.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/write_peaktable.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export peak table — write_peaktable","text":"return value. function called side effects.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/write_peaktable.html","id":"side-effects","dir":"Reference","previous_headings":"","what":"Side effects","title":"Export peak table — write_peaktable","text":"Exports peak_table object .csv .xlsx file according value format.","code":""},{"path":"https://ethanbass.github.io/chromatographR/reference/write_peaktable.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Export peak table — write_peaktable","text":"","code":"# \\donttest{ data(pk_tab) path_out = tempdir() write_peaktable(pk_tab, path = path_out, what = c(\"tab\")) # }"},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-072","dir":"Changelog","previous_headings":"","what":"chromatographR 0.7.2","title":"chromatographR 0.7.2","text":"Export get_times get_lambdas functions. Small revisions documentation. Use tryCatch allow missing spectra plot_all_spectra. Fixed rounding p-values cluster_spectra. Changed alpha cluster_peaks match common usage, alpha parameter now specifies significance level rather confidence level (1-alpha). Deprecated peak_no argument cluster_peaks favor new min_size max_size arguments.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-071","dir":"Changelog","previous_headings":"","what":"chromatographR 0.7.1","title":"chromatographR 0.7.1","text":"Fixed bug get_peaks causing peaks erroneously filtered cases. Made small updates documentation (preprocess fit_peaks functions) better describe arguments. Added warning mirror_plot var contains two levels levels aren’t specified. Fixed bug allow mirror_plot work properly 2D data. Return dimnames 1D ptw model objects returned correct_rt. Minor updates vignette.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-070","dir":"Changelog","previous_headings":"","what":"chromatographR 0.7.0","title":"chromatographR 0.7.0","text":"Updated correct_peaks function works properly correcting retention times peak lists. Added fixed_levels argument reshape_peaktable features can plotted order ’re provided user. Added option summing split peaks using merge_peaks function selecting method = \"sum\". Updated get_peaktable use.cor argument works correctly (use corrected retention times stored separate column). Fixed mirror_plot can take numeric input lambdas. Changed default setting verbose argument correct_rt FALSE default setting. Removed load_chroms function. Use read_chroms instead. Eliminated spurious warning attach_ref_spectra function. Changed name index argument plot.peak_list idx. original argument now deprecated. Fixed bug affecting plot_purity argument plot.peak_list. Fixed bug reshape_chroms empty metadata column longer appears. plot_spectrum function now includes peak names plotting spectra. Fixed correct_rt longer requires user-provided lambdas 1D chromatograms. Added subset.peak_table function easily subsetting peak_tables (e.g. exclude specific peaks samples). Added argument plot_all_spectra (e.g. plot multiple spectra particular retention time).","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"refactoring-of-cluster_spectra-function-0-7-0","dir":"Changelog","previous_headings":"","what":"Refactoring of cluster_spectra function:","title":"chromatographR 0.7.0","text":"simplicity, cluster_spectra now requires reference spectra attached peak table. Accordingly, chrom_list argument longer needed. Saving RDS now turned default. pvclust package now suggested instead required.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"updates-to-vignette-and-documentation-0-7-0","dir":"Changelog","previous_headings":"","what":"Updates to vignette and documentation","title":"chromatographR 0.7.0","text":"Suggest numeric input lambdas instead character input reduce unnecessary confusion. Made minor changes text vignette (hopefully) improve clarity. Added short section attachment reference spectra.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-061","dir":"Changelog","previous_headings":"","what":"chromatographR 0.6.1","title":"chromatographR 0.6.1","text":"Fixed bug plot functions (e.g. plot_chroms plot_spectrum) causing error retention times inconsistent chromatograms. Eliminated spurious warning preprocess function. Updated read_chroms syntax vignette.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"new-features-0-6-0","dir":"Changelog","previous_headings":"","what":"New features","title":"chromatographR 0.6.0","text":"Enabled use parallel package parallel processing (addition current options using mcapply). (options require installation suggested package pbapply). Updated get_peaktable greater flexibility (e.g. usage ‘ChemStation’ peak lists input).","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"other-changes-0-6-0","dir":"Changelog","previous_headings":"","what":"Other changes","title":"chromatographR 0.6.0","text":"Made minor changes vignette improve clarity (e.g. using single wavelength integration, etc.)","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"bug-fixes-0-6-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"chromatographR 0.6.0","text":"Fixed error attach_metadata NA values merge column.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-056","dir":"Changelog","previous_headings":"","what":"chromatographR 0.5.6","title":"chromatographR 0.5.6","text":"Fixed bug preprocess function causing fatal error due misrecognition matrices. Fixed behavior plot_chroms correct_rt allow automatic detection lambda 1D chromatograms. Fixed bug combine_peaks (due misplaced parenthesis). Added new option filter maximum peak area height filter_peaktable (= \"max\"), suggested Katherine Holmes.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-055","dir":"Changelog","previous_headings":"","what":"chromatographR 0.5.5","title":"chromatographR 0.5.5","text":"Fixed bug get_peaktable causing failure print strip plot plot_it == TRUE.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-054","dir":"Changelog","previous_headings":"","what":"chromatographR 0.5.4","title":"chromatographR 0.5.4","text":"Added .zenodo.json file.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-053","dir":"Changelog","previous_headings":"","what":"chromatographR 0.5.3","title":"chromatographR 0.5.3","text":"Fixed bug plot_chroms causing mismatched legend labels base R plot. Added additional arguments plot_chroms function: xlim,ylim, legend_position. Added additional information arguments available get_peaks fine-tuning peak-finding algorithm (response #27).","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-052","dir":"Changelog","previous_headings":"","what":"chromatographR 0.5.2","title":"chromatographR 0.5.2","text":"Added metadata argument reshape_peaktable filtering metadata fields. Added option renaming peaks via reshape_peaktable providing named character vector.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-051","dir":"Changelog","previous_headings":"","what":"chromatographR 0.5.1","title":"chromatographR 0.5.1","text":"plot_chroms, show_legend now defaults FALSE prevent overloading plot.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"bug-fixes-0-5-1","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"chromatographR 0.5.1","text":"Fixed syntactical bug get_peaktable applied gaussian peak list. Fixed bug caused improper transfer time.units metadata filter_peaks function. Added default missing time.units plot.peak_list.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"new-features-0-5-0","dir":"Changelog","previous_headings":"","what":"New features","title":"chromatographR 0.5.0","text":"Added ggplot2 option plot_spectrum, plot.peak_table plot_all_spectra functions. Reworked write_chroms sensible handling paths added filename argument. Updated get_purity function improve speed. Added additional argument reshape_chroms function subsetting data retention times (rts). Added parallel processing pbapply package correct_rt, get_peaks, preprocess functions setting cl argument.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"other-changes-0-5-0","dir":"Changelog","previous_headings":"","what":"Other changes","title":"chromatographR 0.5.0","text":"Changed behavior preprocess inferring retention times chromatograms longer rounded largest integer. preprocess, spectral smoothing longer applied 2D chromatograms, removing error message preprocess used default settings. Moved position ... argument end plot.peak_table. Changed progress_bar argument show_progress correct_rt, preprocess get_peaks fix strange pmatch behavior additional arguments preprocess. Changed orientation “plotly” plots generated plot_spectrum match plotting engines. Deprecated mc.cores argument correct_rt now deprecated favor new cl argument. Deprecated parallel argument preprocess favor just using cl. Changed name first argument mirror_plot peak_table x. Otherwise function changed. Added additional tests, improving test coverage 80%. Updated get_chrom_list (internal) allow parsing subsetted lists.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-048","dir":"Changelog","previous_headings":"","what":"chromatographR 0.4.8","title":"chromatographR 0.4.8","text":"Fixed bug merge_peaks function works properly (combine 2 peaks peak table). Fixed bugs plot_chroms preventing plotting ggplot2 plotting wrong chromatograms base R. Added additional tests plot_chroms reshape functions.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-047","dir":"Changelog","previous_headings":"","what":"chromatographR 0.4.7","title":"chromatographR 0.4.7","text":"Added reshape_peaktable function conversion peak tables long format. Turned estimate_purity get_peaks function default. Added option filter wavelength reshape_chroms, speeding plot_chroms.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"new-features-0-4-6","dir":"Changelog","previous_headings":"","what":"New Features","title":"chromatographR 0.4.6","text":"Added plot_chroms function easily plotting multiple traces list chromatograms. Minor changes internal syntax correct_rt give informative error messages. Added estimate_purity argument get_peaks toggle peak purity estimation. Changed default setting progress_bar correct_rt get_peaks. Now defaults TRUE pbapply installed. Added additional tests utility functions new plot_chroms function. Minor changes vignette. Minor changes documentation.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"bug-fixes-0-4-6","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"chromatographR 0.4.6","text":"Fixed bug causing mismatched time axes alignment issues VPdtw warping (), returns matrices consistent time axis. Fixed y unit label boxplot.peak_table function. Fixed behavior plot_spectrum spectrum exported properly engine == plotly. Fixed bug write_peaktable writing xlsx.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"new-features-0-4-5","dir":"Changelog","previous_headings":"","what":"New Features","title":"chromatographR 0.4.5","text":"Added reshape_chroms function converting chromatograms “long” format. Added write_peaktable function easily write peak_table csv xlsx. Added get_purity function assessing peak purity. Allow multiple peaks arguments plot.peaktable. Added functions plotting traces spectra plotly: plotly_trace plotly_spec. Fixed preprocess longer try interpolate along columns 2D data. Added stand-alone boxplot function peak_table objects. Added new class (ptw_list) plotting function lists ptw alignment objects. Added plot_it argument correct_rt plotting alignments. Added VPdtw dependency (instead suggested). Added progress_bar option get_peaks correct_rt. Improved error handling plot.peaklist. Updated find_peaks function better smoothing options improve peak-finding. Now defaults gaussian smoothing. Changed fit_peaks function syntax (see ). Minor updates vignette.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"changes-to-fit_peaks-function-0-4-5","dir":"Changelog","previous_headings":"New Features","what":"Changes to fit_peaks function:","title":"chromatographR 0.4.5","text":"Simplified logic fit_peaks function. Modified fit_peaks syntax now takes matrix (x) wavelength (lambda) instead numeric vector (y). Incorporated assessment peak purity peak fitting. Added wavelength (lambda) peak_list peak_table metadata. Fixed bug allow fitting single peak fit_peaks.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"bug-fixes-0-4-5","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"chromatographR 0.4.5","text":"Fixed bug causing mismatched time axes (improper alignment chromatograms) variable penalty dynamic time warping (VPdtw). Fixed bug attach_metadata result disordered rows. Fixed occasional test failure MKL server skipping cluster_spectra test CRAN. Adjusted cluster_spectra combine_peaks functions messages can suppressed verbose == FALSE.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-044","dir":"Changelog","previous_headings":"","what":"chromatographR 0.4.4","title":"chromatographR 0.4.4","text":"CRAN release: 2022-08-24 Fixed issue tests run certain machines (MKL).","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-043","dir":"Changelog","previous_headings":"","what":"chromatographR 0.4.3","title":"chromatographR 0.4.3","text":"CRAN release: 2022-08-22 Minor changes documentation. Added additional check chrom_list dimensions names.","code":""},{"path":[]},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"new-features-0-4-2","dir":"Changelog","previous_headings":"","what":"New features","title":"chromatographR 0.4.2","text":"Added option select time.units peak area get_peaks function facilitating better comparison vendor software. Now allow preservation instrumental metadata pre-processing alignment steps. Added filter_peaktable function.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"minor-changes-0-4-2","dir":"Changelog","previous_headings":"","what":"Minor changes:","title":"chromatographR 0.4.2","text":"Deprecated load_chroms function. Please use read_chroms chromConverter import files instead. Changed default behavior correct_rt corrected_values rather models. Added informative warnings error messages various functions. Now recommend installation VPdtw CRAN instead https://ethanbass.github.io/drat/ Fixed typos vignette","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"bug-fixes-0-4-2","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"chromatographR 0.4.2","text":"Fixed bug cluster_spectra affecting peaks 0 standard deviation. Fixed bug affecting peak_list metadata.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-041","dir":"Changelog","previous_headings":"","what":"chromatographR 0.4.1","title":"chromatographR 0.4.1","text":"CRAN release: 2022-05-19 Extended package DESCRIPTION added citations relevant references. Added \\value \\section{Side effects} fields docs various plot functions. Fixed bug mirror_plot legend can fully hidden setting plot_legend FALSE. Fixed bug scan_chrom additional arguments passed plot_spectrum. Added color argument customize color fitted peaks plot.peak_list. Fixed plot functions examples don’t change par settings. small updates documents (mostly formatting small clarifications). Fixed plot.peak_table can return spectra export_spectrum TRUE. Added error box_plot option plot.peak_table metadata attached. Added error box_plot option plot.peak_table peak provided loc. Added error plot_spectrum function user-supplied retention times beyond edges chromatogram. Added error plot_spectrum function unspecified lambda (==\"click). Released CRAN","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-040","dir":"Changelog","previous_headings":"","what":"chromatographR 0.4.0","title":"chromatographR 0.4.0","text":"Added support variable penalty dynamic time warping (VPdtw) correct_rt function. Fixed bug get_peaks function. Allow preprocessing without interpolation. Fixed bug preprocess can work Windows (without parallel processing). Allow use raw data peak integration get_peaks. Added verbose option correct_rt print reference chromatogram.","code":""},{"path":"https://ethanbass.github.io/chromatographR/news/index.html","id":"chromatographr-030","dir":"Changelog","previous_headings":"","what":"chromatographR 0.3.0","title":"chromatographR 0.3.0","text":"Added NEWS.md file track changes package.","code":""}]