diff --git a/DESCRIPTION b/DESCRIPTION index 9f07871f1..72feef0c9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -14,7 +14,7 @@ Depends: methods, Biobase, BiocParallel (>= 1.8.0), - MSnbase (>= 2.3.9) + MSnbase (>= 2.3.10) Imports: mzR (>= 1.1.6), BiocGenerics, diff --git a/R/methods-XCMSnExp.R b/R/methods-XCMSnExp.R index de7d4e4fe..7b5ad3d4b 100644 --- a/R/methods-XCMSnExp.R +++ b/R/methods-XCMSnExp.R @@ -1918,6 +1918,9 @@ setMethod("featureValues", #' Details and Notes sections below). Use \code{missing = 0} to resemble the #' behaviour of the \code{getEIC} from the \code{old} user interface. #' +#' @param msLevel \code{integer} specifying the MS level from which the +#' chromatogram should be extracted. Defaults to \code{msLevel = 1L}. +#' #' @return \code{chromatogram} returns a \code{\link{Chromatograms}} object with #' the number of columns corresponding to the number of files in #' \code{object} and number of rows the number of specified ranges (i.e. @@ -1987,7 +1990,8 @@ setMethod("featureValues", setMethod("chromatogram", signature(object = "XCMSnExp"), function(object, rt, mz, adjustedRtime = hasAdjustedRtime(object), - aggregationFun = "sum", missing = NA_real_) { + aggregationFun = "sum", missing = NA_real_, + msLevel = 1L) { ## Coerce to OnDiskMSnExp. if (adjustedRtime) adj_rt <- rtime(object, adjusted = TRUE) @@ -1998,7 +2002,7 @@ setMethod("chromatogram", } chromatogram(object, rt = rt, mz = mz, aggregationFun = aggregationFun, - missing = missing) + missing = missing, msLevel = msLevel) }) #' @rdname XCMSnExp-class diff --git a/inst/NEWS b/inst/NEWS index af7d4e394..a05fabf45 100644 --- a/inst/NEWS +++ b/inst/NEWS @@ -1,6 +1,9 @@ CHANGES IN VERSION 2.99.7 ------------------------- +USER VISIBLE CHANGES: +- Add parameter msLevel to chromatogram,XCMSnExp method (issue #205). + BUG FIXES: - Fix #201: Warnings: 'readMSData2' is deprecated, thanks to L. Gatto. - Merge with BioC git after transition diff --git a/man/chromatogram-method.Rd b/man/chromatogram-method.Rd index b4c90cfce..631d6e835 100644 --- a/man/chromatogram-method.Rd +++ b/man/chromatogram-method.Rd @@ -8,7 +8,7 @@ \usage{ \S4method{chromatogram}{XCMSnExp}(object, rt, mz, adjustedRtime = hasAdjustedRtime(object), aggregationFun = "sum", - missing = NA_real_) + missing = NA_real_, msLevel = 1L) } \arguments{ \item{object}{Either a \code{\link[MSnbase]{OnDiskMSnExp}} or @@ -43,6 +43,9 @@ be used if for a given retention time no signal was measured within the mz range of the corresponding scan. Defaults to \code{NA_real_} (see also Details and Notes sections below). Use \code{missing = 0} to resemble the behaviour of the \code{getEIC} from the \code{old} user interface.} + +\item{msLevel}{\code{integer} specifying the MS level from which the +chromatogram should be extracted. Defaults to \code{msLevel = 1L}.} } \value{ \code{chromatogram} returns a \code{\link{Chromatograms}} object with