From e60632246d2c68a5a1b4ed2c0d7ec260b604bbc5 Mon Sep 17 00:00:00 2001 From: jorainer Date: Fri, 23 Feb 2024 11:17:50 +0100 Subject: [PATCH] fix: fix bug in `filterFeatures,PercentMissingFilter` --- DESCRIPTION | 2 +- R/method-filterFeatures.R | 4 ++-- inst/NEWS | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 005b55868..5d933824c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: xcms -Version: 4.1.7 +Version: 4.1.8 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/R/method-filterFeatures.R b/R/method-filterFeatures.R index 8c708680b..9ef97ac0e 100644 --- a/R/method-filterFeatures.R +++ b/R/method-filterFeatures.R @@ -455,7 +455,7 @@ setMethod("filterFeatures", vals <- rowPercentMissing(featureValues(object, ...)[, spl_idx]) fts_idx <- c(fts_idx, which(vals <= filter@threshold)) } - fts_idx <- order(unique(fts_idx)) + fts_idx <- sort(unique(fts_idx)) message(length(vals) - length(fts_idx), " features were removed") ph <- XProcessHistory(param = filter, date. = date(), @@ -479,7 +479,7 @@ setMethod("filterFeatures", vals <- rowPercentMissing(assay(object, assay)[, spl_idx]) fts_idx <- c(fts_idx, which(vals <= filter@threshold)) } - fts_idx <- order(unique(fts_idx)) + fts_idx <- sort(unique(fts_idx)) message(length(vals) - length(fts_idx), " features were removed") object[fts_idx] } diff --git a/inst/NEWS b/inst/NEWS index 5fc15922b..59c305307 100644 --- a/inst/NEWS +++ b/inst/NEWS @@ -1,3 +1,8 @@ +Changes in version 4.1.8 +---------------------- + +- Fix bug in `filterFeatures,PercentMissingFilter`. + Changes in version 4.1.7 ----------------------