Skip to content
Snippets Groups Projects
Commit 64cf6a24 authored by michele's avatar michele
Browse files

* Made more stuff configurable via settings (formerly hardcoded parameters).

* Changed handling of settings in leMsMs.R and leMsMsRaw.R such that parameters can be passed more readily to functions (i.e. settings are now only default arguments to functions) createMassBank.R still handles settings the old way.
* Added precursor scan filler to handle mzML files without precursor information.
parent 62baab6b
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -9,15 +9,30 @@ NULL
#' Extracts MS/MS spectra from LC-MS raw data for a specified precursor, specified
#' either via the RMassBank compound list (see \code{\link{loadList}}) or via a mass.
#'
#' Different versions of the function get the data from different sources.
#'
#' @usage findMsMsHR(fileName, cpdID, mode="pH",confirmMode =0, useRtLimit = TRUE, dppm=10)
#' Different versions of the function get the data from different sources. Note that
#' findMsMsHR and findMsMsHR.direct differ mainly in that findMsMsHR opens a file
#' whereas findMsMs.direct uses an open file handle - both are intended to be used
#' in a full process which involves compound lists etc. In contrast, findMsMsHR.mass
#' is a low-level function which uses the mass directly for lookup and is intended for
#' use as a standalone function in unrelated applications.
#'
#' @usage findMsMsHR(fileName, cpdID, mode="pH",confirmMode =0, useRtLimit = TRUE,
#' ppmFine = getOption("RMassBank")$findMsMsRawSettings$ppmFine,
#' mzCoarse = getOption("RMassBank")$findMsMsRawSettings$mzCoarse,
#' fillPrecursorScan = getOption("RMassBank")$findMsMsRawSettings$fillPrecursorScan,
#' rtMargin = getOption("RMassBank")$rtMargin,
#' deprofile = getOption("RMassBank")$deprofile)
#'
#' findMsMsHR.mass(msRaw, mz, limit.coarse, limit.fine, rtLimits = NA, maxCount = NA,
#' headerCache = NA)
#'
#' findMsMsHR.direct(msRaw, cpdID, mode = "pH", confirmMode = 0,
#' useRtLimit = TRUE, dppm=10, limit.coarse=0.5)
#' headerCache = NA, fillPrecursorScan = FALSE,
#' deprofile = getOption("RMassBank")$deprofile)
#'
#' findMsMsHR.direct(msRaw, cpdID, mode = "pH", confirmMode = 0, useRtLimit = TRUE,
#' ppmFine = getOption("RMassBank")$findMsMsRawSettings$ppmFine,
#' mzCoarse = getOption("RMassBank")$findMsMsRawSettings$mzCoarse,
#' fillPrecursorScan = getOption("RMassBank")$findMsMsRawSettings$fillPrecursorScan,
#' rtMargin = getOption("RMassBank")$rtMargin,
#' deprofile = getOption("RMassBank")$deprofile)
#'
#' @aliases findMsMsHR.mass findMsMsHR.direct findMsMsHR
#' @param fileName The file to open and search the MS2 spectrum in.
......@@ -25,13 +40,16 @@ NULL
#' @param cpdID The compound ID in the compound list (see \code{\link{loadList}})
#' to use for formula lookup.
#' @param mz The mass to use for spectrum search.
#' @param dppm The limit in ppm to use for fine limit (see below) calculation.
#' @param limit.coarse The coarse limit to use for locating potential MS2 scans:
#' @param ppmFine The limit in ppm to use for fine limit (see below) calculation.
#' @param mzCoarse The coarse limit to use for locating potential MS2 scans:
#' this tolerance is used when finding scans with a suitable precursor
#' ion value.
#' @param limit.fine The fine limit to use for locating MS2 scans: this tolerance
#' is used when locating an appropriate analyte peak in the MS1 precursor
#' spectrum.
#' spectrum.
#' @param limit.coarse Parameter in \code{findMsMsHR.mass} corresponding to \code{mzCoarse}.
#' (The parameters are distinct to clearly conceptually distinguish findMsMsHR.mass
#' (a standalone useful function) from the cpdID based functions (workflow functions).)
#' @param mode The processing mode (determines which ion/adduct is searched):
#' \code{"pH", "pNa", "pM", "mH", "mM", "mFA"} for different ions
#' ([M+H]+, [M+Na]+, [M]+, [M-H]-, [M]-, [M+FA]-).
......@@ -47,6 +65,11 @@ NULL
#' @param maxCount The maximal number of spectra groups to return. One spectra group
#' consists of all data-dependent scans from the same precursor whose precursor
#' mass matches the specified search mass.
#' @param fillPrecursorScan If \code{TRUE}, the precursor scan will be filled from MS1 data.
#' To be used for data where the precursor scan is not stored in the raw data.
#' @param rtMargin The retention time tolerance to use.
#' @param deprofile Whether deprofiling should take place, and what method should be
#' used (cf. \code{\link{deprofile}})
#' @return For \code{findMsMsHR} and \code{findMsMsHR.direct}: A "spectrum set", a list with items:
#' \item{foundOK}{\code{TRUE} if a spectrum was found, \code{FALSE} otherwise.
#' Note: if \code{FALSE}, all other values can be missing!}
......@@ -76,36 +99,55 @@ NULL
#' @author Michael A. Stravs, Eawag <michael.stravs@@eawag.ch>
#' @seealso findEIC
#' @export
findMsMsHR <- function(fileName, cpdID, mode="pH",confirmMode =0, useRtLimit = TRUE, dppm=10)
findMsMsHR <- function(fileName, cpdID, mode="pH",confirmMode =0, useRtLimit = TRUE,
ppmFine = getOption("RMassBank")$findMsMsRawSettings$ppmFine,
mzCoarse = getOption("RMassBank")$findMsMsRawSettings$mzCoarse,
fillPrecursorScan = getOption("RMassBank")$findMsMsRawSettings$fillPrecursorScan,
rtMargin = getOption("RMassBank")$rtMargin,
deprofile = getOption("RMassBank")$deprofile)
{
# access data directly for finding the MS/MS data. This is done using
# mzR.
msRaw <- openMSfile(fileName)
ret <- findMsMsHR.direct(msRaw, cpdID, mode, confirmMode, useRtLimit, dppm)
ret <- findMsMsHR.direct(msRaw, cpdID, mode, confirmMode, useRtLimit, ppmFine, mzCoarse, fillPrecursorScan,
rtMargin, deprofile)
mzR::close(msRaw)
return(ret)
}
#' @export
findMsMsHR.mass <- function(msRaw, mz, limit.coarse, limit.fine, rtLimits = NA, maxCount = NA,
headerCache = NA)
headerCache = NA, fillPrecursorScan = FALSE,
deprofile = getOption("RMassBank")$deprofile)
{
eic <- findEIC(msRaw, mz, limit.fine, rtLimits)
# if(!is.na(rtLimits))
# {
# eic <- subset(eic, rt >= rtLimits[[1]] & rt <= rtLimits[[2]])
# }
if(!is.na(headerCache))
if(!all(is.na(headerCache)))
headerData <- headerCache
else
headerData <- as.data.frame(header(msRaw))
if(fillPrecursorScan == TRUE)
{
# reset the precursor scan number. first set to NA, then
# carry forward the precursor scan number from the last parent scan
headerData$precursorScanNum <- NA
headerData[which(headerData$msLevel == 1),"precursorScanNum"] <-
headerData[which(headerData$msLevel == 1),"acquisitionNum"]
headerData[,"precursorScanNum"] <- .locf(headerData[,"precursorScanNum"])
# Clear the actual MS1 precursor scan number again
headerData[which(headerData$msLevel == 1),"precursorScanNum"] <- 0
}
# Find MS2 spectra with precursors which are in the allowed
# scan filter (coarse limit) range
findValidPrecursors <- headerData[
(headerData$precursorMZ > mz - limit.coarse) &
(headerData$precursorMZ < mz + limit.coarse),]
(headerData$precursorMZ < mz + limit.coarse),]
# Find the precursors for the found spectra
validPrecursors <- unique(findValidPrecursors$precursorScanNum)
# check whether the precursors are real: must be within fine limits!
......@@ -138,17 +180,17 @@ findMsMsHR.mass <- function(msRaw, mz, limit.coarse, limit.fine, rtLimits = NA,
{
masterHeader <- headerData[headerData$acquisitionNum == masterScan,]
childHeaders <- headerData[(headerData$precursorScanNum == masterScan)
& (headerData$precursorMZ > mz - limit.coarse)
& (headerData$precursorMZ < mz + limit.coarse) ,]
& (headerData$precursorMZ > mz - limit.coarse)
& (headerData$precursorMZ < mz + limit.coarse) ,]
childScans <- childHeaders$acquisitionNum
msPeaks <- mzR::peaks(msRaw, masterHeader$seqNum)
# if deprofile option is set: run deprofiling
deprofile.setting <- getOption("RMassBank")$deprofile
deprofile.setting <- deprofile
if(!is.na(deprofile.setting))
msPeaks <- deprofile.scan(
msPeaks, method = deprofile.setting, noise = NA, colnames = FALSE
)
)
colnames(msPeaks) <- c("mz","int")
msmsPeaks <- lapply(childHeaders$seqNum, function(scan)
{
......@@ -180,7 +222,12 @@ findMsMsHR.mass <- function(msRaw, mz, limit.coarse, limit.fine, rtLimits = NA,
}
#' @export
findMsMsHR.direct <- function(msRaw, cpdID, mode = "pH", confirmMode = 0, useRtLimit = TRUE, dppm=10, limit.coarse=0.5)
findMsMsHR.direct <- function(msRaw, cpdID, mode = "pH", confirmMode = 0, useRtLimit = TRUE,
ppmFine = getOption("RMassBank")$findMsMsRawSettings$ppmFine,
mzCoarse = getOption("RMassBank")$findMsMsRawSettings$mzCoarse,
fillPrecursorScan = getOption("RMassBank")$findMsMsRawSettings$fillPrecursorScan,
rtMargin = getOption("RMassBank")$rtMargin,
deprofile = getOption("RMassBank")$deprofile)
{
# for finding the peak RT: use the gauss-fitted centwave peak
# (centroid data converted with TOPP is necessary. save as
......@@ -190,17 +237,19 @@ findMsMsHR.direct <- function(msRaw, cpdID, mode = "pH", confirmMode = 0, useRtL
# find cpd m/z
mzLimits <- findMz(cpdID, mode)
mz <- mzLimits$mzCenter
limit.fine <- ppm(mz, dppm, p=TRUE)
limit.fine <- ppm(mz, ppmFine, p=TRUE)
if(!useRtLimit)
rtLimits <- NA
else
{
rtMargin <- getOption("RMassBank")$rtMargin
dbRt <- findRt(cpdID)
rtLimits <- c(dbRt$RT - rtMargin, dbRt$RT + rtMargin) * 60
}
spectra <- findMsMsHR.mass(msRaw, mz, limit.coarse, limit.fine, rtLimits, confirmMode + 1)
spectra <- findMsMsHR.mass(msRaw, mz, mzCoarse, limit.fine, rtLimits, confirmMode + 1,NA
,fillPrecursorScan, deprofile)
spectra[[confirmMode + 1]]$mz <- mzLimits
spectra[[confirmMode + 1]]$id <- cpdID
spectra[[confirmMode + 1]]$formula <- findFormula(cpdID)
return(spectra[[confirmMode + 1]])
}
......@@ -208,7 +257,7 @@ findMsMsHR.direct <- function(msRaw, cpdID, mode = "pH", confirmMode = 0, useRtL
#'
#' Picks peaks from mz-files and returns the pseudospectra that CAMERA creates with the help of XCMS
#'
#' @usage findMsMsHRperxcms.direct(fileName, cpdID, mode, findPeaksArgs)
#' @usage findMsMsHRperxcms.direct(fileName, cpdID, mode="pH", findPeaksArgs = NULL, plots = FALSE)
#' @param fileName The path to the mz-file that should be read
#' @param cpdID The compoundID of the compound that has been used for the file
#' @param mode The ionization mode that has been used for the spectrum represented by the peaklist
......
......@@ -184,6 +184,9 @@ NULL
recalibrator = list(
MS1 = "recalibrate.loess",
MS2 = "recalibrate.loess"),
# Window width to look for MS1 peaks to recalibrate (in ppm)
recalibrateMS1Window= 15,
# Define the multiplicity filtering level
# Default is 2 (peak occurs at least twice)
# Set this to 1 if you want to turn this option off.
......@@ -206,7 +209,30 @@ NULL
"CE: {RECORD_TITLE_CE}",
"R={AC$MASS_SPECTROMETRY: RESOLUTION}",
"{MS$FOCUSED_ION: PRECURSOR_TYPE}"
)
),
# Define filter settings.
# For Orbitrap, settings of 15 ppm in low mass range, 10 ppm in high
# mass range, m/z = 120 as mass range division and 5 ppm for recalibrated
# data overall are recommended.
filterSettings = list(
ppmHighMass = 15,
ppmLowMass = 10,
massRangeDivision= 120,
ppmFine= 5,
prelimCut= 1e4,
prelimCutRatio= 0,
fineCut= 0,
fineCutRatio= 0,
specOkLimit= 1e4,
dbeMinLimit= -0.5,
satelliteMzLimit= 0.5,
satelliteIntLimit= 0.05
),
findMsMsRawSettings = list(
ppmFine= 10,
mzCoarse= 0.5,
fillPrecursorScan= FALSE)
)
# Writes a file with sample settings which the user can adjust with his values.
......
......@@ -2,7 +2,8 @@
\alias{aggregateSpectra}
\title{Aggregate analyzed spectra}
\usage{
aggregateSpectra(spec, addIncomplete = FALSE)
aggregateSpectra(spec, addIncomplete=FALSE, spectraList =
getOption("RMassBank")$spectraList)
}
\arguments{
\item{spec}{The set of spectra to aggregate}
......@@ -10,6 +11,9 @@
\item{addIncomplete}{Whether or not the peaks from
incomplete files (files for which less than the maximal
number of spectra are present)}
\item{spectraList}{The list of MS/MS spectra present in
each data block. As also defined in the settings file.}
}
\value{
\item{foundOK }{ A numeric vector with the compound IDs
......
......@@ -2,8 +2,10 @@
\alias{analyzeMsMs}
\title{Analyze MSMS spectra}
\usage{
analyzeMsMs(msmsPeaks, mode = "pH", detail = FALSE, run =
"preliminary", cut = NA, cut_ratio = 0)
analyzeMsMs(msmsPeaks, mode="pH", detail=FALSE,
run="preliminary", filterSettings =
getOption("RMassBank")$filterSettings, spectraList =
getOption("RMassBank")$spectraList)
}
\arguments{
\item{msmsPeaks}{A group of parent spectrum and
......@@ -34,13 +36,34 @@
and the column \code{"mzRecal"} is used as source for the
m/z values. Defaults to \code{"preliminary"}.}
\item{cut}{The intensity cutoff. Overrides the defaults
set from the \code{run} parameter.}
\item{filterSettings}{Settings for the filter parameters,
by default loaded from the RMassBank settings set with
e.g. \code{\link{loadRmbSettings}}. Must contain:
\itemize{ \item \code{ppmHighMass}, allowed ppm deviation
before recalibration for high mass range \item
\code{ppmLowMass}, allowed ppm deviation before
recalibration for low mass range \item
\code{massRangeDivision}, division point between high and
low mass range (before recalibration) \item
\code{ppmFine}, allowed ppm deviation overall after
recalibration \item \code{prelimCut}, intensity cutoff
for peaks in preliminary run \item \code{prelimCutRatio},
relative intensity cutoff for peaks in preliminary run,
e.g. 0.01 = 1% \item \code{fineCut}, intensity cutoff for
peaks in second run \item \code{fineCutRatio}, relative
intensity cutoff for peaks in second run \item
\code{specOkLimit}, minimum intensity of base peak for
spectrum to be accepted for processing \item
\code{dbeMinLimit}, minimum double bond equivalent for
accepted molecular subformula. \item
\code{satelliteMzLimit}, for satellite peak filtering
(\code{\link{filterPeakSatellites}}: mass window to use
for satellite removal \item \code{satelliteIntLimit}, the
relative intensity below which to discard "satellites".
(refer to \code{\link{filterPeakSatellites}}). }}
\item{cut_ratio}{The intensity ratio cutoff. The default
is no intensity ratio cutoff (0). A \code{cut_ratio=0.01}
would equal a cutoff at 1% of the maximum peak
intensity.}
\item{spectraList}{The list of MS/MS spectra present in
each data block. As also defined in the settings file.}
}
\value{
\item{list("foundOK")}{ Boolean. Whether or not child
......
......@@ -2,12 +2,16 @@
\alias{archiveResults}
\title{Backup \code{msmsWorkflow} results}
\usage{
archiveResults(w, fileName)
archiveResults(w, fileName, settings =
getOption("RMassBank"))
}
\arguments{
\item{w}{The \code{msmsWorkspace} to be saved.}
\item{fileName}{The filename to store the results under.}
\item{settings}{The settings to be stored into the
msmsWorkspace image.}
}
\description{
Writes the results from different \code{msmsWorkflow}
......@@ -16,6 +20,7 @@
\examples{
# This doesn't really make a lot of sense,
# it stores an empty workspace.
RmbDefaultSettings()
w <- newMsmsWorkspace()
archiveResults(w, "narcotics.RData")
}
......
......@@ -2,13 +2,17 @@
\alias{filterLowaccResults}
\title{Filter peaks with low accuracy}
\usage{
filterLowaccResults(peaks, mode = "fine")
filterLowaccResults(peaks, mode="fine", filterSettings =
getOption("RMassBank")$filterSettings)
}
\arguments{
\item{peaks}{A data frame with at least the columns
\code{mzFound} and \code{dppm}.}
\item{mode}{\code{coarse} or \code{fine}, see below.}
\item{filterSettings}{Settings for filtering. For
details, see documentation of \code{\link{analyzeMsMs}}}
}
\value{
A \code{list(TRUE = goodPeakDataframe, FALSE =
......
......@@ -2,8 +2,9 @@
\alias{filterMultiplicity}
\title{filterMultiplicity}
\usage{
filterMultiplicity(specs, archivename = NA, mode = "pH",
recalcBest = TRUE)
filterMultiplicity(specs, archivename=NA, mode="pH",
recalcBest = TRUE, multiplicityFilter =
getOption("RMassBank")$multiplicityFilter)
}
\arguments{
\item{specs}{aggregatedSpecs object whose peaks should be
......@@ -20,6 +21,10 @@
solution if you have many compounds with e.g. fluorine
atoms, which often have multiple assigned formulas per
peak and might occasionally lose peaks because of that.}
\item{multiplicityFilter}{Threshold for the multiplicity
filter. If set to 1, no filtering will apply (minimum 1
occurrence of peak). 2 equals minimum 2 occurrences etc.}
}
\value{
A list object with values: \item{peaksOK}{ Peaks with
......
......@@ -2,8 +2,8 @@
\alias{filterPeakSatellites}
\title{Filter satellite peaks}
\usage{
filterPeakSatellites(peaks, cutoff_mz_limit = 0.5,
cutoff_int_limit = 0.05)
filterPeakSatellites(peaks, filterSettings =
getOption("RMassBank")$filterSettings)
}
\arguments{
\item{peaks}{A peak dataframe with at least the columns
......@@ -12,11 +12,9 @@
identical for both the unrecalibrated and the
recalibrated spectra.}
\item{cutoff_mz_limit}{The window around a "parent" peak
to consider for satellite search.}
\item{cutoff_int_limit}{The relative intensity below
which to discard "satellites".}
\item{filterSettings}{The settings used for filtering.
Refer to \code{\link{analyzeMsMs}} documentation for
filter settings.}
}
\value{
Returns the peak table with satellite peaks removed.
......
......@@ -5,13 +5,29 @@
\title{Extract MS/MS spectra for specified precursor}
\usage{
findMsMsHR(fileName, cpdID, mode="pH",confirmMode =0,
useRtLimit = TRUE, dppm=10)
useRtLimit = TRUE, ppmFine =
getOption("RMassBank")$findMsMsRawSettings$ppmFine,
mzCoarse =
getOption("RMassBank")$findMsMsRawSettings$mzCoarse,
fillPrecursorScan =
getOption("RMassBank")$findMsMsRawSettings$fillPrecursorScan,
rtMargin = getOption("RMassBank")$rtMargin, deprofile =
getOption("RMassBank")$deprofile)
findMsMsHR.mass(msRaw, mz, limit.coarse, limit.fine,
rtLimits = NA, maxCount = NA, headerCache = NA)
rtLimits = NA, maxCount = NA, headerCache = NA,
fillPrecursorScan = FALSE, deprofile =
getOption("RMassBank")$deprofile)
findMsMsHR.direct(msRaw, cpdID, mode = "pH", confirmMode
= 0, useRtLimit = TRUE, dppm=10, limit.coarse=0.5)
= 0, useRtLimit = TRUE, ppmFine =
getOption("RMassBank")$findMsMsRawSettings$ppmFine,
mzCoarse =
getOption("RMassBank")$findMsMsRawSettings$mzCoarse,
fillPrecursorScan =
getOption("RMassBank")$findMsMsRawSettings$fillPrecursorScan,
rtMargin = getOption("RMassBank")$rtMargin, deprofile =
getOption("RMassBank")$deprofile)
}
\arguments{
\item{fileName}{The file to open and search the MS2
......@@ -25,10 +41,10 @@
\item{mz}{The mass to use for spectrum search.}
\item{dppm}{The limit in ppm to use for fine limit (see
below) calculation.}
\item{ppmFine}{The limit in ppm to use for fine limit
(see below) calculation.}
\item{limit.coarse}{The coarse limit to use for locating
\item{mzCoarse}{The coarse limit to use for locating
potential MS2 scans: this tolerance is used when finding
scans with a suitable precursor ion value.}
......@@ -36,6 +52,12 @@
scans: this tolerance is used when locating an
appropriate analyte peak in the MS1 precursor spectrum.}
\item{limit.coarse}{Parameter in \code{findMsMsHR.mass}
corresponding to \code{mzCoarse}. (The parameters are
distinct to clearly conceptually distinguish
findMsMsHR.mass (a standalone useful function) from the
cpdID based functions (workflow functions).)}
\item{mode}{The processing mode (determines which
ion/adduct is searched): \code{"pH", "pNa", "pM", "mH",
"mM", "mFA"} for different ions ([M+H]+, [M+Na]+, [M]+,
......@@ -61,6 +83,16 @@
return. One spectra group consists of all data-dependent
scans from the same precursor whose precursor mass
matches the specified search mass.}
\item{fillPrecursorScan}{If \code{TRUE}, the precursor
scan will be filled from MS1 data. To be used for data
where the precursor scan is not stored in the raw data.}
\item{rtMargin}{The retention time tolerance to use.}
\item{deprofile}{Whether deprofiling should take place,
and what method should be used (cf.
\code{\link{deprofile}})}
}
\value{
For \code{findMsMsHR} and \code{findMsMsHR.direct}: A
......@@ -86,7 +118,14 @@
}
\details{
Different versions of the function get the data from
different sources.
different sources. Note that findMsMsHR and
findMsMsHR.direct differ mainly in that findMsMsHR opens
a file whereas findMsMs.direct uses an open file handle -
both are intended to be used in a full process which
involves compound lists etc. In contrast, findMsMsHR.mass
is a low-level function which uses the mass directly for
lookup and is intended for use as a standalone function
in unrelated applications.
}
\examples{
\dontrun{
......
......@@ -2,8 +2,8 @@
\alias{findMsMsHRperxcms.direct}
\title{Read in mz-files using XCMS}
\usage{
findMsMsHRperxcms.direct(fileName, cpdID, mode,
findPeaksArgs)
findMsMsHRperxcms.direct(fileName, cpdID, mode="pH",
findPeaksArgs = NULL, plots = FALSE)
}
\arguments{
\item{fileName}{The path to the mz-file that should be
......
......@@ -4,12 +4,20 @@
\alias{recalibrateSpectra}
\title{Recalibrate MS/MS spectra}
\usage{
makeRecalibration(spec, mode)
makeRecalibration(spec, mode, recalibrateBy =
getOption("RMassBank")$recalibrateBy, recalibrateMS1 =
getOption("RMassBank")$recalibrateMS1, recalibrator =
getOption("RMassBank")$recalibrator,
recalibrateMS1Window =
getOption("RMassBank")$recalibrateMS1Window )
recalibrateSpectra(mode, rawspec = NULL, rc = NULL,
rc.ms1 = NULL, w = NULL)
rc.ms1=NULL, w = NULL, recalibrateBy =
getOption("RMassBank")$recalibrateBy, recalibrateMS1 =
getOption("RMassBank")$recalibrateMS1)
recalibrateSingleSpec(spectrum, rc)
recalibrateSingleSpec(spectrum, rc, recalibrateBy =
getOption("RMassBank")$recalibrateBy)
}
\arguments{
\item{spec}{For \code{recalibrateSpectra}: a list of
......@@ -32,6 +40,21 @@
\item{rc,rc.ms1}{The recalibration curves to be used in
the recalibration.}
\item{recalibrateBy}{Whether recalibration should be done
by ppm ("ppm") or by m/z ("mz").}
\item{recalibrateMS1}{Whether MS1 spectra should be
recalibrated separately ("separate"), together with MS2
("common") or not at all ("none"). Usually taken from
settings.}
\item{recalibrator}{The recalibrator functions to be
used. Refer to \code{\link{recalibrate}} for details.
Usually taken from settings.}
\item{recalibrateMS1Window}{Window width to look for MS1
peaks to recalibrate (in ppm).}
\item{w}{The \code{msmsWorkspace} to write the
calibration to or to get the calibration from.}
}
......
......@@ -2,9 +2,11 @@
\alias{msmsWorkflow}
\title{RMassBank mass spectrometry pipeline}
\usage{
msmsWorkflow(w, mode = "pH", steps = c(1:8), confirmMode
= FALSE, newRecalibration = TRUE, useRtLimit = TRUE,
archivename = NA, readMethod, findPeaksArgs)
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"))
}
\arguments{
\item{w}{A \code{msmsWorkspace} to work with.}
......@@ -46,6 +48,16 @@
\item{plots}{A parameter that determines whether the
spectra should be plotted or not (This parameter is only
used for the xcms-method)}
\item{precursorscan.cf}{Whether to fill precursor scans.
To be used with files which for some reasons do not
contain precursor scan IDs in the mzML, e.g. AB Sciex
converted files.}
\item{settings}{Options to be used for processing.
Defaults to the options loaded via
\code{\link{loadRmbSettings}} et al. Refer to there for
specific settings.}
}
\value{
The processed \code{msmsWorkspace}.
......
......@@ -3,10 +3,12 @@
\alias{plotRecalibration.direct}
\title{Plot the recalibration graph.}
\usage{
plotRecalibration(w)
plotRecalibration(w, recalibrateBy =
getOption("RMassBank")$recalibrateBy)
plotRecalibration.direct(rcdata, rc, rc.ms1, title,
mzrange)
mzrange, recalibrateBy =
getOption("RMassBank")$recalibrateBy)
}
\arguments{
\item{w}{The workspace to plot the calibration graph
......@@ -22,6 +24,10 @@
\item{title}{Prefix for the graph titles}
\item{mzrange}{m/z value range for the graph}
\item{recalibrateBy}{Whether recalibration was done by
ppm ("ppm") or by m/z ("mz"). Important only for graph
labeling here.}
}
\description{
Plot the recalibration graph.
......
......@@ -3,9 +3,11 @@
\alias{reanalyzeFailpeaks}
\title{Reanalyze unmatched peaks}
\usage{
reanalyzeFailpeaks(specs, custom_additions, mode)
reanalyzeFailpeaks(specs, custom_additions, mode,
filterSettings = getOption("RMassBank")$filterSettings)
reanalyzeFailpeak(custom_additions, mass, cpdID,
counter, pb = NULL, mode)
counter, pb = NULL, mode, filterSettings =
getOption("RMassBank")$filterSettings)
}
\arguments{
\item{specs}{An \code{aggregatedRcSpecs} object (after
......@@ -28,6 +30,9 @@
\item{pb}{A txtProgressBar object to display progress on.
No progress is displayed if NULL.}
\item{filterSettings}{Settings for filtering data. Refer
to\code{\link{analyzeMsMs}} for settings.}
}
\value{
The returning list contains two tables:
......
......@@ -2,7 +2,9 @@
\alias{recalibrate.addMS1data}
\title{Return MS1 peaks to be used for recalibration}
\usage{
recalibrate.addMS1data(spec,mode="pH", dppm=15)
recalibrate.addMS1data(spec,mode="pH",
recalibrateMS1Window =
getOption("RMassBank")$recalibrateMS1Window)
}
\arguments{
\item{spec}{A \code{aggregatedSpecs}-like object.}
......@@ -11,8 +13,8 @@
for different ions ([M+H]+, [M+Na]+, [M]+, [M-H]-, [M]-,
[M+FA]-).}
\item{dppm}{Delta ppm margin to use for locating the
precursor ion in the MS1.}
\item{recalibrateMS1Window}{Window width to look for MS1
peaks to recalibrate (in ppm).}
}
\value{
A dataframe with columns \code{mzFound, formula, mzCalc,
......
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