deprofile
functions convert profile-mode high-resolution input data to "centroid"-mode
data amenable to i.e. centWave. This is done using full-width, half-height algorithm, spline
algorithm or local maximum method.
deprofile.scan(scan, noise = NA, method = "deprofile.fwhm",
colnames = TRUE, ...)
deprofile(df, noise, method, ...)
deprofile.fwhm(df, noise = NA, cut = 0.5)
deprofile.localMax(df, noise = NA)
deprofile.spline(df, noise=NA, minPts = 5, step = 0.00001)
mz
and int
to perform deprofiling on.deprofile.fwhm
etc.TRUE
, default) or plain (mzR-style, FALSE
).deprofile.fwhm
indicating where the peak flanks should be taken. Standard is 0.5
(as the algorithm name says, at half maximum.) Setting cut = 0.75
would instead determine the peak
width at 3/4 maximum, which might give a better accuracy for merged peaks, but could be less accurate
if too few data points are present.deprofile.scan
: a matrix with 2 columns for m/z and intensity
deprofile.fwhm
method is basically an R-semantic version of the "Exact Mass" m/z deprofiler
from MZmine. It takes the center between the m/z values at half-maximum intensity for the exact peak mass.
The logic is stolen verbatim from the Java MZmine algorithm, but it has been rewritten to use the fast
R vector operations instead of loops wherever possible. It's slower than the Java implementation, but
still decently fast IMO. Using matrices instead of the data frame would be more memory-efficient
and also faster, probably.The deprofile.localMax
method uses local maxima and is probably the same used by e.g. Xcalibur.
For well-formed peaks, "deprofile.fwhm" gives more accurate mass results; for some applications,
deprofile.localMax
might be better (e.g. for fine isotopic structure peaks which are
not separated by a valley and also not at half maximum.) For MS2 peaks, which have no isotopes,
deprofile.fwhm
is probably the better choice generally.
deprofile.spline
calculates the mass using a cubic spline, as the HiRes peak detection
in OpenMS does.
The word "centroid" is used for convenience to denote not-profile-mode data. The data points are NOT mathematical centroids; we would like to have a better word for it.
The noise
parameter was only included for completeness, I personally don't use it.
deprofile.fwhm
and deprofile.localMax
are the workhorses;
deprofile.scan
takes a 2-column scan as input.
deprofile
dispatches the call to the appropriate worker method.
## Not run:
# mzrFile <- openMSfile("myfile.mzML")
# acqNo <- xraw@acquisitionNum[[50]]
# scan.mzML.profile <- mzR::peaks(mzrFile, acqNo)
# scan.mzML <- deprofile.scan(scan.mzML.profile)
# close(mzrFile)
# ## End(Not run)
Run the code above in your browser using DataLab