chromatographR 0.9.0
Breaking changes
Preprocessing
-
preprocessno longer clamps negative values to zero by default. Set the newzero_floor = TRUEfor bit-identical previous output. -
subtract_blanksno longer clamps negative values to zero by default. Setzero_floor = TRUEfor the previous output; it now warns when it zeroes more than 5% of a sample. -
subtract_blanksnow matches blanks to samples by retention time, interpolating across differing grids. Previously a blank of another length errored, and one of equal length was subtracted row by row, even when its times were offset. - Deprecated
preprocess’sremove.time.baselineargument in favor ofbaseline = "none". -
maxInow follows...inpreprocess’s signature, so it must be named in full. Partial matching otherwise capturedm, which belongs to the baseline estimators.maxIcan no longer be given positionally. -
preprocessnow validatesdim1anddim2, which must be strictly increasing. A namedby,length.out, oralong.withelement gets an informative error pointing atseq().
Retention time correction
- Inverted the meaning of
correct_rt’spenaltyargument foralg = "vpdtw", so a higher value now allows less warping. The default changed from5to0.2; to convert an explicit value, take its reciprocal. Values above1now warn. - The
trwdthargument incorrect_rtnow specifies a width in minutes, not a count of timepoints. Multiply old values by the sampling interval in minutes to convert it; a value wider than the chromatogram now errors. -
correct_rtnow passestrwdthtoptw, which previously ignored it. The default of0.2matchesptw’s own20timepoints atdt = 0.01. -
max_shiftdefaults to1anddilation_spanto0.3, so VPdtw alignments change. See?correct_rt. -
correct_rt(scale = TRUE)now scales chromatograms only to fit the warp, so corrected values keep their original units. Scaling divides by the maximum instead of rescaling to [0, 1]. Usepreprocess(maxI = 1)to rescale the data. -
correct_rtandcorrect_rt_groupnow error when samples’ time axes differ by a sampling interval or more. Previously they warped such samples by timepoint index. Interpolate onto a common grid withpreprocess(dim1 = ...)first. -
correct_rtandcorrect_rt_groupnow error on duplicate sample names, asget_peaksalready did.
Peak detection and integration
-
fit = "bemg"now reportstau_leftandtau_rightas tail time constants intime_unit, so a larger value means a longer tail. In 0.8.0 they were rates (1/time), with left and right swapped. - Corrected an off-by-one error in
find_peaksthat reported every apex one timepoint early. Retention times fromget_peaksandget_peaktableshift accordingly, and peaks whose preceding timepoint had been clipped to zero bypreprocessare now detected. - Fitted retention times can now fall between timepoints, so
rtcan shift by up to one timepoint and"bemg"no longer understatesheight.correct_peaksno longer roundsrt.corfor ptw or lptw models. Matchrtto the time axis with a tolerance, not with==ormatch(). - With
baseline = "sloped", the fitted local baseline no longer rises above the signal at the edges of the peak window. Previously it could, underestimating"egh"and"gaussian"areas. -
r.squaredinget_peaksandfit_peaksoutput is now1 - SS_res / SS_tot, not the squared correlation between the fit and the data. It is lower for poor fits and can be negative, so revisit any cutoffs. -
plot_spectrumandplot_all_spectranow label the correct spectral maxima, having inherited the same off-by-one error. Reported lambda-max values shift by one grid step. -
find_peaksnow rounds the"mva"and"tmva"smoothing windows up to an odd width of at least three points, which changes which apices are detected for these methods. -
find_peaksnow errors whensmooth_windowis narrower than seven timepoints under Savitzky-Golay ("savgol") smoothing. Previously it returned the signal unsmoothed. -
find_peaksandget_peaksnow smooth over 3 timepoints by default. The old default,smooth_window = 0.001, was a proportion of the run, so the smoothing varied with run length. Set it explicitly to restore the old behavior; see Choosing the smoothing window in?find_peaks. - Renamed
find_peaks’sslope_threshandamp_thresharguments tomin_curvatureandmin_amplitude.slope_threshwas a misnomer because the argument thresholded the second derivative, not the slope. For now, the old names still work with a deprecation warning. -
get_peaksandfit_peaksno longer filter on peak width by default. Previouslysd_maxdropped peaks with sd > 50 timepoints; to filter by width, callfilter_peaks(max_fwhm = )on the result.
Peak purity
- Overhauled
get_purity, correcting the purity ratio, so purity values change for every peak.cutoffnow applies to the background-corrected trace, as a proportion of peak height rather than of total absorbance. See?get_purity. - Added arguments to
get_purity:background_correction,reference,metric,min_runandmax_thresholdcontrol the purity calculation, andnoise_method,noise_quantileandnoise_windowcontrol noise estimation. - Deprecated the
weightargument toget_purityandget_agilent_thresholdin favor ofnoise_inflation. - Removed the
noise_thresholdargument fromget_peaksandfit_peaks, which had no effect. Pass purity options aspurity_argsinstead. -
fit_peaksnow defaults toestimate_purity = FALSE, matchingget_peaks, so itspuritycolumn isNAunless you setestimate_purity = TRUE. -
plot_purity = TRUEinplot.peak_listnow draws dissimilarity and threshold curves. It also accepts"curves_local"and"ratio"; see?plot.peak_list.
Peak tables and plotting
- Retention times in dimnames are now formatted to a consistent number of decimal places, so an interpolated time axis is no longer ragged. Lookups by the old names need updating (
x["10.10", ]rather thanx["10.1", ]). -
plot.peak_list’sy.offsetis now a fraction of the plot height, with a default of0.03. Previously it was in absorbance units, with a default of25. Values above 1 warn. Boundary ticks are scaled the same way. -
get_peaktable’shmaxandsigma_t, andcombine_peaks’stol, are now in minutes, regardless of the time unit of the data. Results change only for chromatograms whose times are not in minutes. -
reshape_chromsnow readstime_resolutionin minutes, matchingplot_chroms. Previously it was in the units of the time axis, so divide old values by 60 for chromatograms in seconds. - Removed
get_peaktable’soutargument, so peak tables are always data.frames. Useas.matrix(pt$tab)for a matrix. - Peak tables built from corrected peaks now name the
pk_metarowsrt,startandendrather thanrt.cor,start.corandend.cor, and so doesreshape_peaktable. Checkargs$use_corrected_rtto see which times were used. -
attach_metadatanow adds to an existingsample_meta, replacing only the columns of the same name. Previously it replaced the whole table. To do that now, setpeak_table$sample_meta <- NAfirst.
Example data
- Regenerated the example datasets:
Sa_prandSa_warpare no longer clipped at zero, and mostpk_tabpeak names have shifted; for example,V13is nowV11.
Other renamed and deprecated arguments
- Renamed dot-separated argument names to snake_case:
spec.smoothtosmooth_spectra,min.cortomin_cor,n.traces/n.zeroston_traces/n_zeros,sigma.t/sigma.rtosigma_t/sigma_r, anduse.cortouse_corrected_rt. The old names still work, with a warning.init.coefandmax.onlykeep their names, since they are passed through to external functions that define them. - Deprecated
sd_maxinget_peaksandfit_peaksin favor offilter_peaks(max_fwhm = ), andmin_sd/max_sdinfilter_peaksin favor ofmin_fwhmandmax_fwhm. A standard deviation is equivalent to peak width only forfit = "gaussian". See?filter_peaks. - Renamed the Whittaker smoothing penalty passed to
preprocessandcorrect_baselinefromlambdatostiffness, reservinglambdafor the common usage to specify a wavelength used throughout the package. - Removed the
lambdaargument fromget_spectra, which had no effect. - Renamed
correct_rt’smaxshifttomax_shift, now in minutes.maxshiftstill works, read as a count of timepoints as before, with a warning.
New features
New functions
- Added
correct_baselinefunction for estimating and subtracting a baseline from achrom_listalong the time axis. Unlikepreprocessit does not interpolate, smooth or rescale, so it can be applied to data that are already preprocessed or aligned. - Added
get_baselineandplot_baselinefor retrieving and plotting the baseline retained bypreprocessorcorrect_baselinewhenattach_baseline = TRUE. - Added
crop_chromsfunction for restricting chromatograms to a range of retention times (rt_range) and/or wavelengths (lambda_range). Cropping is pure subsetting, so values and dimnames pass through unchanged, unlikepreprocess(dim1 = ), which interpolates onto a new axis. - Added
match_peaksfunction for matching peaks across chromatograms using spectral correlation and retention time proximity. The resultingmatched_peak_listcan be passed tocorrect_rtfor landmark-based PTW or toget_peaktable. See?targeted_analysisfor matching to a table of targets. - Added
get_time_resolutionfor reading a chromatogram’s sampling interval, in the units of its time axis by default or in minutes viaunit. - Added
plot_chrom_contourfor plotting one chromatogram across retention time and wavelength, on a compressed color scale by default.
New generic functions
- Converted
get_peaktableto an S3 generic. The default method keeps the original behavior, including for unclassed lists. The newget_peaktable.matched_peak_listmethod builds a peak table directly from matched peak pairs. - Added a
plotmethod forchrom_listobjects fromread_chroms, drawing traces, a heatmap or a contour plot according totype.
Baseline correction
- Added a
baselineargument topreprocesschoosing the time-axis baseline estimator:"als"(the default),"arpls","aspls"or"snip". See?baseline_estimators. - The smoothing parameter each estimator used is recorded on the result as a
"baseline_param"attribute, carrying the estimator’s name. - Added an
attach_baselineargument topreprocess, keeping the estimated baseline as an attribute for inspection. It is removed bycorrect_rtandsubtract_blanks, whose output it would no longer match. - Added reference-wavelength subtraction to
preprocess:reference_wavelengthsremoves an offset shared by every wavelength before the baseline is estimated. - Baseline estimators now require a complete trace, and give an informative error when the signal contains missing or non-finite values. Previously a gap either caused an obscure error or had its two sides spliced together.
Retention time correction
- Added landmark parametric time warping (
alg = "lptw") tocorrect_rtandcorrect_rt_group, which fits the warp to matched peak positions rather than whole signals. See?correct_rt. - Added a
dilation_spanargument tocorrect_rt: the width, in minutes, of the moving-maximum window used to build the"vpdtw"penalty, previously hardcoded to 350 timepoints. A span wide enough to make the penalty constant now warns. -
correct_rt_groupcan now return its warping models, one per sample, withwhat = "models", for use withcorrect_peaks. -
correct_peaksnow accepts"lptw"and"vpdtw"models fromcorrect_rt, not only"ptw". - Added a
chrom_list_alignedargument tocorrect_peaks, naming aligned chromatograms for later spectrum and trace lookups.
Peak detection and integration
- Added a
min_prominence_snrargument tofind_peaks, filtering apices by topographic prominence in multiples of the estimated noise. Unlikemin_curvatureandmin_amplitudethis threshold is scale-free, so it transfers between datasets.find_peaksnow also returns aprominencecolumn. - Added manual integration of fixed retention-time windows to
get_peaksvia awindowsargument, quantifying a compound even where no peak is detected.get_peaktablegives one column per window. See?get_peaks. - Added
targets,tolandselect_byarguments toget_peaksfor fitting only the peaks near target retention times, which is faster than fitting every peak.get_peaktablegroups the result by target. See?targeted_analysis.
Fit diagnostics
- Two fit-diagnostic columns are now reported by
get_peaks:converged(flagging peaks that didn’t converge) andwindow_limited(flagging peaks whose fitted shape sits at a limit set by the integration window or the sampling interval). - Fit diagnostics can now be used for filtering:
filter_peaksgainsconvergedandwindow_limitedarguments, andfilter_peaktablegainsmin_converged. All three error onfit = "raw", which reports no fit diagnostics. -
get_peaksnow warns when more than a fifth of the peak list is integration windows too small to fit, which usually meansfind_peaksis detecting noise. Suppressed forfit = "raw"and whenwindowsis supplied.
Peak purity
- Purity estimation in
get_peaksis now much faster, so it is no longer a bottleneck. - Purity estimation now warns when a chromatogram appears to be clipped at zero, which makes peaks look less pure. Use
zero_floor = FALSE, the default in bothpreprocessandsubtract_blanks.
Peak tables and plotting
- Added
targets,tolandpadarguments toplot.peak_listfor zooming in on the peaks near given retention times, rescaling both axes to the selected window. -
plot.peak_listnow draws axes and titles each plot with its sample, wavelength and peak model. Passxaxt = "n",yaxt = "n"ormain = ""to remove them. -
plot.peak_listnow acceptsnumbers = "rt", labeling peaks with their retention times, which can be passed totargetsto zoom in on them. - Added a
whatargument toplot_chromsfor plotting one element of nested chromatograms fromread_chroms, such as"dad"or a pump pressure trace. - Added a
zlimargument toplot_chroms_heatmap, fixing the range of its color scale so that several plots can share one scale. By default the scale now spans the plotted window in every engine; previously the"ggplot"and"plotly"engines used the whole run whenxlimwas set. - Added
format = "wide"toreshape_peaktable, returning one row per sample with metadata and one column per selected peak. -
annotate_peaksnow accepts retention times through thelocargument, labeling the highest point withintolof each supplied retention time without requiring a peak table. See?annotate_peaks. -
get_peaktablenow fillssample_metawith any fields added to the chromatograms withchromConverter::add_metadata(chromConverter 0.11.0 or later). -
filter_peaksandfilter_peaktablenow record each call as code, whichprintshows for peak lists andget_peaktablestores inargs$filters. See?filter_peaks. -
get_peaktablenow records how the peaks were fitted (fit,baselineandmax_iter) inargs, and keeps anywindowsortargetsas attributes, including targets found in no sample. See?get_peaktable. -
cluster_spectranow numbers and colors each box on the dendrogram to match its spectra panel, with colors set bycol, and boxes only clusters passingmin_sizeandmax_size.
Bug fixes and other minor changes
Preprocessing and baseline correction
-
preprocessno longer fails on chromatograms with a few discontinuous wavelengths —smooth.splinerequires at least four unique values, so spectral smoothing is now skipped below four wavelengths. -
preprocessnow rejects a single-valueddim1ordim2when interpolating onto it, instead of failing later with an opaquedimnameserror. -
preprocessnow reads the time unit after unwrapping nested input, sooutlier_cutoffis scaled correctly for chromatograms supplied aslist(dad = <matrix>). -
preprocessnow ignores missing values when rescaling tomaxI. - Spectral smoothing in
preprocessnow accounts for the actual spacing of the wavelength axis rather than treating the columns as evenly spaced. Results are unchanged for evenly spaced grids, including all of the bundled data. - Corrected the documented units of
outlier_cutoffinpreprocess, which is expressed in minutes. - Corrected the documented order of operations in
preprocess: the code interpolates first, then smooths spectrally, then baselines. -
preprocess,correct_rtandget_peaksnow stop with an error when a sample fails in parallel (cl > 1). Previously they returnedtry-errororNULLelements, including for samples that had succeeded but were processed by the failing worker. - Warnings raised while processing samples in parallel (
cl > 1) now reach the user. Each distinct warning is raised once, naming the samples that raised it.
Retention time correction
-
correct_rt(alg = "vpdtw")now reproduces the alignment VPdtw fitted. Previously samples could remain misaligned when the warp extended past the end of the reference. -
correct_rtno longer misplaces peaks whenn_zeros > 0. -
correct_peaksno longer errors on models fitted bycorrect_rtwithscale = TRUEorn_zeros > 0whenchrom_listis omitted, and now gives a clear error for samples with no warping model and for peak lists built withcollapse = TRUE. -
correct_rt(models = ...)now matches models to samples by name. Previously models were applied by position, so reorderingchrom_listwarped each sample with another sample’s model. -
correct_peaksnow replaces the corrected times of an already corrected peak list. Previously it added a second set, andget_peaktablekept using the first. -
correct_rtandcorrect_rt_groupnow return achrom_listwhen given one, soplot()and chromConverter’sprintmethod still apply after alignment.
Peak detection and integration
-
get_peaksno longer inflates the areas of peaks bordering missing values, such as the padded ends of chromatograms aligned bycorrect_rt(alg = "vpdtw"), which could be several times too large. -
get_peaksnow convertssd,FWHM,tauandareacorrectly when the time axis is not in minutes.time_unitnow defaults to the chromatogram’s own unit, so default output is unchanged. -
find_peaks(bounds = TRUE)now returns its full four-column schema when no peaks are detected, rather than droppinglowerandupper. -
max_iternow controls how long the peak fitters run. Previously it was ignored, leavingnls.lm’s default of100 * (parameters + 1)evaluations."egh"and"bemg"fits may shift slightly. -
get_peaksno longer errors when a sample contains no peaks; previously a single empty sample failed the whole call.fit_peaksnow returns an emptydata.framerather than a one-row matrix ofNAs. - Printing a
peak_listno longer errors when a sample has no peaks at any wavelength, as in peak lists read bychromConverter::read_peaklist. -
FWHMis now computed as2*sqrt(2*log(2))*sigmarather than the rounded2.35*sigma. - Requesting a wavelength missing from a single-column chromatogram now errors, instead of returning the existing column falsely labeled with the requested wavelength.
-
fit = "bemg"no longer returns its starting values in place of a fit when a peak’s integration window spans about 700 timepoints or more. -
fit = "bemg"now rejects fits whose tail grows away from the apex, which inflated the reported area. Such peaks are refitted, and flaggedconverged = FALSEif the refit also fails. -
fit = "gaussian"and"egh"peaks can no longer narrow below one timepoint at half height. Previously a fit to a noise apex could collapse between two samples and report a height several times the signal around it.
Peak tables and filtering
-
get_peaktableno longer spreadspk_metaacross several columns when all peaks at a wavelength fall in one cluster. -
get_peaktableno longer roundspk_metato two decimal places, which moved retention times by up to 0.005 minutes and set smalltauvalues to zero. - Peak tables built from
correct_peaksoutput now read spectra and traces from aligned chromatograms, rebuilt from the stored warping models. Previously they were read from the unaligned data at aligned times. See?correct_peaks. -
filter_peaktableno longer appends a spuriousrtrow topk_metawhen filtering a table built from corrected peaks. -
normalize_datano longer reportscolumnas ambiguous when another column’s name merely contains it, such as"V12"for"V1". -
combine_peaksnow removes dropped peaks from theref_spectraelement so that it stays aligned withtab. -
combine_peaks(choose = "least_sparse")now keeps the peak detected in the most samples. Previously every candidate tied and the first was kept. -
filter_peaktablenow errors whenrtsis combined withmin_rtormax_rt. -
write_peaktable(what = "args")now writes a CSV that reads back. Previously arguments holding several values, such as two or more wavelengths, spilled into extra columns. -
reshape_peaktablenow keepslambdaandrtwhen peaks are renamed with a namedpeaksvector. Previously both wereNA. -
reshape_peaktablenow errors onmetadatacolumns it cannot find, which were previously dropped, and gives clear errors for unattached metadata or unknownpeaks.
Plotting
-
annotate_peaksandplot_spectrum_insetnow place labels at each peak’s maximum for tables built from corrected peaks, as for uncorrected ones. -
plot_all_spectraaxes, and the absorbance axis ofplot_spectrum’s ggplot2 and plotly traces, now show wavelength and absorbance units instead of the time unit. -
plot_all_spectranow names the returned spectra whenidxgives sample names, and errors on names not inchrom_list. -
plot_all_spectra(what = "rt")andwhat = "idx"no longer require apeak_table, and alocoutside every chromatogram now gives a clear error. -
plot.peak_table(idx = "all")no longer errors whenchrom_listis omitted, andattach_ref_spectra,mirror_plotandget_peaktable(clust = "sp")now treatchrom_list = NULLas omitted. Omittinglambdasfor multi-wavelength data inmirror_plotnow gives a clear error. -
plot_chroms(engine = "base")now extends the y axis below zero when the traces do. Previously it always started at 0, cutting off negative values. - The base-engine legend in
plot_chromsno longer covers the traces at a top or bottomlegend_position, including the default"topright"; unlessylimis set, the y axis extends to make room. -
plot_chromsnow fits the y axis to the traces withinxlimwhenylimis not given, under the"base"and"plotly"engines. Previously it spanned the whole run. -
plot_spectrum_insetnow draws spectra from the suppliedchrom_listwhenidxcovers several samples. Previously it read the peak table’s own chromatograms instead. -
plot.peak_list(numbers = TRUE)now draws each number just above its peak. Previously the numbers were drawn at arbitrary heights. -
plot.peak_listnow draws shaded peaks at the right width for peak lists built withget_peaks(time_unit = "s")or"ms". Previously they were drawn too wide. -
plot.peak_listnow acceptsxlab,ylabandtype. Previously passing any of them gave an error. -
plot.peak_listno longer fails with “subscript out of bounds” when the wavelength given toget_peaksis written differently from the chromatogram’s column name, such as"220"for"220.00000". -
plot_chromsno longer errors on single-wavelength chromatograms under the"ggplot"and"plotly"engines. A wavelength given inlambdasfor such data must now match the column name. Previously it was ignored. -
plot_chromsandreshape_chromsno longer fail withinvalid '(to - from)/by'when the sampling interval is more than twice the requestedtime_resolution. -
reshape_chromsno longer errors whenlambdasis left at itsNULLdefault, which now returns every wavelength, or whensample_varis not"sample". -
plot_chromsnow draws each wavelength as a separate line under the"ggplot"and"plotly"engines, instead of joining them into one. - The
plot.ptw_listheatmap now plots the wavelength inlambdasand puts both panels on one color scale. Previously it always used the first wavelength, the base engine showed only the warped panel, and the other engines’ legend matched only the raw panel. -
scan_chrom(export_spectrum = TRUE)now returns the spectrum instead of the scan index. -
plot.peak_tablenow warns when severallocare given but only the first is returned. -
plot_chroms_heatmap(engine = "base")now labels its color bar with the range of the plotted colors. Previously the labels came from the wrong rows and were rounded to the nearest 100, so they could all read 0.
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 are summarized within each cluster. The new default,"weighted.mean", weights peaks by intensity;"mean","median"and"max"are also available. Setsummarize_by = "mean"to reproduce previous behavior. - Added automatic thinning of chromatograms in
plot_chromsto speed up plotting of raw data, adjustable with the newtime_resolutionargument. - Changed behavior of
plot_chromsso the legend is no longer displayed by default. - When
export_spectrum == TRUE,plot_spectrumandplot_all_spectranow return spectra invisibly. - Corrected
get_peaksto return model-fitted peak heights rather than raw peak heights. This changes numerical output for workflows relying on the previous behavior. - Added
fill_zerostocorrect_rt, controlling whether out-of-bounds regions produced by warping are filled with zeros or returned asNA. Defaults toFALSE, which changes VPdtw behavior. - Changed the name of the
aparameter inplot.peak_listtoalpha. - Renamed the
chrom_listargument toxinplot_chroms_heatmap, which now also accepts a peak table in the first position. - Removed
indexandchrarguments across plotting functions, previously deprecated in v0.7.0. Useidxinstead. - Corrected
merge_peaksso the result no longer depends on the order in whichpeaksare supplied. -
get_puritynow decides which timepoints belong to a peak from the wavelength of maximum absorbance at the apex, rather than the first wavelength in the chromatogram. - Deprecated arguments in
get_peaksstill using dot notation (e.g.,sd.max). Use the snake_case equivalents instead. - Deprecated
peakargument inplot_all_spectrain favor ofloc. - Deprecated the
saveargument incluster_spectrain favor ofoutfile. - 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 when samples share batch-level shifts or contain group-specific peaks. - 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:"none"(default),"flat"or"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_peaksvia thechooseargument:"least_sparse"retains the peak detected in the most samples, and"lambda"retains the peak measured at a preferred wavelength. - 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_dataso it detects metadata and peak table columns automatically; added anon_invalidargument controlling how zero, negative andNAnormalization values are handled; and improved performance. - Refactored
ptwwarping incorrect_rtto interpolate the whole matrix at once instead of column by column. - 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
filter_peaktableandfilter_peaks:rtswith a non-zerotolmatched every peak within the tolerance rather than the nearest one, so a single requested time could select most of the table. Also, criteria are now inclusive (min_rt = 5retainsrt == 5), and peaks withNAin some samples are no longer excluded bymin_value. - 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, which caused negatively correlated spectra to be treated as similar. - Fixed bug in FWHM calculation in
get_peaktablefor raw peak shape. - Suppressed spurious “essentially perfect fit” warning from
summary.lmwhen computing R² infit_peaks. - Fixed
subset.peak_table(), wheresample_metawas subset on the wrong condition. - 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.
