Deconvolute a Mass Spectrum from a list of raw data files.
Source:R/DeconvoluteSpectrum.R
DeconvoluteSpectrum.Rd
DeconvoluteSpectrum
will evaluate a list of `xcmsRaw` or
`xcmsRawLike` objects at a given time (rt) and potential mass (mz1). The
main purpose is to deconvolute the mass spectrum at rt including mz1.
Usage
DeconvoluteSpectrum(
dat = NULL,
rt = NULL,
rt_dev = 3,
mz1 = NULL,
mz_dev = 0.003,
use.mz.adjust = FALSE,
ionization = c("APCI", "ESI")[1],
smooth = 0
)
Arguments
- dat
A list of `xcmsRaw` or `xcmsRawLike` objects.
- rt
Retention time of the expected peak.
- rt_dev
Allowed retention time deviation.
- mz1
If specified, ensure that this mass is included in the spectrum (assumed base peak). Can be NULL otherwise in which case the most intense peak at rt will be selected as mz1.
- mz_dev
Allowed mz deviation [Da].
- use.mz.adjust
Will adjust mz on an experiment wide basis.
- ionization
Either APCI or ESI. Choice will modify some internal parameters and checks performed.
- smooth
Smoothing parameter passed on to getMultipleBPC.
Value
A pseudo spectrum at rt (containing mz1 if specified). Effectively a 2-column matrix (mz, int) with rt as attribute.
Details
The specific advantage of DeconvoluteSpectrum
is, that it does
not deconvolute signals within a single measurement file but uses correlation
tests over a set of measurements to improve statistical power. It will test
all mz around a specified rt to co-apex with some mz1, have a low rt
difference and consistent intensity ratio over all samples.
Examples
# The example measurement data provided with HiResTEC contain a peak at 1026s
raw <- HiResTEC::raw
HiResTEC::DeconvoluteSpectrum(raw, rt = 1026)
#> mz int
#> [1,] 540.2308 75861
#> [2,] 541.2324 34783
#> [3,] 542.2299 15238
#> [4,] 554.2459 3975
#> [5,] 555.2539 75198
#> [6,] 556.2631 3312706
#> [7,] 557.2637 1512582
#> [8,] 558.2617 764573
#> [9,] 559.2617 216982
#> [10,] 560.2605 53666
#> [11,] 570.2410 128202
#> [12,] 571.2431 61616
#> [13,] 572.2223 101369
#> [14,] 573.2235 42071
#> [15,] 574.2206 18551
#> [16,] 587.2433 51016
#> [17,] 588.2453 23189
#> [18,] 589.2433 11594
#> attr(,"rt")
#> [1] 1026.535