## ----doc_options, include = FALSE---------------------------------------------
knitr::opts_chunk$set(
    collapse = TRUE,
    comment = "#>"
)

## ----installation, eval=FALSE, echo=TRUE, message=FALSE-----------------------
# if (!require("BiocManager", quietly = TRUE))
#     install.packages("BiocManager")
# 
# BiocManager::install("MetaboAnnotatoR")

## ----load_package, eval=TRUE, echo=TRUE, message=FALSE------------------------
library(MetaboAnnotatoR)

## ----features, eval=TRUE, echo=TRUE, message=FALSE----------------------------
tfile <- system.file("extdata", "targetTable.csv", package="MetaboAnnotatoR")
targets <- read.csv(tfile)

## ----load_data, eval=TRUE-----------------------------------------------------
data("xset")
data("RC")

## ----libraries, eval=TRUE-----------------------------------------------------
data("LipidPos")

## ----lipid_pos_example, eval=TRUE---------------------------------------------
annotations <- annotateRC(targets, xcmsObject=xset, ramclustObj=RC, 
                            libs="LipidPos")

## ----global, eval=TRUE--------------------------------------------------------
annotations$global

## ----ranked, eval=TRUE--------------------------------------------------------
annotations$rankedResult[[3]]

## ----plot_result_spectrum, eval=TRUE------------------------------------------
plotResultSpec(annotations, 3, 1)

## ----save_results, eval=TRUE--------------------------------------------------
exampleDir <- tempdir()
saveAnnotations(annotations, DirPath=exampleDir, saveOptions=TRUE, 
                saveXCMSoptions=FALSE, saveRanked=TRUE,
                saveRankedSpec=TRUE, savePseudoMSMS=TRUE)


## ----sessionInfo--------------------------------------------------------------
sessionInfo()

