Bins the per-spectrum signal vector left-to-right into chunks of
maxCombine chemical-shift columns and returns the per-bin sums as
a feature matrix. Columns whose chemical-shift falls inside any
igrs interval are removed before binning.
Accepts three input types:
spectra: usesx[[i]]$sidirectly.decons2: usesx[[i]]$sit$sup(smoothed reconstruction).aligns: builds a sparse vector fromlcpar$pcial/lcpar$A * pi, then bins.
Suitable as the feat_fun argument of fit_mdm() for
binning baselines.
Usage
bin(x, maxCombine = 128, igrs = list(), peakPos = NULL, ...)Arguments
- x
A
spectra,decons2oralignsobject.- maxCombine
Bin width in chemical-shift columns.
- igrs
List of two-element ppm intervals to ignore.
- peakPos
Optional integer column indices for predict mode; when
NULLthe non-zero bins are kept and attached asattr(., "peakPos").- ...
Ignored (protocol compatibility with peak_mat).
Examples
decons <- deconvolute(sim[1:3], sfr=c(3.55, 3.35), verbose=FALSE)
X <- bin(decons, maxCombine=50)