Skip to content

Instantly share code, notes, and snippets.

View jorainer's full-sized avatar

Johannes Rainer jorainer

View GitHub Profile
@jorainer
jorainer / MetaboAnnotationMassBank.R
Created September 21, 2022 08:11
Match experimental fragment spectra against MassBank
library(MetaboAnnotation)
## Get access to MassBank 2022.06
ref <- MassBankSource("2022.06")
## Compare experimental spectra (qry Spectra object)
## against that reference
res <- matchSpectra(qry, ref, CompareSpectraParam(ppm = 20))
@jorainer
jorainer / MassBankAnnotationHub.R
Created September 21, 2022 07:41
Query and list MassBank releases from Bioconductor's AnnotationHub
library(AnnotationHub)
ah <- AnnotationHub()
## List available releases
query(ah, "MassBank")
## Download one specific release
mb <- ah[["AH107049"]]
## Access using Spectra