Skip to content

Commit

Permalink
docs: restructure documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jorainer committed Sep 25, 2024
1 parent 6fe7a59 commit 3bfe934
Show file tree
Hide file tree
Showing 17 changed files with 1,931 additions and 1,980 deletions.
10 changes: 0 additions & 10 deletions R/AllGenerics.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,32 @@ NULL
setMethod("bin", "numeric", MsCoreUtils::bin)
setGeneric("combinePeaks", function(object, ...)
standardGeneric("combinePeaks"))
#' @rdname hidden_aliases
setGeneric("containsMz", function(object, ...)
standardGeneric("containsMz"))
#' @rdname hidden_aliases
setGeneric("containsNeutralLoss", function(object, ...)
standardGeneric("containsNeutralLoss"))
setGeneric("dataStorageBasePath", function(object, ...)
standardGeneric("dataStorageBasePath"))
setGeneric("dataStorageBasePath<-", function(object, ..., value)
standardGeneric("dataStorageBasePath<-"))
#' @rdname hidden_aliases
setGeneric("dropNaSpectraVariables", function(object, ...)
standardGeneric("dropNaSpectraVariables"))
#' @rdname hidden_aliases
setGeneric("entropy", function(object, ...)
standardGeneric("entropy"))
#' @rdname hidden_aliases
setGeneric("export", function(object, ...)
standardGeneric("export"))
setGeneric("filterFourierTransformArtefacts", function(object, ...)
standardGeneric("filterFourierTransformArtefacts"))
#' @rdname neutralLoss
setGeneric("neutralLoss", function(object, param, ...)
standardGeneric("neutralLoss"))
#' @rdname hidden_aliases
setGeneric("pickPeaks", function(object, ...)
standardGeneric("pickPeaks"))
setGeneric("plotSpectraMirror", function(x, y, ...)
standardGeneric("plotSpectraMirror"))
#' @rdname hidden_aliases
setGeneric("replaceIntensitiesBelow", function(object, threshold = min, ...)
standardGeneric("replaceIntensitiesBelow"))
#' @rdname hidden_aliases
setGeneric("reset", function(object, ...)
standardGeneric("reset"))
#' @rdname hidden_aliases
setGeneric("selectSpectraVariables", function(object, ...)
standardGeneric("selectSpectraVariables"))
setGeneric("Spectra", function(object, ...) standardGeneric("Spectra"))
Expand Down
4 changes: 2 additions & 2 deletions R/MsBackend.R
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@
#'
#' The parameters are:
#' - `object`: an instance of the `MsBackendMzR` class.
#' - `x`: the [Spectra-class] object to be exported.
#' - `x`: the [Spectra] object to be exported.
#' - `file`: `character` with the (full) output file name(s). Should be
#' of length 1 or equal `length(x)`. If a single file is specified, all
#' spectra are exported to that file. Alternatively it is possible to specify
Expand All @@ -715,7 +715,7 @@
#' backend and if `dataOrigin(x)` contains the original MS data file names.
#' - `BPPARAM`: parallel processing settings.
#'
#' See examples in [Spectra-class] or the vignette for more details and
#' See examples in [Spectra] or the vignette for more details and
#' examples.
#'
#' The `MsBackendMzR` ignores parameter `columns` of the `peaksData()`
Expand Down
4 changes: 4 additions & 0 deletions R/Spectra-estimatePrecursorMz.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
#'
#' @author Mar Garcia-Aloy, Johannes Rainer
#'
#' @seealso
#'
#' [addProcessing()] for other data analysis and manipulation functions.
#'
#' @export
#'
#' @examples
Expand Down
42 changes: 21 additions & 21 deletions R/Spectra-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ NULL

