diff --git a/DESCRIPTION b/DESCRIPTION index 811e90ab..9cba15a2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: xcms -Version: 4.5.0 +Version: 4.5.1 Title: LC-MS and GC-MS Data Analysis Description: Framework for processing and visualization of chromatographically separated and single-spectra mass spectral data. Imports from AIA/ANDI NetCDF, diff --git a/NEWS.md b/NEWS.md index 536bc58e..af48a5a1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,15 @@ -# xcms 4.3 +# xcms 4.5 + +## Changes in version 4.5.1 + +- Small update to `featureSpectra()` and `chromPeakSpectra()` to allow addition + of `chromPeaks()` and `featuresDefinitions()` columns to be added to the + `Spectra` output. +- Tidied the `xcms` vignette, to order the filtering of features and remove + the outdated normalisation paragraph.In depth discussion on this subject can + be found on `metabonaut`. + +# 4.3 ## Changes in version 4.3.4 @@ -7,8 +18,6 @@ - Small fix to the .yml file for the github actions, so they do not crash on warnings. - - ## Changes in version 4.3.3 - Fix issue #755: `chromatogram()` with `msLevel = 2` fails to extract diff --git a/R/XcmsExperiment-functions.R b/R/XcmsExperiment-functions.R index 5ffe1766..0fbf9adc 100644 --- a/R/XcmsExperiment-functions.R +++ b/R/XcmsExperiment-functions.R @@ -823,7 +823,7 @@ split(spectra(x), factor(fromFile(x), levels = levels(f))), FUN = function(pk, sp, msLevel, method, addColumnsChromPeaks, addColumnsChromPeaksPrefix) { - sp <- Spectra::filterMsLevel(sp, msLevel) + sp <- filterMsLevel(sp, msLevel) idx <- switch( method, all = .spectra_index_list(sp, pk, msLevel), @@ -833,8 +833,9 @@ largest_bpi = .spectra_index_list_largest_bpi(sp, pk, msLevel)) ids <- rep(rownames(pk), lengths(idx)) res <- sp[unlist(idx)] - pk_data <- pk[ids, addColumnsChromPeaks, drop = FALSE] - pk_data <- cbind(pk_data, id = ids) + pk_data <- as.data.frame(pk[ids, addColumnsChromPeaks, + drop = FALSE]) + pk_data$id <- ids colnames(pk_data) <- paste0(addColumnsChromPeaksPrefix, colnames(pk_data)) res <- .add_spectra_data(res, pk_data)