Description Usage Arguments Value Examples
View source: R/accessory_functions.R
As accessing S4 objects within lists is not trivial, getSpectrum
can
be used to access individual or several MS2spectrum
objects by their slot entries.
1 | getSpectrum(featlist, slot, what, mz.tol = 1e-05, rt.tol = 30)
|
featlist |
a list that contains only objects of class
|
slot |
The slot to be searched (invalid slot arguments will produce errors). Possible values are:
|
what |
the search term or number, must be character for |
mz.tol |
the tolerance used for precursor ion *m/z* searches, defaults
to |
rt.tol |
the tolerance used for precursor ion retention time searches, defaults to 30s; high values can be used to specify retention time ranges (see vignette for example) |
If the only one spectrum matches the search criteria, the output is
an object of class MS2spectrum
; if more than one
spectrum matches, the output is a list of MS2spectrum
objects.
1 2 3 4 5 6 7 8 9 10 11 | load(file = system.file("extdata",
"annotatedSpeclist.RData",
package = "CluMSIDdata"))
getSpectrum(annotatedSpeclist, "annotation", "pyocyanin")
getSpectrum(annotatedSpeclist, "id", "M244.17T796.4")
getSpectrum(annotatedSpeclist, "precursor", 286.18, mz.tol = 1E-03)
six_eight <- getSpectrum(annotatedSpeclist, "rt", 420, rt.tol = 60)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.