From b8525f08f936a2d61a3e1ac37c57d9983ed86a77 Mon Sep 17 00:00:00 2001 From: Philippine Louail <127301965+philouail@users.noreply.github.com> Date: Fri, 22 Nov 2024 16:01:45 +0100 Subject: [PATCH] fix sanity check part 2 --- R/XcmsExperiment-functions.R | 2 +- R/XcmsExperiment.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/XcmsExperiment-functions.R b/R/XcmsExperiment-functions.R index cb6be689..b0906bb8 100644 --- a/R/XcmsExperiment-functions.R +++ b/R/XcmsExperiment-functions.R @@ -797,7 +797,7 @@ chromPeakColumns = c("rt", "mz"), BPPARAM = bpparam()) { method <- match.arg(method) - if (!chromPeakColumns %in% colnames(.chromPeaks(x))) + if (!all(chromPeakColumns %in% colnames(.chromPeaks(x)))) stop("One or more of the columns in 'chromPeakColumns' are not ", "available in the 'chromPeaks' data.") pks <- .chromPeaks(x)[, union(c("mz", "mzmin", "mzmax", "rt", diff --git a/R/XcmsExperiment.R b/R/XcmsExperiment.R index 69588eb6..487b868c 100644 --- a/R/XcmsExperiment.R +++ b/R/XcmsExperiment.R @@ -1782,7 +1782,7 @@ setMethod( if (!hasFeatures(object)) stop("No feature definitions present. Please run ", "'groupChromPeaks' first.") - if (!featureColumns %in% colnames(featureDefinitions(object))) + if (!all(featureColumns %in% colnames(featureDefinitions(object)))) stop("One or more of the requested 'featureColumns' are not ", "present in the feature definitions.") if (hasAdjustedRtime(object))