NEWS.md
base graphics, ggplot2 or plotly graphics:
plotScoresplotScreeBoth of these functions are actually in ChemoSpecUtils and called on behalf of the user when needed.
ggplot2 graphics output are generally similar in layout and spirit to the base graphics output, but significant improvements have been made in labeling data points using the ggrepel package. And of course the ggplot2 graphics can be modified after creation through the usual mechanisms.plotly graphics output are interactive plots which can be used for better understanding the data. plotly provides tools such as zoom, interactive labels and custom positioning which are very useful.options(ChemoSpecGraphics = "option").?GraphicsOptions.Btotxt added to import2DSpectra, allowing import of 2D data exported by the Bruker command “totxt”.dx added to import2DSpectra for use with JCAMP-DX files, via package readJDX which has recently learned how to import 2D NMR data sets.F1F2RI-F1decF2dec2 added to import2DSpectra which handles the import of JEOL spectra exported as “generic ascii”.files2Spectra2DObject gains a new argument allowSloppy. This will allow one to import data sets that do not have the same dimensions. The intent here is to deal with data sets where the number of points in each dimension is similar but not identical. This is an experimental feature, and additional functions will be needed to handle this kind of data. See the documentation for details.files2Spectra2DObject gains a progress bar and will now accept a path and other arguments to list.files, bringing it in line with ChemoSpec::files2SpectraObject.normSpectra2D gets a new method to scale spectra on [-1 … 1].hats_alignSpectra2D gains new arguments dist_method and maximize which allows the user to pass their choice of distance measure through to the objective function used to evaluate the overlap of the spectra. This greatly improves the quality of the alignment. See the documentation for additional details.computeVolume added to aid in normalizing spectra to particular chemical shift regions, which are volumes when the intensity is taken into account.LofL and LofC, added to assist with overlaying multiple spectra in plotSpectra2D. LofL = “List of Levels” and LofC = “List of Colors.”colorspace package. The color-handling infrastructure was also changed to allow easy introduction of different color schemes in the future, though the user cannot yet make changes on the fly.inspectLvls simplified and arguments changed; one can now inspect just a single spectrum or a range of spectra.calcLvls rebuilt to be more consistent and logical. Values will change slightly from previous values.plotSpectra2D when user specifies xlim and/or ylim is much more robust. Function .computeTicks was removed as it was no longer needed.plotSlice similarly made more robust.import2Dspectra cleaned up (documentation and code).pfacSpectra2D now allows control of the number of cores in use when using parallel processing. This is to avoid multiple processes on the same shared machine each trying to use all the cores for themselves. Per suggestion by Henrik Bengtsson on Twitter.inspectLvls was not playing nice when argument which was a vector..mapColors in which NA could be returned as a color, which results in an unexpected black contour. Now removes NA and gives a warning that the requested levels are beyond the range of the data.updateGroups which has been in ChemoSpecUtils for a while but effectively hidden from users of ChemoSpec2D.roxygen2 warnings.tinytest.robustbase from suggests (not needed)..makeArray gains a unit test..rescale rebuilt to be more flexible.plotScores was fixed. This was a long standing bug that somehow escaped notice, dating to the early days of ChemoSpec. Note that plotScores is actually in ChemoSpecUtils but is called from ChemoSpec2D, affecting the results here.class(mia) were plotting the eigenvalues instead of the percent variance explained.class(mia) was incorrect and gave a rotated version of the correct result.hats_alignSpectra2D was added, along with a number of supporting functions.conColScheme has moved to ChemoSpecUtils and can now also handle Spectra2D objects. It is also now more user friendly.shiftSpectra2D added to permit manual shifting.centscaleSpectra2D gains the ability to scale by log or log10.popSpectra2D computes “plain old PCA” on a Spectra2D data set, using the IRLBA algorithm. The data is unstacked before PCA.pfacSpectra2D now has a nfac as an argument; previously the user was warned to provide it. This is clearer, more user-friendly and more consistent with other functions.ChemoSpecUtils and ChemoSpec which introduce more PCA variants.miaLoadings, popLoadings (never publically released), and pfacLoadings were collapsed into plotLoadings2D.chkSpectra.files2Spectra2DObject is now careful to remove any dimnames of the imported matrices, to avoid causing a ruckus with chkSpectra.miaLoadings and pfacLoadings were incorrectly reordering their matrices.inspectLvls was not excluding any loading matrices when loading = NULL.miaLoadings and pfacLoadings now check to see if the requested loading has already been computed, and if so, it is not computed again. Loadings are named Loading_x in the Spectra2D object. These functions also gain a plot argument so that plots can be suppressed if desired. These changes were made for dealing with large data sets which can occupy a lot of memory and slow down the computation of the contours. Using plot = FALSE allows one to compute the loadings and then figure out desirable contour levels before running with plot = TRUE.pfacSpectra2D gains an argument setup. If TRUE and parallel = TRUE the parallel computational environment is automatically configured for the user. If FALSE the user is responsible for setting up the environment. This is useful if working on Azure or AWS EC2.plotSpectra2D now accepts xlim and ylim.plotSpectra2D now chosen via pretty() and are easier to interpret.plotSpectra2D gains an option for a grid aligned with the ticks.ChemoSpecUtils::.chkArgs.groupNcolor moved to non-exported functions, and re-named to .groupNcolors.import2Dspectra extensively reworked to fix problems and allow for easy expansion in the future.files2Spectra2DObject tweaked a bit.centscaleSpectra2D and now centers and optionally scales the data.removePeaks2D.removePeaks2D (part of the problem was in .findNA).