| icoshift | R Documentation |
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.
icoshift(xT, xP, inter = "whole", n = NULL, options = NULL, Scal = NULL)
xT |
A numeric target with one value per column of |
xP |
Numeric matrix with samples in rows and spectral points in columns. |
inter |
|
n |
Positive maximum shift, |
options |
Numeric vector or named list with |
Scal |
Optional strictly monotonic axis with one value per column. Used
for conversion when |
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.
A list containing aligned matrix xCS, interval table ints, shift
indices ind (positive is left, negative is right), and actual
target.
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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jmr.2009.11.012")}.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.