chromatographR 0.8.0
Breaking changes
- Added support for bidirectional exponentially modified gaussian (BEMG) peak shape (
fit = "bemg"inget_peaks/fit_peaks). The default peak shape remains"egh"for now but this may change in a future release. - Added
summarize_byargument toget_peaktablecontrolling how peak metadata (e.g., retention time) are summarized across peaks within each cluster. The new default ("weighted.mean") weights peaks by their intensity, making it more robust to the presence of small noisy peaks which may skew the results of aggregation, especially when the dominant peak does not occur in every sample. Alternative options include"mean","median", and"max", the last of which uses the most intense peak in each cluster directly rather than aggregating. To reproduce previous behavior, setsummarize_by = "mean". - Added automatic thinning of chromatograms in
plot_chromsto speed up plotting of raw data. The time resolution can be adjusted with the newtime_resolutionargument. - Changed behavior of
plot_chromsso legend is no longer displayed by default to avoid overloading plots with many chromatograms. - When
export_spectrum == TRUEalways return spectra invisibly inplot_spectrumandplot_all_spectrato avoid cluttering up the console. - Corrected
get_peaksto return model-fitted peak heights rather than raw peak heights. This changes numerical output for workflows that relied on the previous (incorrect) behavior. - Added
fill_zerosargument tocorrect_rtto control whether out-of-bounds regions produced by warping are filled with zeros or returned asNA. Defaults toFALSEwhich changes the behavior for VPdtw warping which used to automatically fill zeros. - Changed the name of the
aparameter inplot.peak_listtoalpha. - Renamed
chrom_listargument toxinplot_chroms_heatmapto reflect that the function can now accept a peak table in the first position in addition to a list of chromatograms. - Removed
indexandchrarguments across plotting functions, previously deprecated in v0.7.0. Useidxinstead. - Corrected
merge_peaksso that the result no longer depends on the order in whichpeaksare supplied. Previously, supplying peaks in an order other than their order in the peak table retained the correct column but left it holding its original value rather than the merged one. - Corrected
get_purity, which used the wrong wavelength to decide which timepoints belong to a peak. Purity is reported as the fraction of in-peak timepoints whose purity ratio falls below 1, andcutoffdetermines which timepoints count as in-peak. That determination was always made from the first wavelength in the chromatogram rather than from the wavelength where the peak actually absorbs. It now uses the wavelength of maximum absorbance at the peak apex. Purity values change for any peak that does not absorb maximally at the first wavelength. - Deprecated arguments in
get_peaksstill using dot notation (e.g.,sd.max). Use new snake case arguments (e.g.,sd_max) instead! - Deprecated
peakargument inplot_all_spectrain favor oflocfor consistency with other plotting functions. - Deprecated the
saveargument incluster_spectrain favor ofoutfile, which specifies the file path for saving cluster objects. - Removed deprecated
peak_noargument fromcluster_spectra.
New features
New functions
- Added
subtract_blanksfunction for subtracting blank chromatograms from achrom_list. - Added
correct_rt_groupfunction for group-wise warping function estimation using within-group averages. This improves alignment accuracy when samples share batch-level retention time shifts or contain group-specific peaks, and is generally faster than per-sample alignment. - Added
plot_spectrum_insetfunction for plotting UV spectra overlaid onto a chromatogram. - Added
annotate_peaksfunction for adding text labels to peaks in plots created byplot_chroms. - Added
get_spectrafunction for extracting spectra from chromatograms. Theexport_spectrumargument inplot_spectrumandplot_all_spectrais deprecated in favor ofget_spectra.
New generic functions
- Added
summarymethod forpeak_tableobjects, reporting dimensions, retention time range, intensity statistics, and metadata availability. - Added
print.peak_tablefunction to return just the peak data. - Added
[method forpeak_tableobjects for simultaneous subsetting oftab,pk_meta,sample_meta, andref_spectraelements. - Added
[method forpeak_listobjects to preserve metadata attributes when subsetting. - Added
printmethod forpeak_listobjects, summarizing samples, wavelengths, fit method, and peak counts.
Enhancements
- Added support for fitting a local baseline beneath each peak through the
baselineargument inget_peaks. Options are"none"(default, no baseline),"flat"(constant offset), and"sloped". Peak heights and areas are computed above the fitted baseline. - Added support for plotting spectra from multiple chromatograms in
plot_spectrumby supplying a vector toidx(e.g.idx = c(1, 2, 4)). Overlaid traces and spectra are color-coded by sample. - Added new options to
combine_peaks("least_sparse"and"lambda") via thechooseargument:"least_sparse"retains the peak detected in the greatest number of samples;"lambda"retains the peak measured at a preferred wavelength (supplied via the newlambdaargument), falling back to"max"when no match is found. - Preprocess can now take nested lists containing a
dadelement in each list. This change allows better compatibility with chromConverter. - Added more informative warnings and errors to
preprocessfunction. - Added support for numeric input to lambda argument in
reshape_chroms. - Refactored
normalize_datafor improved performance and addedon_invalidargument to specify behavior for dealing with invalid normalization values (zero, negative orNA). - Refactored
normalize_datafor automatic detection of column names so that user no longer has to specify whether they wish to normalize by a metadata column or a column in the peak table. - Refactored
ptwwarping incorrect_rtusing whole-matrix interpolation resulting in substantial speedup. - Added
max_zerosargument infilter_peaktableto exclude features above a threshold proportion of zero values. - Added support for new
chrom_listclass introduced in chromConverter v0.9.0. - Allow
plot_chromsandplot_chroms_heatmapto accept peak table as first argument.
Bug fixes and other minor changes
Corrected two minor bugs in
get_purity: one which counted a pure timepoint as impure when the estimated noise variance was zero, and another which returnedNAwithout warning when only one timepoint fell below the noise threshold.Fixed
preprocessfunction incorrectly truncating chromatograms when outliers are present anddim1is not specified.Fixed input validation in
preprocessso lists containing non-matrix elements no longer pass validation without error.Fixed bug in
filter_peaktablewhen filtering peaks based on specific retention times with thertsargument.Fixed
filter_peaktableandfilter_peaksto make filtering criteria inclusive (e.g.,min_rt = 5now retains peaks withrt == 5).Added error when duplicated sample names are provided to
get_peaktableorget_peakssince this will cause downstream issues.Fixed issue with visual tests due to new version of Kaleido.
Added additional arguments as placeholder for
subset.peak_table.Fixed bug in
normalize_datacausing loss of sample names when normalizing chromatograms.Formalized requirement for R version 4.1.0.
Fixed
plot_spectrumplots with plotly engine so they always maintain their axis labels.Standardized axis labels across
plot_spectrumplots.Standardized titles of trace plots across engines so they always use unicode lambda character.
Fixed
reshape_chromsso it returns a factor for thesamplecolumn.Fixed
plot_chromsso chromatograms are black when plotting a single chromatogram with plotly or ggplot.Fixed
plot_all_spectrato consistently export spectra in wide format regardless of plotting engine.Fixed error in equation describing spectral clustering in documentation for
get_peaktable.Fixed
get_peaktable(withclust = "sp.rt") to no longer take the absolute value of spectral similarity scores. Previously,abs()caused negatively correlated spectra to be treated as similar; now they are correctly penalized as dissimilar.Fixed bug in FWHM calculation in
get_peaktablefor raw peak shape.Fixed
filter_peaktableso that peaks withNAvalues in some samples are not excluded when filtering bymin_value.Suppressed spurious “essentially perfect fit” warning from
summary.lmwhen computing R² infit_peaks.Fixed bug in
subset.peak_table()wheresample_metawas subset based on the wrong condition, so it was sometimes not filtered bysubset.Made substantial revisions to documentation to improve clarity.
chromatographR 0.7.4
- Added new heatmap plot in
plot_chromsfor plotting a list of chromatograms as a heatmap. - Added labeling of spectral peaks for
ggplot2andplotlyplots inplot_spectrum. - Added minimum amplitude for labeling of spectral peaks in
plot_spectrum, such that peaks are given a text label only if they exceed 5% of the maximum signal intensity. - Removed
parallelandmc.coresargument frompreprocess(deprecated inv0.5.0). - Added
titleargument inplot_chroms. - Added option for different plotting engines through
engineargument inplot.ptw_list. - Added option for heatmap plots through
whatargument inplot.ptw_list. - Changed behavior of
reshape_chromssuch that it can be applied to 2D chromatograms without throwing an error. - Added index of functions to the package landing page.
- Made minor updates to function documentation.
chromatographR 0.7.3
- Updated
reshape_peaktablefunction to include wavelength and retention time data. - Updated
pk_tabdata file to latest peak table format. - Fixed minor issues with roxygen formatting.
- Added functional “families”.
- Fixed bug in
get_peakscausing occasional errors due to edge cases. - Added titles for ggplot2 and plotly
plot_spectrumplots. - Fixed bug in console output when providing chromatogram index as string to
plot_spectrum. - Changed default
ggplot2theme totheme_light.
chromatographR 0.7.2
- Export
get_timesandget_lambdasfunctions. - Small revisions to documentation.
- Use
tryCatchto allow for missing spectra inplot_all_spectra. - Fixed rounding of p-values in
cluster_spectra. - Changed
alphaincluster_peaksto match common usage, such that thealphaparameter now specifies the significance level rather than the confidence level (1-alpha). - Deprecated
peak_noargument incluster_peaksin favor of newmin_sizeandmax_sizearguments.
chromatographR 0.7.1
- Fixed bug in
get_peakscausing peaks to erroneously filtered out in some cases. - Made small updates to documentation (in
preprocessandfit_peaksfunctions) to better describe arguments. - Added warning in
mirror_plotwhenvarcontains more than two levels and levels aren’t specified. - Fixed bug to allow
mirror_plotto work properly with 2D data. - Return dimnames for 1D ptw model objects returned by
correct_rt. - Minor updates to vignette.
chromatographR 0.7.0
- Updated
correct_peaksfunction so it works properly for correcting retention times in peak lists. - Added
fixed_levelsargument toreshape_peaktableso features can be plotted in the order they’re provided by the user. - Added option for summing split peaks using the
merge_peaksfunction by selectingmethod = "sum". - Updated
get_peaktableso that theuse.corargument works correctly (to use corrected retention times stored in a separate column). - Fixed
mirror_plotso it can take numeric input for lambdas. - Changed default setting of
verboseargument incorrect_rtfromFALSEto default setting. - Removed
load_chromsfunction. Useread_chromsinstead. - Eliminated spurious warning from
attach_ref_spectrafunction. - Changed name of
indexargument inplot.peak_listtoidx. The original argument is now deprecated. - Deprecated
chrargument in multiple plotting functions (e.g.,plot_spectrum) in favor of newidxargument. - Fixed bug affecting
plot_purityargument inplot.peak_list. - Fixed bug in
reshape_chromsso empty metadata column no longer appears. - The
plot_spectrumfunction now includes the peak names when plotting spectra. - Fixed
correct_rtso it no longer requires user-providedlambdasfor 1D chromatograms. - Added
subset.peak_tablefunction for easily subsetting peak_tables (e.g. to exclude specific peaks or samples). - Added
whatargument forplot_all_spectra(e.g. to plot multiple spectra at a particular retention time).
chromatographR 0.6.1
- Fixed bug in plot functions (e.g.
plot_chromsandplot_spectrum) causing error when retention times are inconsistent between chromatograms. - Eliminated spurious warning in preprocess function.
- Updated
read_chromssyntax in vignette.
chromatographR 0.6.0
New features
- Enabled use of
parallelpackage for parallel processing (in addition to current options usingmcapply). (These options require the installation of suggested packagepbapply). - Updated
get_peaktablefor greater flexibility (e.g. for usage of ‘ChemStation’ peak lists as input).
chromatographR 0.5.6
- Fixed bug in preprocess function causing fatal error due to misrecognition of matrices.
- Fixed behavior of
plot_chromsandcorrect_rtto allow automatic detection oflambdafor 1D chromatograms. - Fixed bug in
combine_peaks(due to misplaced parenthesis). - Added new option to filter by maximum peak area or height in
filter_peaktable(what = "max"), as suggested by Katherine Holmes.
chromatographR 0.5.5
- Fixed bug in
get_peaktablecausing failure to print strip plot whenplot_it == TRUE.
chromatographR 0.5.3
- Fixed bug in
plot_chromscausing mismatched legend labels in base R plot. - Added additional arguments to
plot_chromsfunction:xlim,ylim, andlegend_position. - Added additional information about arguments available in
get_peaksfor fine-tuning the peak-finding algorithm (in response to #27).
chromatographR 0.5.2
- Added
metadataargument toreshape_peaktablefor filtering metadata fields. - Added option for renaming peaks via
reshape_peaktableby providing a named character vector.
chromatographR 0.5.0
New features
- Added
ggplot2option toplot_spectrum,plot.peak_tableandplot_all_spectrafunctions. - Reworked
write_chromsfor more sensible handling of paths and addedfilenameargument. - Updated
get_purityfunction to improve speed. - Added additional argument to
reshape_chromsfunction for subsetting data by retention times (rts). - Added parallel processing through the
pbapplypackage for thecorrect_rt,get_peaks, andpreprocessfunctions by setting theclargument.
Other changes
- Changed behavior of
preprocesswhen inferring retention times so chromatograms are no longer rounded down to the largest integer. - In
preprocess, spectral smoothing is no longer applied on 2D chromatograms, removing error message when preprocess is used with default settings. - Moved position of
...argument to end inplot.peak_table. - Changed
progress_barargument toshow_progressincorrect_rt,preprocessandget_peaksto fix strangepmatchbehavior with additional arguments to preprocess. - Changed orientation of “plotly” plots generated by
plot_spectrumto match other plotting engines. - Deprecated the
mc.coresargument incorrect_rtis now deprecated in favor of the newclargument. - Deprecated the
parallelargument inpreprocessin favor of just usingcl. - Changed name of first argument in
mirror_plotfrompeak_tabletox. Otherwise the function has not changed. - Added additional tests, improving test coverage to 80%.
- Updated
get_chrom_list(internal) to allow parsing of subsetted lists.
chromatographR 0.4.8
- Fixed bug in
merge_peaksfunction so it works properly (to combine 2 or more peaks in a peak table). - Fixed bugs in
plot_chromspreventing plotting withggplot2and plotting wrong chromatograms in base R. - Added additional tests for
plot_chromsand reshape functions.
chromatographR 0.4.7
- Added
reshape_peaktablefunction for conversion of peak tables to long format. - Turned off
estimate_purityinget_peaksfunction by default. - Added option to filter by wavelength in
reshape_chroms, speeding upplot_chroms.
chromatographR 0.4.6
New Features
- Added
plot_chromsfunction for easily plotting multiple traces from a list of chromatograms. - Minor changes to internal syntax of
correct_rtto give more informative error messages. - Added
estimate_purityargument inget_peaksto toggle peak purity estimation. - Changed default setting for
progress_barincorrect_rtandget_peaks. Now defaults toTRUEifpbapplyis installed. - Added additional tests of utility functions and new
plot_chromsfunction. - Minor changes to vignette.
- Minor changes to documentation.
Bug fixes
- Fixed bug causing mismatched time axes and alignment issues after VPdtw warping (again), so that it returns matrices with a consistent time axis.
- Fixed y unit label in
boxplot.peak_tablefunction. - Fixed behavior of
plot_spectrumso spectrum is exported properly whenengine == plotly. - Fixed bug in
write_peaktablewhen writing toxlsx.
chromatographR 0.4.5
New Features
- Added
reshape_chromsfunction for converting chromatograms to “long” format. - Added
write_peaktablefunction to easily write peak_table tocsvorxlsx. - Added
get_purityfunction for assessing peak purity. - Allow multiple peaks as arguments to
plot.peaktable. - Added functions for plotting traces and spectra with plotly:
plotly_traceandplotly_spec. - Fixed
preprocessso it will no longer try to interpolate along columns for 2D data. - Added stand-alone
boxplotfunction forpeak_tableobjects. - Added a new class (
ptw_list) and plotting function for lists ofptwalignment objects. - Added
plot_itargument incorrect_rtfor plotting alignments. - Added VPdtw as a dependency (instead of being only suggested).
- Added
progress_baroption toget_peaksandcorrect_rt. - Improved error handling in
plot.peaklist. - Updated find_peaks function with more and better smoothing options to improve peak-finding. Now defaults to gaussian smoothing.
- Changed
fit_peaksfunction and syntax (see below). - Minor updates to vignette.
Changes to fit_peaks function:
- Simplified logic in
fit_peaksfunction. - Modified
fit_peakssyntax so it now takes a matrix (x) and a wavelength (lambda) instead of a numeric vector (y). - Incorporated assessment of peak purity during peak fitting.
- Added wavelength (
lambda) topeak_listandpeak_tablemetadata. - Fixed bug to allow fitting of a single peak with
fit_peaks.
Bug fixes
- Fixed bug causing mismatched time axes (and improper alignment of chromatograms) after variable penalty dynamic time warping (VPdtw).
- Fixed bug in
attach_metadatathat could result in disordered rows. - Fixed occasional test failure on MKL server by skipping
cluster_spectratest on CRAN. - Adjusted
cluster_spectraandcombine_peaksfunctions so messages can be suppressed withverbose == FALSE.
chromatographR 0.4.4
CRAN release: 2022-08-24
- Fixed issue with tests when run on certain machines (MKL).
chromatographR 0.4.3
CRAN release: 2022-08-22
- Minor changes to documentation.
- Added additional check of chrom_list dimensions and names.
chromatographR 0.4.2
New features
- Added option to select
time.unitsfor peak area inget_peaksfunction facilitating better comparison with vendor software. - Now allow preservation of instrumental metadata through pre-processing and alignment steps.
- Added
filter_peaktablefunction.
Minor changes:
- Deprecated
load_chromsfunction. Please useread_chromsfrom chromConverter to import files instead. - Changed default behavior in
correct_rttocorrected_valuesrather thanmodels. - Added more informative warnings and error messages to various functions.
- Now recommend installation of
VPdtwfrom CRAN instead of https://ethanbass.github.io/drat/ - Fixed typos in vignette
chromatographR 0.4.1
CRAN release: 2022-05-19
- Extended package DESCRIPTION and added citations to relevant references.
- Added
\valueand\section{Side effects}fields to docs for the various plot functions. - Fixed bug in
mirror_plotso legend can be fully hidden by settingplot_legendto FALSE. - Fixed bug in
scan_chromso additional arguments are passed toplot_spectrum. - Added
colorargument to customize color of fitted peaks inplot.peak_list. - Fixed plot functions and examples so they don’t change par settings.
- Other small updates to documents (mostly formatting or small clarifications).
- Fixed
plot.peak_tableso it can return spectra ifexport_spectrumis TRUE. - Added error for
box_plotoption inplot.peak_tableif metadata is not attached. - Added error for
box_plotoption inplot.peak_tableif peak is not provided toloc. - Added error in
plot_spectrumfunction for user-supplied retention times beyond the edges of the chromatogram. - Added error in
plot_spectrumfunction for unspecifiedlambda(ifwhat=="click). - Released on CRAN
chromatographR 0.4.0
- Added support for variable penalty dynamic time warping (VPdtw) through
correct_rtfunction. - Fixed bug in get_peaks function.
- Allow preprocessing without interpolation.
- Fixed bug so preprocess can work on Windows (without parallel processing).
- Allow use of raw data for peak integration in
get_peaks. - Added
verboseoption tocorrect_rtto print reference chromatogram.
