Package {iSTATS}


Type: Package
Title: A Graphical Interface to Perform STOCSY Analyses on NMR Data
Version: 1.8
Date: 2026-10-09
Description: Launches a 'shiny' based application for Nuclear Magnetic Resonance (NMR) data importation and Statistical TOtal Correlation SpectroscopY (STOCSY) analyses in a full interactive approach. The theoretical background and applications of the STOCSY method are described by Cloarec, O., Dumas, M. E., Craig, A., Barton, R. H., Trygg, J., Hudson, J., Blancher, C., Gauguier, D., Lindon, J. C., Holmes, E. & Nicholson, J. (2005) <doi:10.1021/ac048630x>. Spectral alignment follows the interval correlation optimized shifting method of Savorani, F., Tomasi, G. & Engelsen, S. B. (2010) <doi:10.1016/j.jmr.2009.11.012>.
Depends: R(≥ 3.6), shinyBS(≥ 0.61), shinyWidgets(≥ 0.4.3)
Imports: data.table, ggplot2(≥ 3.0.0), gtools(≥ 3.8.1), shiny(≥ 1.6.0), stats, utils
BugReports: https://github.com/vitor-mendes-iq/iSTATS/issues
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.1
NeedsCompilation: no
License: GPL (≥ 3)
Packaged: 2026-10-10 00:21:51 UTC; keng
Author: Luiz Henrique Keng Queiroz Junior [aut, cre], Vitor Mendes de Oliveira [aut], Renan Ziemann Wilhelms [aut]
Maintainer: Luiz Henrique Keng Queiroz Junior <keng@ufg.br>
Repository: CRAN
Date/Publication: 2026-10-10 15:00:09 UTC

Matrix of NMR chemical shifts

Description

A matrix containing all chemical shifts of NMR data milk samples

Usage

CS_values_real

Format

A matrix with 11 rows and 32778 variables:


Matrix of NMR intensities

Description

A matrix containing the intensities of NMR data milk samples

Usage

NMRData

Format

A matrix with 11 rows and 32778 variables:


A list of sample names

Description

A list of sample names

Usage

file_names

Format

A list of string with sample names


A Graphical Interface to Perform STOCSY analyses on NMR Data

Description

Statistical TOtal Correlation SpectroscopY (STOCSY) is a method developed to analyze 1D Nuclear Magnetic Resonance (NMR) data, with many applications in metabolomic science, as to help the identification of molecules in complex mixture. Although STOCSY is promising method, its use requires some programming language skills. To overcome this challenge we developed the interactive STATistical Spectroscopy (iSTATS) package, based on 'shiny', in which it is possible to perform STOCSY analyses in a full interactive way, from 1D NMR matrix construction to select specifical regions to apply STOCSY methods more accurately.

Usage

iSTATS()

Value

No return value. The function is called for its side effect of launching the 'shiny' application, and returns invisibly when the application is closed.

Examples


if(interactive()){iSTATS::iSTATS()}


Align Spectra with Interval Correlation Optimized Shifting

Description

Splits spectra into intervals and rigidly shifts each interval to maximize its cross-correlation with a target. Samples must be rows and spectral points must be columns.

Usage

icoshift(xT, xP, inter = "whole", n = NULL, options = NULL, Scal = NULL)

Arguments

xT

A numeric target with one value per column of xP, or one of "average", "average2", "median", or "max". "average2" uses a fixed multiplier of 3.

xP

Numeric matrix with samples in rows and spectral points in columns.

inter

"whole"; an integer number of intervals; a character interval length or range; or a numeric vector of start/end pairs. Numeric values refer to points unless options[5] is 1.

n

Positive maximum shift, "f" for fast automatic search, or "b" for the more exhaustive search. Numeric values use points or scale units according to options[5].

options

Numeric vector or named list with show, fill, preCOShift, maxPreCOShift, useScal, and alignPreprocessed. Defaults are c(1, 1, 0, 0, 0, 0). Preprocessing values are 0 (raw), 1 (SNV), 3 (the original msc(0, A) behavior), -1, or -2 (derivatives).

Scal

Optional strictly monotonic axis with one value per column. Used for conversion when options[5] is 1; it is not modified.

Details

This implementation covers one-dimensional spectra, not MATLAB icoshiftMC. show=2 does not create the MATLAB diagnostic plot. The "b" search may be slow, overlapping intervals are not reconciled, and repeated boundary filling can create edge artifacts. Character ranges use - as separator and cannot express negative endpoints; use numeric pairs. See system.file("ICOSHIFT.md", package = "iSTATS") for the app workflow.

Value

A list containing aligned matrix xCS, interval table ints, shift indices ind (positive is left, negative is right), and actual target.

References

Savorani F, Tomasi G, Engelsen SB (2010). "icoshift: A versatile tool for the rapid alignment of 1D NMR spectra." Journal of Magnetic Resonance, 202(2), 190-202. doi:10.1016/j.jmr.2009.11.012.

Examples

axis <- seq(1, -1, length.out = 64)
target <- dnorm(seq(-3, 3, length.out = 64))
spectra <- rbind(target, c(target[-1], 0), c(0, target[-64]))

fit <- icoshift("average", spectra, c(1, 64), n = 3,
                options = c(0, 1, 0, 0, 0, 0))
dim(fit$xCS)
fit$ind

fit_ppm <- icoshift("average", spectra, c(-0.5, 0.5), n = "f",
                    options = c(0, 1, 0, 0, 1, 1), Scal = axis)