Description Usage Arguments Details Value Warning Warning See Also Examples
Generates a candidate list of isotopic peak patterns present in a protein mass spectrum. This is achieved by matching templates calculated according to the so-called Averagine model to the raw spectrum using either non-negative least squares (ls) or non-negative least absolute deviation (lad) estimation. The presence of multiple charge states is supported. In particular, the approach is capable of deconvolving overlapping patterns. The method can be applied with two different kind of peak shapes, Gaussians and Exponentially Modified Gaussians (EMG).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | getPeaklist(mz, intensities, model = c("Gaussian", "EMG"),
model.parameters = list(alpha = function(){},
sigma = function(){},
mu = function(){}),
averagine.table = NULL,
loss = c("L2", "L1"), binning = FALSE,
postprocessing = TRUE, trace = TRUE, returnbasis = TRUE,
control.basis = list(charges = c(1,2,3,4),
eps = 1e-05),
control.localnoise = list(quantile = 0.5,
factor.place = 1.5,
factor.post = 0,
window = NULL,
subtract = FALSE),
control.postprocessing = list(mzfilter = FALSE,
prune = FALSE,
factor.prune = NULL,
ppm = NULL,
goodnessoffit = FALSE),
control.binning = list(tol = 0.01))
|
mz |
A |
intensities |
A |
model |
Basic model for the shape of a single peak. Must be
|
averagine.table |
If |
loss |
The loss function to be used. The choice |
model.parameters |
A list of functions with precisely one
argument representing |
binning |
A |
postprocessing |
A |
trace |
A |
returnbasis |
A |
control.basis |
A list of arguments controlling the computation of the matrix of basis functions:
|
control.localnoise |
A list of arguments controlling the placement and selection of basis functions on the basis of a 'local noise level':
|
control.postprocessing |
A list of arguments controlling the
postprocessing step (provided
|
control.binning |
Controls the division of the spectrum into bins
(if |
While setting binning = TRUE
yields a procedure which
is less memory consuming than fitting the whole
spectrum simultaneously (binning = FALSE
), it may be inferior from a quality aspect, since division
into bins has to be done with care. Otherwise, peak patterns might be
split up into different bins, which would result into erroneous
fitting.
Postprocessing of the raw list usually yields a considerably improved result by counteracting the 'peak-splitting phenomenon': due to a limited sampling rate and discrepancies between theoretical and observed peak patterns, several templates at adjacent positions are used to fit the same peak pattern.
An object of class peaklist.
Although we have tried to choose default values expected to produce sensible results, the user should carefully examine all options.
Depending on the length and the resolution of the raw spectrum, fitting the whole spectrum simultaneously as recommended is expensive from a computational point of view, and may take up to several minutes per spectrum.
fitModelParameters, peaklist
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | ### load data
data(toyspectrum)
data(toyspectrumsolution)
mz <- toyspectrum[,"x"]
intensities <- toyspectrum[,"yyy"]
### select mz range
filter <- mz >= 2800 & mz <= 3200
### Extract peak patterns with model = "Gaussian"
sigmafun <- function (mz) -8.5e-07 * mz + 6.09e-10 * mz^2 + 0.00076
gausslist <- getPeaklist(mz = mz[filter], intensities = intensities[filter],
model = "Gaussian",
model.parameters = list(sigma = sigmafun,
alpha = function(mz){},
mu = function(mz){}),
control.localnoise = list(quantile = 0.5, factor.place = 3))
show(gausslist)
### threshold list at signal-to-noise ratio = 2
peaklist <- threshold(gausslist, threshold = 2)
### Extract peak patterns with model = "EMG" and loss = "L1"
alpha0 <- function(mz) 0.00001875 * 0.5 * 4/3 * mz
sigma0 <- function(mz) 0.00001875 * 0.5 * mz
mu0 <- function(mz) return(rep(-0.06162891, length(mz)))
EMGlist <- getPeaklist(mz = mz[filter], intensities = intensities[filter],
model = "EMG", loss = "L1",
model.parameters = list(sigma = sigma0,
alpha = alpha0,
mu = mu0),
control.localnoise = list(quantile = 0.5, factor.place = 3))
show(EMGlist)
peaklist2 <- threshold(EMGlist, threshold = 2)
### plot results of the 1st list and compare vs. 'truth'
### 'ground truth'
solution <- toyspectrumsolution[toyspectrumsolution[,1] >= 2800 & toyspectrumsolution[,1] <= 3200,]
visualize(gausslist, mz[filter], intensities[filter], lower = 3150, upper = 3170,
truth = TRUE,
signal = TRUE,
fitted = TRUE,
postprocessed = TRUE,
booktrue = as.matrix(toyspectrumsolution),
cutoff.eps = 0.2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.