Package | Version | Citation |
---|---|---|
base | 4.5.1 | R Core Team (2025) |
BiocGenerics | 0.54.0 | Huber et al. (2015) |
BiocManager | 1.30.26 | Morgan and Ramos (2025) |
BiocParallel | 1.42.1 | Morgan et al. (2025) |
BiocVersion | 3.21.1 | Morgan (2024) |
knitr | 1.50 | Xie (2014); Xie (2015); Xie (2025) |
MsBackendMgf | 1.16.0 | Gatto, Rainer, and Gibb (2025) |
pkgload | 1.4.0 | Wickham et al. (2024) |
rmarkdown | 2.29 | Xie, Allaire, and Grolemund (2018); Xie, Dervieux, and Riederer (2020); Allaire et al. (2024) |
Spectra | 1.18.2 | Rainer et al. (2022) |
testthat | 3.2.3 | Wickham (2011) |
tidytable | 0.11.2 | Fairbanks (2024) |
tidyverse | 2.0.0 | Wickham et al. (2019) |
SpectraToQueries 
Repository to translate spectra to queries.
Requirements
Here is what you minimally need:
- A file containing MS/MS spectra with associated skeleton information (or any other relevant chemical classification) provided as metadata. This structure information, stored in the metadata field “skeleton”, allows the generation of queries specific to a given skeleton by extracting repetitive skeleton-specific fragmentation patterns. The MIADB file is provided as an example.
Installation
As the package is not (yet) available on CRAN, you will need to install with:
install.packages(
"SpectraToQueries",
repos = c(
"https://spectra-to-knowledge.r-universe.dev",
"https://bioc.r-universe.dev",
"https://cloud.r-project.org"
) )
Use
To reproduce the example that uses the Monoterpene Indole Alkaloids Database (.mgf) file by default, which includes the annotation of spectral skeletons:
::spectra_to_queries() SpectraToQueries
To reproduce the “grouped” example that uses the MIADB file, which includes an expert-based annotation of spectral “super skeletons” (combination of skeletons exhibiting a high structural similarity):
::spectra_to_queries(
SpectraToQueriesspectra = system.file(
"extdata",
"spectra_grouped.rds",
package = "SpectraToQueries"
),export = "data/interim/queries-grouped.tsv"
)
To generate diagnostic ions queries from your spectra:
::spectra_to_queries(
SpectraToQueriesspectra = "yourAwesomeSpectra.mgf",
export = "path/yourEvenBetterResults.tsv"
)
Showing all parameters:
::spectra_to_queries(
SpectraToQueriesspectra = NULL,
export = "data/interim/queries.tsv",
beta_1 = 1.0,
beta_2 = 0.5,
dalton = 0.01,
decimals = 4L,
intensity_min = 0.0,
ions_max = 10L,
n_skel_min = 5L,
n_spec_min = 3L,
ppm = 30.0,
fscore_min = 0.0,
precision_min = 0.0,
recall_min = 0.0,
zero_val = 0.0
)
Main Citations
Translating community-wide spectral library into actionable chemical knowledge: a proof of concept with monoterpene indole alkaloids: https://doi.org/10.1186/s13321-025-01009-0