Skip to content
Snippets Groups Projects
Commit 7acd328e authored by Steffen Neumann's avatar Steffen Neumann
Browse files

Merge branch 'april2013hackfest' of https://github.com/meowcat/RMassBank into april2013hackfest

parents e853096d b1db49ea
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,7 @@ export(findMsMsHRperxcms.direct)
export(findMz)
export(findMz.formula)
export(findName)
export(findProgress)
export(findRt)
export(findSmiles)
export(flatten)
......@@ -69,6 +70,7 @@ export(plotRecalibration)
export(plotRecalibration.direct)
export(ppm)
export(problematicPeaks)
export(progressBarHook)
export(readMbdata)
export(reanalyzeFailpeak)
export(reanalyzeFailpeaks)
......
......@@ -42,7 +42,8 @@ archiveResults <- function(w, fileName, settings = getOption("RMassBank"))
#' @usage msmsWorkflow(w, mode="pH", steps=c(1:8), confirmMode = FALSE, newRecalibration = TRUE,
#' useRtLimit = TRUE, archivename=NA, readMethod = "mzR", findPeaksArgs = NA, plots = FALSE,
#' precursorscan.cf = FALSE,
#' settings = getOption("RMassBank"), analyzeMethod = "formula")
#' settings = getOption("RMassBank"), analyzeMethod = "formula",
#' progressbar = "progressBarHook")
#' @param w A \code{msmsWorkspace} to work with.
#' @param mode \code{"pH", "pNa", "pM", "mH", "mM", "mFA"} for different ions
#' ([M+H]+, [M+Na]+, [M]+, [M-H]-, [M]-, [M+FA]-).
......@@ -69,6 +70,8 @@ archiveResults <- function(w, fileName, settings = getOption("RMassBank"))
#' @param settings Options to be used for processing. Defaults to the options loaded via
#' \code{\link{loadRmbSettings}} et al. Refer to there for specific settings.
#' @param analyzeMethod The "method" parameter to pass to \code{\link{analyzeMsMs}}.
#' @param progressbar The progress bar callback to use. Only needed for specialized applications.
#' Cf. the documentation of \code{\link{progressBarHook}} for usage.
#' @return The processed \code{msmsWorkspace}.
#' @seealso \code{\link{msmsWorkspace-class}}
#' @author Michael Stravs, Eawag <michael.stravs@@eawag.ch>
......@@ -1477,7 +1480,7 @@ filterPeakSatellites <- function(peaks, filterSettings = getOption("RMassBank")$
#'
#' @aliases reanalyzeFailpeaks reanalyzeFailpeak
#' @usage reanalyzeFailpeaks(specs, custom_additions, mode, filterSettings =
#' getOption("RMassBank")$filterSettings)
#' getOption("RMassBank")$filterSettings, progressbar = "progressBarHook")
#' reanalyzeFailpeak(custom_additions, mass, cpdID, counter, pb = NULL, mode,
#' filterSettings = getOption("RMassBank")$filterSettings)
#' @param specs An \code{aggregatedRcSpecs} object (after the electronic noise
......@@ -1488,7 +1491,11 @@ filterPeakSatellites <- function(peaks, filterSettings = getOption("RMassBank")$
#' @param cpdID Compound ID of this spectrum.
#' @param counter Current peak index (used exclusively for the progress
#' indicator)
#' @param pb A txtProgressBar object to display progress on. No progress is displayed if NULL.
#' @param pb A progressbar object to display progress on, as passed by
#' \code{reanalyzeFailpeaks} to \code{reanalyzeFailpeak}. No progress
#' is displayed if NULL.
#' @param progressbar The progress bar callback to use. Only needed for specialized
#' applications. Cf. the documentation of \code{\link{progressBarHook}} for usage.
#' @param filterSettings Settings for filtering data. Refer to\code{\link{analyzeMsMs}} for settings.
#' @return The returning list contains two tables:
#' \item{peaksReanalyzed}{All reanalyzed peaks with or without matching formula.}
......@@ -2116,7 +2123,37 @@ recalibrate.identity <- function(rcdata)
return(lm(recalfield ~ 0, data=rcdata))
}
#' Standard progress bar hook.
#'
#' This function provides a standard implementation for the progress bar in RMassBank.
#'
#' RMassBank calls the progress bar function in the following three ways:
#' \code{pb <- progressBarHook(object=NULL, value=0, min=0, max=LEN)}
#' to create a new progress bar.
#' \code{pb <- progressBarHook(object=pb, value= VAL)}
#' to set the progress bar to a new value (between the set \code{min} and \code{max})
#' \code{progressBarHook(object=pb, close=TRUE)}
#' to close the progress bar. (The actual calls are performed with \code{do.call},
#' e.g.
#' \code{progressbar <- "progressBarHook"
#' pb <- do.call(progressbar, list(object=pb, value= nProg))
#' }. See the source code for details.)
#'
#' To substitute the standard progress bar for an alternative implementation (e.g. for
#' use in a GUI), the developer can write his own function which behaves in the same way
#' as \code{progressBarHook}, i.e. takes the same parameters and can be called in the
#' same way.
#'
#' @param object An identifier representing an instance of a progress bar.
#' @param value The new value to assign to the progress indicator
#' @param min The minimal value of the progress indicator
#' @param max The maximal value of the progress indicator
#' @param close If \code{TRUE}, the progress bar is closed.
#' @return Returns a progress bar instance identifier (i.e. an identifier
#' which can be used as \code{object} in subsequent calls.)
#'
#' @author Michele Stravs, Eawag <stravsmi@@eawag.ch>
#' @export
progressBarHook <- function(object = NULL, value = 0, min = 0, max = 100, close = FALSE)
{
if(is.null(object))
......
\name{findProgress}
\alias{findProgress}
\title{Determine processed steps}
\usage{
findProgress(workspace)
}
\arguments{
\item{workspace}{A \code{msmsWorkspace} object.}
}
\value{
An array containing all \code{msmsWorkflow} steps which
have likely been processed.
}
\description{
This function reads out the content of different slots of
the \code{workspace} object and finds out which steps
have already been processed on it.
}
\author{
Stravs MA, Eawag <michael.stravs@eawag.ch>
}
......@@ -6,7 +6,8 @@
FALSE, newRecalibration = TRUE, useRtLimit = TRUE,
archivename=NA, readMethod = "mzR", findPeaksArgs = NA,
plots = FALSE, precursorscan.cf = FALSE, settings =
getOption("RMassBank"), analyzeMethod = "formula")
getOption("RMassBank"), analyzeMethod = "formula",
progressbar = "progressBarHook")
}
\arguments{
\item{w}{A \code{msmsWorkspace} to work with.}
......@@ -61,6 +62,11 @@
\item{analyzeMethod}{The "method" parameter to pass to
\code{\link{analyzeMsMs}}.}
\item{progressbar}{The progress bar callback to use. Only
needed for specialized applications. Cf. the
documentation of \code{\link{progressBarHook}} for
usage.}
}
\value{
The processed \code{msmsWorkspace}.
......
\name{progressBarHook}
\alias{progressBarHook}
\title{Standard progress bar hook.}
\usage{
progressBarHook(object = NULL, value = 0, min = 0,
max = 100, close = FALSE)
}
\arguments{
\item{object}{An identifier representing an instance of a
progress bar.}
\item{value}{The new value to assign to the progress
indicator}
\item{min}{The minimal value of the progress indicator}
\item{max}{The maximal value of the progress indicator}
\item{close}{If \code{TRUE}, the progress bar is closed.}
}
\value{
Returns a progress bar instance identifier (i.e. an
identifier which can be used as \code{object} in
subsequent calls.)
}
\description{
This function provides a standard implementation for the
progress bar in RMassBank.
}
\details{
RMassBank calls the progress bar function in the
following three ways: \code{pb <-
progressBarHook(object=NULL, value=0, min=0, max=LEN)} to
create a new progress bar. \code{pb <-
progressBarHook(object=pb, value= VAL)} to set the
progress bar to a new value (between the set \code{min}
and \code{max}) \code{progressBarHook(object=pb,
close=TRUE)} to close the progress bar. (The actual calls
are performed with \code{do.call}, e.g. \code{progressbar
<- "progressBarHook" pb <- do.call(progressbar,
list(object=pb, value= nProg)) }. See the source code for
details.)
To substitute the standard progress bar for an
alternative implementation (e.g. for use in a GUI), the
developer can write his own function which behaves in the
same way as \code{progressBarHook}, i.e. takes the same
parameters and can be called in the same way.
}
\author{
Michele Stravs, Eawag <stravsmi@eawag.ch>
}
......@@ -4,7 +4,8 @@
\title{Reanalyze unmatched peaks}
\usage{
reanalyzeFailpeaks(specs, custom_additions, mode,
filterSettings = getOption("RMassBank")$filterSettings)
filterSettings = getOption("RMassBank")$filterSettings,
progressbar = "progressBarHook")
reanalyzeFailpeak(custom_additions, mass, cpdID,
counter, pb = NULL, mode, filterSettings =
getOption("RMassBank")$filterSettings)
......@@ -28,8 +29,15 @@
\item{counter}{Current peak index (used exclusively for
the progress indicator)}
\item{pb}{A txtProgressBar object to display progress on.
No progress is displayed if NULL.}
\item{pb}{A progressbar object to display progress on, as
passed by \code{reanalyzeFailpeaks} to
\code{reanalyzeFailpeak}. No progress is displayed if
NULL.}
\item{progressbar}{The progress bar callback to use. Only
needed for specialized applications. Cf. the
documentation of \code{\link{progressBarHook}} for
usage.}
\item{filterSettings}{Settings for filtering data. Refer
to\code{\link{analyzeMsMs}} for settings.}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment