Skip to content

Commit 3162ac5

Browse files
committed
v1.37.1 - updates following removal of library spectra from msPurityData package (too large for Bioconductor) (#108)
* Use zenodo reference to library spectra * Update CI/CD * troubleshoot vignette build issue * Troubleshooting cache on github workflows * Troubleshooting cache for github workflows * more troubleshooting GH workflow cache
1 parent 58baae5 commit 3162ac5

8 files changed

Lines changed: 44 additions & 98 deletions

File tree

.github/workflows/check-bioc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ jobs:
5252
fail-fast: false
5353
matrix:
5454
config:
55-
- { os: ubuntu-latest, r: 'devel', bioc: 'devel', cont: "bioconductor/bioconductor_docker:devel", rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
55+
- { os: ubuntu-latest, r: 'devel', bioc: 'devel', cont: "bioconductor/bioconductor_docker:devel", rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest" }
5656
#- { os: macOS-latest, r: 'next', bioc: '3.19'}
57-
- { os: windows-latest, r: 'next', bioc: '3.19'}
57+
# - { os: windows-latest, r: 'next', bioc: '3.22'}
5858
## Check https://github.com/r-lib/actions/tree/master/examples
5959
## for examples using the http-user-agent
6060
env:

.travis.yml

Lines changed: 0 additions & 84 deletions
This file was deleted.

DESCRIPTION

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ Package: msPurity
22
Type: Package
33
Title: Automated Evaluation of Precursor Ion Purity for Mass Spectrometry Based
44
Fragmentation in Metabolomics
5-
Version: 1.31.1
6-
Date: 2024-05-09
5+
Version: 1.37.1
6+
Date: 2025-02-19
77
Authors@R: c(
88
person(given = "Thomas N.", family = "Lawson",
99
email = "thomas.nigel.lawson@gmail.com", role = c("aut", "cre"),
@@ -48,7 +48,8 @@ Imports:
4848
fastcluster,
4949
ggplot2,
5050
DBI,
51-
RSQLite
51+
RSQLite,
52+
BiocFileCache
5253
Suggests:
5354
MSnbase,
5455
testthat,
@@ -61,7 +62,7 @@ Suggests:
6162
RPostgres,
6263
RMySQL
6364
VignetteBuilder: knitr
64-
RoxygenNote: 7.3.1
65+
RoxygenNote: 7.3.3
6566
Roxygen: list(markdown = TRUE)
6667
biocViews: MassSpectrometry, Metabolomics, Software
6768
Collate:

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
CHANGES IN VERSION 1.37.1
2+
+ Removed library_spectra.db direct reference from msPurityData package (too large for Bioconductor)
3+
+ spectralMatching() now downloads default library database from Zenodo (https://zenodo.org/records/18700802) and uses BiocFileCache with MD5 verification
4+
+ spectral_matching() (deprecated function) now requires explicit library_db_pth parameter; default library no longer available
5+
+ Added BiocFileCache to Imports for automatic caching of remote databases
6+
17
CHANGES IN VERSION 1.30.1 / 1.31.1
28
+ Update example for purityX causing build error
39

R/msPurity.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@
2121
#'
2222
#' \href{https://bioconductor.org/packages/release/bioc/html/msPurity.html}{msPurity Bioconductor}
2323
#'
24-
#' @docType package
25-
#' @name msPurity
24+
#' @keywords internal
2625
#' @importFrom magrittr %>%
2726
#' @importFrom grDevices dev.off png
2827
#' @importFrom graphics abline legend lines plot points text
2928
#' @importFrom stats approxfun dnorm median na.omit sd
3029
#' @importFrom utils fix head packageVersion read.csv write.csv
31-
NULL
30+
"_PACKAGE"
3231

3332
## quiets concerns of R CMD check re: the .'s that appear in pipelines
3433
if(getRversion() >= "2.15.1") utils::globalVariables(c("."))

R/spectral-matching.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ spectral_matching <- function(query_db_pth, ra_thres_l=0, ra_thres_q=2, cores=1,
8484
pa=NA, xset=NA, grp_peaklist=NA, out_dir='.', ra_w=0.5, mz_w=2,
8585
spectra_type_q="scans", ra_thres_t=NA, target_db_pth=NA, rt_range=c(NA, NA), rttol=NA,
8686
match_alg='dpc'){
87-
message("Running msPurity spectral matching function for LC-MS(/MS) data")
87+
message("Running msPurity spectral matching function for LC-MS(/MS) data [this function is deprecated, please use msPurity::spectralMatching for future use]")
8888

8989
if (!is.na(ra_thres_t)){
9090
message("ra_thres_t argument has been deprecated and will be remove in future versions of msPurity,
@@ -108,7 +108,7 @@ spectral_matching <- function(query_db_pth, ra_thres_l=0, ra_thres_q=2, cores=1,
108108
}
109109

110110
if (is.na(library_db_pth)){
111-
library_db_pth <- system.file("extdata", "library_spectra", "library_spectra.db", package="msPurityData")
111+
stop("Default library database is no longer bundled. Download from https://zenodo.org/records/18700802/files/library_spectra.db?download=1 and pass via library_db_pth.")
112112
}
113113

114114

R/spectralMatching.R

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,30 @@ spectralMatching <- function(
288288

289289

290290
if (is.na(l_dbPth)){
291-
l_dbPth <- system.file("extdata", "library_spectra", "library_spectra.db", package="msPurityData")
291+
292+
bfc <- BiocFileCache::BiocFileCache(ask = FALSE)
293+
cache_name <- "msPurity_library_spectra_db"
294+
cache_url <- "https://zenodo.org/records/18700802/files/library_spectra.db?download=1"
295+
expected_md5 <- "f6a4033d376278cccfc30d1911fb2fa5"
296+
cache_hit <- BiocFileCache::bfcquery(bfc, cache_name, "rname", exact = TRUE)
297+
298+
# Prefer existing cache entry to avoid re-downloading large data.
299+
if (nrow(cache_hit) == 0){
300+
# Add to cache if not present (download occurs on first use).
301+
BiocFileCache::bfcadd(bfc, cache_name, cache_url)
302+
cache_hit <- BiocFileCache::bfcquery(bfc, cache_name, "rname", exact = TRUE)
303+
}
304+
305+
if (nrow(cache_hit) == 0){
306+
stop("Unable to create or locate BiocFileCache entry for the default library database.")
307+
}
308+
309+
rid <- cache_hit$rid[1]
310+
l_dbPth <- BiocFileCache::bfcrpath(bfc, rids = rid)
311+
actual_md5 <- tolower(unname(tools::md5sum(l_dbPth)))
312+
if (!identical(actual_md5, expected_md5)){
313+
stop("Downloaded library database failed MD5 verification.")
314+
}
292315
}
293316

294317
########################################################

man/msPurity.Rd renamed to man/msPurity-package.Rd

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)