Description Usage Arguments Details Value Note Author(s) References Examples
The 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.
1 2 3 4 5 6 7 8 9 10 | 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)
|
df |
A dataframe with at least the columns |
noise |
The noise cutoff. A peak is not included if the maximum stick intensity of the peak is below the noise cutoff. |
method |
"deprofile.fwhm" for full-width half-maximum or "deprofile.localMax" for local maximum. |
... |
Arguments to the workhorse functions |
scan |
A matrix with 2 columns for m/z and intensity; from profile-mode high-resolution data. Corresponds to the spectra obtained with xcms::getScan or mzR::peaks. |
colnames |
For deprofile.scan: return matrix with column names (xcms-style,
|
cut |
A parameter for |
minPts |
The minimal points count in a peak to build a spline; for peaks with less points the local maximum will be used instead. Note: The minimum value is 4! |
step |
The interpolation step for the calculated spline, which limits the maximum precision which can be achieved. |
The 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.
deprofile.scan
: a matrix with 2 columns for m/z and intensity
Known limitations: If the absolute leftmost stick or the absolute rightmost stick in a scan are maxima, they will be discarded! However, I don't think this will ever present a practical problem.
Michael Stravs, Eawag <michael.stravs@eawag.ch>
mzMine source code http://sourceforge.net/svn/?group_id=139835
1 2 3 4 5 6 7 8 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.