| Package | Version | Citation |
|---|---|---|
| base | 4.5.2 | R Core Team (2025) |
| BiocManager | 1.30.27 | Morgan and Ramos (2025) |
| BiocParallel | 1.44.0 | Wang et al. (2025) |
| BiocVersion | 3.22.0 | Morgan (2025) |
| knitr | 1.50 | Xie (2014); Xie (2015); Xie (2025) |
| MsBackendMgf | 1.18.0 | Gatto, Rainer, and Gibb (2025) |
| pkgload | 1.4.1 | Wickham et al. (2025) |
| progress | 1.2.3 | Csárdi and FitzJohn (2023) |
| rmarkdown | 2.30 | Xie, Allaire, and Grolemund (2018); Xie, Dervieux, and Riederer (2020); Allaire et al. (2025) |
| Spectra | 1.19.11 | Rainer et al. (2022) |
| testthat | 3.3.1 | 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:
SpectraToQueries::spectra_to_queries()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):
SpectraToQueries::spectra_to_queries(
spectra = system.file(
"extdata",
"spectra_grouped.rds",
package = "SpectraToQueries"
),
export = "data/interim/queries-grouped.tsv"
)To generate diagnostic ions queries from your spectra:
SpectraToQueries::spectra_to_queries(
spectra = "yourAwesomeSpectra.mgf",
export = "path/yourEvenBetterResults.tsv"
)Showing all parameters:
SpectraToQueries::spectra_to_queries(
spectra = 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
