- Courtesy GSOC and Tejasvi Gupta, the following plotting functions gain the ability to produce either
base
graphics,ggplot2
orplotly
graphics:plotScores
plotScree
Both of these functions are actually in ChemoSpecUtils
and called on behalf of the user when needed.
- The
ggplot2
graphics output are generally similar in layout and spirit to thebase
graphics output, but significant improvements have been made in labeling data points using theggrepel
package. And of course theggplot2
graphics can be modified after creation through the usual mechanisms. - The
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. - The graphics output options can be chosen by
options(ChemoSpecGraphics = "option")
. - See the details in new help file
?GraphicsOptions
.
- Functions with the
leg.loc
argument now allow much more flexibility with regard to how the legend is positioned. See the documentation.
- Documentation of
...
insumSpectra
corrected to show how to passtol
tocheck4Gaps
. - Option to use
Col7
a palette of 7 colorblind-friendly colors added tofiles2Spectra2DObject
documentation.
- Checked against
R
4.1 RC
- Documentation (
pkgdown
site) is now automated via CI. - Build & check via CI now active.
- Reporting of shifts from
hats_alignSpectra2D
has been corrected. Only the reporting was foobar'ed. The alignment worked fine. Defaults for plots also improved.
- Format
Btotxt
added toimport2DSpectra
, allowing import of 2D data exported by the Bruker command "totxt". - Format
dx
added toimport2DSpectra
for use with JCAMP-DX files, via packagereadJDX
which has recently learned how to import 2D NMR data sets. - Format
F1F2RI-F1decF2dec2
added toimport2DSpectra
which handles the import of JEOL spectra exported as "generic ascii". files2Spectra2DObject
gains a new argumentallowSloppy
. 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 tolist.files
, bringing it in line withChemoSpec::files2SpectraObject
.
- Function
normSpectra2D
gets a new method to scale spectra on [-1 ... 1]. - Function
hats_alignSpectra2D
gains new argumentsdist_method
andmaximize
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.
- New function
computeVolume
added to aid in normalizing spectra to particular chemical shift regions, which are volumes when the intensity is taken into account. - Two new convenience functions,
LofL
andLofC
, added to assist with overlaying multiple spectra inplotSpectra2D
.LofL
= "List of Levels" andLofC
= "List of Colors."
- The basic color scheme for contours was updated to use a perceptually consistent low/blue -> high/red scheme, based on the principles in the
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.- Function
calcLvls
rebuilt to be more consistent and logical. Values will change slightly from previous values.
- Tick positions for
plotSpectra2D
when user specifiesxlim
and/orylim
is much more robust. Function.computeTicks
was removed as it was no longer needed. - Tick positions for
plotSlice
similarly made more robust. - Format options in
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 argumentwhich
was a vector.- Fixed a problem with
.mapColors
in whichNA
could be returned as a color, which results in an unexpected black contour. Now removesNA
and gives a warning that the requested levels are beyond the range of the data.
- New color and symbol schemes for the groups are now provided for use during the import process.
- Documentation updates and improvement.
- Added documentation for
updateGroups
which has been inChemoSpecUtils
for a while but effectively hidden from users ofChemoSpec2D
. - Cleaned up some
roxygen2
warnings. - Unit test framework converted to
tinytest
. - Removed
robustbase
from suggests (not needed). .makeArray
gains a unit test.- Function
.rescale
rebuilt to be more flexible.
- An issue with the setting of x and y limits in
plotScores
was fixed. This was a long standing bug that somehow escaped notice, dating to the early days ofChemoSpec
. Note thatplotScores
is actually inChemoSpecUtils
but is called fromChemoSpec2D
, affecting the results here. - Scree plots for
class(mia)
were plotting the eigenvalues instead of the percent variance explained. - The computation of the loading pseudo-spectrum for
class(mia)
was incorrect and gave a rotated version of the correct result.
- A function to align spectra,
hats_alignSpectra2D
was added, along with a number of supporting functions. conColScheme
has moved toChemoSpecUtils
and can now also handleSpectra2D
objects. It is also now more user friendly.- New function
shiftSpectra2D
added to permit manual shifting. centscaleSpectra2D
gains the ability to scale by log or log10.
- Data set
MUD1
was completely rebuilt. - New data set
MUD2
added, for purposes of testing alignment algorithms.
centscaleSpectra2D
defaults have changed.
- Documentation
colorSymbol
was moved to packageChemoSpecUtils
. - Unit testing framework changed to
tinytest
. normSpectra2D
now checks the input method as a valid choice.
- New function
popSpectra2D
computes "plain old PCA" on aSpectra2D
data set, using the IRLBA algorithm. The data is unstacked before PCA.
pfacSpectra2D
now has anfac
as an argument; previously the user was warned to provide it. This is clearer, more user-friendly and more consistent with other functions.- Small changes to several functions to work more consistently with changes in
ChemoSpecUtils
andChemoSpec
which introduce more PCA variants. miaLoadings
,popLoadings
(never publically released), andpfacLoadings
were collapsed intoplotLoadings2D
.- Improved reporting in
chkSpectra
. - NAMESPACE cleaned up a bit.
files2Spectra2DObject
is now careful to remove any dimnames of the imported matrices, to avoid causing a ruckus withchkSpectra
.
toChemoSpec
was removed aspopSpectra2D
provides a complete workflow corresponding to unstacking, computing PCA and reassembling the loadings.
- Both
miaLoadings
andpfacLoadings
were incorrectly reordering their matrices. inspectLvls
was not excluding any loading matrices whenloading = NULL
.
miaLoadings
andpfacLoadings
now check to see if the requested loading has already been computed, and if so, it is not computed again. Loadings are namedLoading_x
in theSpectra2D
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. Usingplot = FALSE
allows one to compute the loadings and then figure out desirable contour levels before running withplot = TRUE
.pfacSpectra2D
gains an argumentsetup
. IfTRUE
andparallel = TRUE
the parallel computational environment is automatically configured for the user. IfFALSE
the user is responsible for setting up the environment. This is useful if working on Azure or AWS EC2.
- Function
plotSlice
added.
- Function
showScale
now opens a pdf document showing the scale used withplotSpectra2D
. - Improved error message from
inspectLvls
. - Numerous documentation improvements, including vignette.
- Improved examples.
- Test and demo data set
MUD1
rebuilt.
- Internal function .computeTicks was not detecting discontinuities in a robust manner.
- First release to CRAN!
plotSpectra2D
now acceptsxlim
andylim
.- Ticks in
plotSpectra2D
now chosen viapretty()
and are easier to interpret. plotSpectra2D
gains an option for a grid aligned with the ticks.
- Consistent argument checking implemented via
ChemoSpecUtils::.chkArgs
.
hcaScores
added viaChemoSpecUtils
.
- Checked against devel version of
ChemoSpecUtils
.
- Ellipses in score plots working.
- Improved documentation.
- Modifications to work with
ChemoSpecUtils
.
- Added function
plotScree
, which works withmiaSpectra2D
. - Added
miaLoadings
.
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.- centerSpectra2D becomes
centscaleSpectra2D
and now centers and optionally scales the data.
- Vignette updated.
- Modified
plotSpectra2D
so that it will plot more than one spectrum.
- Added unit tests for
.findNA
. - Setting up unit tests for
.findNA
led to code clean up (better variable names and code notes). - Added unit tests for
centerSpectra2D
. - Added unit tests for
chkSpectra2D
.
pfacLoadings
now returns the modifiedSpectra2D
object, not the loadings matrix.inspectLvls
can now access the loadings matrix, if present, in aSpectra2D
object.
- A simple means of drawing a separate scale/legend for the contour plots was added.
- An error in the construction of the data cube / array in
pfacSpectra2D
was fixed. This task is now handled by helper function.makeArray
since it is also required bycenterSpectra2D
.
pfacLoadings
simplified, and some logical errors fixed.
MUD1
gains some negative peaks for more comprehensive graphical tests..mapColors
overhauled..plotEngine
overhauled..normAroundZero
overhauled, and renamed to.symAroundZero
.- Added convenience function
inspectLvls
to allow quick selection of levels.
- Added
centerSpectra2D
function.
- Improved
MUD1
test data set.
- Fixed incorrectly reversed F1 frequency removal in
removePeaks2D
. - Fixed a problem with where the gray "no data" lines were drawn in
removePeaks2D
(part of the problem was in.findNA
).
sumSpectra2D
now reports the number of data points in F2 and the number of slices in F1.chkSpectra2D
does a better job of checking and reporting about extra data.
- Lots of documentation polishing.
- Rebuilt under latest R and updated packages.
- Package development begins with a port of relevant
ChemoSpec
materials. - No NEWS entries until we have an initial framework in decent shape.