Skip to content

Commit

Permalink
fix sanity check part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
philouail committed Nov 22, 2024
1 parent 7340287 commit b8525f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/XcmsExperiment-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion R/XcmsExperiment.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit b8525f0

Please sign in to comment.