#' @export applyProcessing
#'
#' @rdname Spectra
#' @rdname addProcessing
applyProcessing <- function(object, f = processingChunkFactor(object),
BPPARAM = bpparam(), ...) {
queue <- object@processingQueue
Expand Down Expand Up @@ -538,14 +538,14 @@ applyProcessing <- function(object, f = processingChunkFactor(object),

#' @export concatenateSpectra
#'
#' @rdname Spectra
#' @rdname combineSpectra
concatenateSpectra <- function(x, ...) {
.concatenate_spectra(unlist(unname(list(unname(x), ...))))
}

#' @export combineSpectra
#'
#' @rdname Spectra
#' @rdname combineSpectra
combineSpectra <- function(x, f = x$dataStorage, p = x$dataStorage,
FUN = combinePeaksData, ..., BPPARAM = bpparam()) {
if (!is.factor(f))
Expand Down Expand Up @@ -622,7 +622,7 @@ combineSpectra <- function(x, f = x$dataStorage, p = x$dataStorage,

#' @export joinSpectraData
#'
#' @rdname Spectra
#' @rdname combineSpectra
joinSpectraData <- function(x, y,
by.x = "spectrumId",
by.y,
Expand Down Expand Up @@ -685,7 +685,7 @@ joinSpectraData <- function(x, y,

#' @export
#'
#' @rdname Spectra
#' @rdname addProcessing
processingLog <- function(x) {
x@processing
}
Expand Down Expand Up @@ -831,9 +831,7 @@ chunkapply <- function(x, FUN, ..., chunkSize = 1000L, chunks = factor()) {
as.factor(rep(1:ceiling(len / chunkSize), each = chunkSize)[seq_len(len)])
}

#' @rdname Spectra
#'
#' @author Nir Shahaf, Johannes Rainer
#' @rdname filterMsLevel
#'
#' @export
deisotopeSpectra <-
Expand All @@ -845,9 +843,7 @@ deisotopeSpectra <-
substDefinition = im, charge = charge)
}

#' @rdname Spectra
#'
#' @author Nir Shahaf, Johannes Rainer
#' @rdname filterMsLevel
#'
#' @export
reduceSpectra <- function(x, tolerance = 0, ppm = 20) {
Expand All @@ -856,9 +852,7 @@ reduceSpectra <- function(x, tolerance = 0, ppm = 20) {
addProcessing(x, .peaks_reduce, tolerance = tolerance, ppm = ppm)
}

#' @rdname Spectra
#'
#' @author Nir Shahaf
#' @rdname filterMsLevel
#'
#' @export
filterPrecursorMaxIntensity <- function(x, tolerance = 0, ppm = 20) {
Expand Down Expand Up @@ -891,9 +885,7 @@ filterPrecursorMaxIntensity <- function(x, tolerance = 0, ppm = 20) {
x
}

#' @rdname Spectra
#'
#' @author Nir Shahaf
#' @rdname filterMsLevel
#'
#' @export
filterPrecursorIsotopes <-
Expand Down Expand Up @@ -926,9 +918,7 @@ filterPrecursorIsotopes <-
x
}

#' @rdname Spectra
#'
#' @author Johannes Rainer
#' @rdname addProcessing
#'
#' @export
scalePeaks <- function(x, by = sum, msLevel. = uniqueMsLevels(x)) {
Expand All @@ -941,7 +931,7 @@ scalePeaks <- function(x, by = sum, msLevel. = uniqueMsLevels(x)) {
x
}

#' @rdname Spectra
#' @rdname filterMsLevel
#'
#' @export
filterPrecursorPeaks <- function(object, tolerance = 0, ppm = 20,
Expand Down Expand Up @@ -992,6 +982,11 @@ filterPrecursorPeaks <- function(object, tolerance = 0, ppm = 20,
#' per file parallel processing if `f` or `chunkSize` is not defined.
#' Other on-disk backends: only if requested by the user.
#'
#' @param BPPARAM Parallel setup configuration. See [bpparam()] for more
#' information.
#'
#' @param object `Spectra` object.
#'
#' @param x `Spectra` object.
#'
#' @param chunkSize `integer` defining the size of chunks into which `x` should
Expand Down Expand Up @@ -1067,6 +1062,11 @@ filterPrecursorPeaks <- function(object, tolerance = 0, ppm = 20,
#' For these, the `backendBpparam()` function will always return a
#' `SerialParam()` independently on how parallel processing was defined.
#'
#' @param BPPARAM Parallel setup configuration. See [bpparam()] for more
#' information.
#'
#' @param object `Spectra` object.
#'
#' @param x `Spectra`.
#'
#' @param value `integer(1)` defining the chunk size.
Expand Down
4 changes: 4 additions & 0 deletions R/Spectra-neutralLoss.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ setClassUnion("functionOrNull", c("function", "NULL"))
#' Analysis in METLIN. Journal of the American Society for Mass Spectrometry.
#' \doi{10.1021/jasms.1c00343}
#'
#' @seealso
#'
#' [addProcessing()] for other data analysis and manipulation functions.
#'
#' @examples
#'
#' ## Create a simple example Spectra object with some MS1, MS2 and MS3 spectra.
Expand Down
Loading

0 comments on commit 3bfe934

Please sign in to comment.