export2xlsx function exports the data contained in an Annot object to a xlsx file.

export2xlsx(anRslt, file = NULL, summarizeHits = TRUE, overwrite = FALSE, ...)

Arguments

anRslt

Annot object with the results to export.

file

char(1) name of the resulting xlsx file

summarizeHits

boolean(1). A TRUE value summarizes the resulting excel, keeping only, for every query spectrum, the best annotation per compound.

overwrite

boolean(1) If TRUE, overwrite any existing file.

...

other arguments passed to function

Details

export2xlsx function distributes the annotation results among different worksheets of an xlsx file, one per query file, and every row corresponds to an annotation. Annotations of the same query spectrum have identical row colours. Contiguous annotations with equal query precursor mass have similar row colours (e.g. variations of orange); the best distance metric and the most common compound name among those contiguous annotations are bolded in red and black. Moreover:

  • The column massNum.QRY_CMN_REF (e.g. 7/4/5) shows the number of fragments of the query and reference spectra, and the number of fragments they have in common.

  • REFinchikey contains the inchikey of the reference compound and a link to a Pubchem's page listing compounds with that inchikey.

  • ppmPrecMass refers to the absolute difference value in ppm between query and reference precursor masses.

See also

Annot class and annotate function.

Author

Josep M. Badia josepmaria.badia@urv.cat

Examples

## 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)
#> Loading query spectra ...
#> Obtaining consensus spectra ...
#> Solving distance metrics between query and reference spectra ...
#> Processing results obtained ...
## EXPORT TO XLSX FILE--- export2xlsx(anRslt = annotResult, file = "sample", summarizeHits = FALSE, overwrite=TRUE)