Skip to content

Commit

Permalink
Merge pull request #758 from sneumann/quick_fix
Browse files Browse the repository at this point in the history
small fixes
  • Loading branch information
jorainer authored Jul 18, 2024
2 parents 9e64c92 + bf2792d commit 703c7f6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
6 changes: 4 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ importMethodsFrom("MSnbase", "intensity", "mz", "rtime", "fileNames", "fromFile"
importFrom("MSnbase", "as.data.frame.Spectrum", "Chromatogram",
"MChromatograms", "MSpectra", "requiredFvarLabels", "selectFeatureData")


export(
"etg",
"medianFilter",
Expand Down Expand Up @@ -254,7 +255,8 @@ export(
"loadXcmsData",
"matchLamasChromPeaks",
"summarizeLamaMatch",
"matchedRtimes"
"matchedRtimes",
"XcmsExperiment"
)

## New analysis methods
Expand Down Expand Up @@ -566,7 +568,7 @@ importMethodsFrom("Spectra", "precursorMz")
importMethodsFrom("Spectra", "$")
importMethodsFrom("Spectra", "uniqueMsLevels")
importMethodsFrom("Spectra", "backendBpparam")
importFrom("Spectra", "MsBackendMemory")
importFrom("Spectra", "MsBackendMemory", "filterEmptySpectra")

## MsExperiment things
importClassesFrom("MsExperiment", "MsExperiment")
Expand Down
5 changes: 5 additions & 0 deletions R/XcmsExperiment-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -1134,3 +1134,8 @@ featureArea <- function(object, mzmin = min, mzmax = max, rtmin = min,
object@chromPeaks
else chromPeaks(object@msFeatureData)
}

#' function to create an empty `XcmsExperiment` object
XcmsExperiment <- function() {
as(MsExperiment(), "XcmsExperiment")
}
3 changes: 3 additions & 0 deletions R/XcmsExperiment-plotting.R
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ setMethod(
#'
#' @importFrom grDevices n2mfrow
#'
#' @importFrom Spectra filterEmptySpectra
#'
#'
#' @export
#'
#' @author Johannes Rainer
Expand Down
4 changes: 3 additions & 1 deletion R/XcmsExperiment.R
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,9 @@ setMethod("dropAdjustedRtime", "XcmsExperiment", function(object) {

#' @rdname XcmsExperiment
setMethod("hasAdjustedRtime", "MsExperiment", function(object) {
any(spectraVariables(spectra(object)) == "rtime_adjusted")
if (length(spectra(object)))
any(spectraVariables(spectra(object)) == "rtime_adjusted")
else FALSE
})

#' @rdname XcmsExperiment
Expand Down

0 comments on commit 703c7f6

Please sign in to comment.