Annot | R Documentation |
'Annot' object structures the annotation results returned by the
annotate
function. It contains reference spectra (with
metadata) along with their reference compound metadata, the query spectra
(with metadata), and a hits table linking all three items; the hits table
also contains the distance metrics and other Variables that may define a hit
(e.g. adduct assumed on the query spectrum).
An Annot
object is created internally by the annotate
function, but its content can be accessed externally by using:
Getters of the object. See next section
MS2IDgui
function: A GUI interface that browses visually the Annot content.
export2xlsx
function: Export all the data to an xlsx file.
More info in the corresponding vignette.
## S4 method for signature 'Annot'
refCompound(x)
## S4 method for signature 'Annot'
qrySpectra(x)
## S4 method for signature 'Annot'
refSpectra(x)
## S4 method for signature 'Annot'
hits(x)
## S4 method for signature 'Annot'
infoAnnotation(x)
## S4 method for signature 'Annot'
show(object)
x |
character: signature supported |
object |
character: signature supported |
To obtain the content of any Annot's slot, please use the following methods
hits: returns a cross-reference dataframe containing the hits along with their proposed adducts and common masses.
qrySpectra(object): returns a Spectra
object
\insertCiteSpectraMS2ID containing the query spectra with hits.
refSpectra(object): returns a Spectra
object with
successful reference spectra.
refCompound(object): returns a dataframe containing (reference) compound metadata of successful reference spectra.
infoAnnotation(object): returns the variables used on the annotation process
Josep M. Badia josepmaria.badia@urv.cat
SpectraMS2ID
annotate
function, and post annotation tools
MS2IDgui
and export2xlsx
.
## LOAD MS2ID LIBRARY ---
## Decompress the MS2ID library that comes with MS2ID
MS2IDzipFile <- system.file("extdata/MS2IDLibrary.zip",
package = "MS2ID",
mustWork = TRUE)
library(utils)
MS2IDFolder <- dirname(unzip(MS2IDzipFile,
exdir = tempdir()))[1]
## SELECT QUERY SPECTRA ---
## Decompress the query mzML files that come with MS2ID
queryFile <- system.file("extdata/QRYspectra.zip",
package = "MS2ID",
mustWork = TRUE)
queryFolder <- file.path(tempdir(), "QRYspectra")
library(utils)
unzip(queryFile, exdir = queryFolder)
## ANNOTATION ---
library(MS2ID)
MS2IDlib <- MS2ID(MS2IDFolder)
annotResult <- annotate(QRYdata = queryFolder, MS2ID = MS2IDlib)
## ANNOTATION HANDLING---
#merge hits and compound info
result <- merge(x = hits(annotResult), y = refCompound(annotResult),
by.x = "idREFcomp", by.y = "id", all.y = FALSE)
#Subset spectra and metadata considering first hit query spectra
library(Spectra)
idQRYspect_1 <- result$idQRYspect[1]
result_1 <- dplyr::filter(result, idQRYspect == idQRYspect_1)
qrySpct_1 <- qrySpectra(annotResult)
qrySpct_1 <- qrySpct_1[qrySpct_1$id %in% result_1$idQRYspect]
refSpct_1 <- refSpectra(annotResult)
refSpct_1 <- refSpct_1[refSpct_1$id %in% result_1$idREFspect]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.