Skip to content
Snippets Groups Projects
Commit 7d8dbcb5 authored by Michele Stravs's avatar Michele Stravs
Browse files

Updated roxygen manpages

parent 64d3da74
No related branches found
No related tags found
No related merge requests found
Showing
with 605 additions and 646 deletions
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/webAccess.R
\name{CTS.externalIdSubset}
\alias{CTS.externalIdSubset}
\title{Select a subset of external IDs from a CTS record.}
\usage{
CTS.externalIdSubset(data, database)
CTS.externalIdSubset(data, database)
}
\arguments{
\item{data}{The complete CTS record as retrieved by
\code{\link{getCtsRecord}}.}
\item{data}{The complete CTS record as retrieved by \code{\link{getCtsRecord}}.}
\item{database}{The database for which keys should be
returned.}
\item{database}{The database for which keys should be returned.}
}
\value{
Returns an array of all external identifiers stored in
the record for the given database.
Returns an array of all external identifiers stored in the record for the
given database.
}
\description{
Select a subset of external IDs from a CTS record.
Select a subset of external IDs from a CTS record.
}
\examples{
\dontrun{
......@@ -26,6 +26,6 @@ cas <- CTS.externalIdSubset(data, "CAS")
}
}
\author{
Michele Stravs, Eawag <stravsmi@eawag.ch>
Michele Stravs, Eawag <stravsmi@eawag.ch>
}
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/webAccess.R
\name{CTS.externalIdTypes}
\alias{CTS.externalIdTypes}
\title{Find all available databases for a CTS record}
\usage{
CTS.externalIdTypes(data)
CTS.externalIdTypes(data)
}
\arguments{
\item{data}{The complete CTS record as retrieved by
\code{\link{getCtsRecord}}.}
\item{data}{The complete CTS record as retrieved by \code{\link{getCtsRecord}}.}
}
\value{
Returns an array of all database names for which there
are external identifiers stored in the record.
Returns an array of all database names for which there are external
identifiers stored in the record.
}
\description{
Find all available databases for a CTS record
Find all available databases for a CTS record
}
\examples{
\dontrun{
......@@ -25,6 +26,6 @@ databases <- CTS.externalIdTypes(data)
}
}
\author{
Michele Stravs, Eawag <stravsmi@eawag.ch>
Michele Stravs, Eawag <stravsmi@eawag.ch>
}
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/settings_example.R
\name{RmbDefaultSettings}
\alias{RmbDefaultSettings}
\alias{RmbSettingsTemplate}
......@@ -5,49 +7,43 @@
\alias{loadRmbSettingsFromEnv}
\title{RMassBank settings}
\usage{
loadRmbSettings(file_or_list)
loadRmbSettings(file_or_list)
loadRmbSettingsFromEnv(env = .GlobalEnv)
loadRmbSettingsFromEnv(env = .GlobalEnv)
RmbDefaultSettings()
RmbDefaultSettings()
RmbSettingsTemplate(target)
RmbSettingsTemplate(target)
}
\arguments{
\item{file_or_list}{The file (YML or R format) or R
\code{list} with the settings to load.}
\item{file_or_list}{The file (YML or R format) or R \code{list} with the settings to load.}
\item{target}{The path where the template setting file
should be stored.}
\item{target}{The path where the template setting file should be stored.}
\item{env}{The environment to load the settings from.}
\item{env}{The environment to load the settings from.}
}
\value{
None.
None.
}
\description{
Load, set and reset settings for RMassBank.
Load, set and reset settings for RMassBank.
}
\details{
\code{RmbSettingsTemplate} creates a template file in
which you can adjust the settings as you like. Before
using RMassBank, you must then load the settings file
using \code{loadRmbSettings}. \code{RmbDefaultSettings}
loads the default settings. \code{loadRmbSettingsFromEnv}
loads the settings stored in env$RmbSettings, which is
useful when reloading archives with saved settings
inside.
\code{RmbSettingsTemplate} creates a template file in which you can adjust the
settings as you like. Before using RMassBank, you must then load the
settings file using \code{loadRmbSettings}. \code{RmbDefaultSettings} loads
the default settings. \code{loadRmbSettingsFromEnv} loads the settings
stored in env$RmbSettings, which is useful when reloading archives with
saved settings inside.
Note: no settings are loaded upon loading MassBank! This
is intended, so that one never forgets to load the
correct settings.
Note: no settings are loaded upon loading MassBank!
This is intended, so that one never forgets to load the correct settings.
The settings are described in \code{\link{RmbSettings}}.
The settings are described in \code{\link{RmbSettings}}.
}
\note{
\bold{The default settings will not work for you unless
you have, by chance, installed OpenBabel into the same
directory as I have!}
\bold{The default settings will not work for you unless you have, by
chance, installed OpenBabel into the same directory as I have!}
}
\examples{
# Create a standard settings file and load it (unedited)
......@@ -56,9 +52,9 @@
unlink("mysettings.ini")
}
\author{
Michael Stravs
Michael Stravs
}
\seealso{
\code{\link{RmbSettings}}
\code{\link{RmbSettings}}
}
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/settings_example.R
\name{RmbSettings}
\alias{RmbSettings}
\title{RMassBank settings}
\description{
Describes all settings for the RMassBank settings file.
Describes all settings for the RMassBank settings file.
}
\details{
\itemize{ \item{\code{deprofile}}{ Whether and how to
deprofile input raw files. Leave the setting empty if
your raw files are already in "centroid" mode. If your
input files are in profile mode, you have the choice
between algorithms \code{\link{deprofile}.spline,
deprofile.fwhm, deprofile.localMax}; refer to the
individual manpages for more information.}
\item{\code{rtMargin, rtShift}}{ The allowed retention
time deviation relative to the values specified in your
compound list (see \code{\link{loadList}}), and the
systematic shift (due to the use of, e.g., pre-columns or
other special equipment.} \item{\code{babeldir}}{
Directory to OpenBabel. Required for creating molfiles
for MassBank export. If no OpenBabel directory is given,
RMassBank will attempt to use the CACTUS webservice for
SDF generation. It is strongly advised to install
OpenBabel; the CACTUS structures have explicit hydrogen
atoms. The path should point to the directory where
babel.exe (or the Linux "babel" equivalent) lies. }
\item{\code{use_version}}{ Which MassBank record format
to use; version 2 is strongly advised, version 1 is
considered outdated and should be used only if for some
reason you are running old servers and an upgrade is not
feasible.} \item{\code{use_rean_peaks}}{ Whether to
include peaks from reanalysis (see
\code{\link{reanalyzeFailpeaks}}) in the MassBank
records. Boolean, TRUE or FALSE. }
\item{\code{annotations}}{ A list of constant annotations
to use in the MassBank records. The entries
\code{authors, copyright, license, instrument,
instrument_type, compound_class} correspond to the
MassBank entries \code{AUTHORS, COPYRIGHT, PUBLICATION,
LICENSE, AC$INSTRUMENT, AC$INSTRUMENT_TYPE,
CH$COMPOUND_CLASS}. The entry \code{confidence_comment}
is added as \code{COMMENT: CONFIDENCE} entry.
\itemize{
\item{\code{deprofile}}{
Whether and how to deprofile input raw files. Leave the
setting empty if your raw files are already in "centroid" mode. If your
input files are in profile mode, you have the choice between algorithms
\code{\link{deprofile}.spline, deprofile.fwhm, deprofile.localMax}; refer to
the individual manpages for more information.}
\item{\code{rtMargin, rtShift}}{
The allowed retention time deviation relative to the
values specified in your compound list (see \code{\link{loadList}}), and the systematic
shift (due to the use of, e.g., pre-columns or other special equipment.}
\item{\code{babeldir}}{
Directory to OpenBabel. Required for creating molfiles for MassBank export.
If no OpenBabel directory is given, RMassBank will attempt to use the CACTUS webservice
for SDF generation. It is strongly advised to install OpenBabel; the CACTUS structures
have explicit hydrogen atoms.
The path should point to the directory where babel.exe (or the Linux "babel" equivalent) lies.
}
\item{\code{use_version}}{
Which MassBank record format to use; version 2 is strongly advised,
version 1 is considered outdated and should be used only if for some reason you are running
old servers and an upgrade is not feasible.}
\item{\code{use_rean_peaks}}{
Whether to include peaks from reanalysis (see
\code{\link{reanalyzeFailpeaks}}) in the MassBank records. Boolean, TRUE or FALSE.
}
\item{\code{annotations}}{
A list of constant annotations to use in the MassBank records. The entries
\code{authors, copyright, license, instrument, instrument_type, compound_class}
correspond to the MassBank entries \code{AUTHORS, COPYRIGHT, PUBLICATION, LICENSE, AC$INSTRUMENT,
AC$INSTRUMENT_TYPE, CH$COMPOUND_CLASS}. The entry \code{confidence_comment} is added as
\code{COMMENT: CONFIDENCE} entry.
The entry \code{internal_id_fieldname} is used to name
the MassBank entry which will keep a reference to the
internal compound ID used in the workflow: for
\code{internal_id_fieldname = MYID} and e.g. compound
1234, an entry will be added to the MassBank record with
\code{COMMENT: MYID 1234}. The internal fieldname should
not be left empty!
The entry \code{internal_id_fieldname} is used to name
the MassBank entry which will keep a reference to the internal compound ID used in
the workflow: for \code{internal_id_fieldname = MYID} and e.g. compound 1234, an
entry will be added to the MassBank record with
\code{COMMENT: MYID 1234}. The internal fieldname should not be left empty!
The entries \code{lc_gradient, lc_flow, lc_solvent_a,
lc_solvent_b, lc_column} correspond to the MassBank
entries \code{AC$CHROMATOGRAPHY: FLOW_GRADIENT,
FLOW_RATE, SOLVENT A, SOLVENT B, COLUMN_NAME}.
The entries \code{lc_gradient, lc_flow, lc_solvent_a, lc_solvent_b, lc_column} correspond
to the MassBank entries \code{AC$CHROMATOGRAPHY: FLOW_GRADIENT, FLOW_RATE,
SOLVENT A, SOLVENT B, COLUMN_NAME}.
\code{ms_type, ionization} correspond to
\code{AC$MASS_SPECTROMETRY: MS_TYPE, IONIZATION}.
\code{ms_type, ionization} correspond to \code{AC$MASS_SPECTROMETRY: MS_TYPE, IONIZATION}.
\code{entry_prefix} is the two-letter prefix used when
building MassBank accession codes.
\code{entry_prefix} is the two-letter prefix used when building MassBank accession codes.
Entries under \code{ms_dataprocessing} are added as
\code{MS$DATA_PROCESSING:} entries, in addition to the
default \code{WHOLE: RMassBank}. }
\item{\code{annotator}}{ For advanced users: option to
select your own custom annotator. Check
\code{\link{annotator.default}} and the source code for
details.} \item{\code{spectraList}}{ This setting
describes the experimental annotations for the single
data-dependent scans. For every data-dependent scan
event, a \code{spectraList} entry with \code{mode, ces,
ce, res} denoting collision mode, collision energy in
short and verbose notation, and FT resolution.}
\item{\code{accessionNumberShifts}}{ This denotes the
starting points for accession numbers for different ion
types. For example, \code{pH: 0, mH: 50} means that
[M+H]+ spectra will start at \code{XX123401} (\code{XX}
being the \code{entry_prefix} and \code{1234} the
compound id) and [M-H]- will start at \code{XX123451}.}
\item{\code{electronicNoise, electronicNoiseWidth}}{
Known electronic noise peaks and the window to be used by
\code{\link{cleanElnoise}}} \item{\code{recalibrateBy}}{
\code{dppm} or \code{dmz} to recalibrate either by delta
ppm or by delta mz.} \item{\code{recalibrateMS1}}{
\code{common} or \code{separate} to recalibrate MS1 data
points together or separately from MS2 data points.}
\item{\code{recalibrator: MS1, MS2}}{ The functions to
use for recalibration of MS1 and MS2 data points. Note
that the \code{MS1} setting is only meaningful if
\code{recalibrateMS1: separate}, otherwise the \code{MS2}
setting is used for a common recalibration curve. See
\code{\link{recalibrate.loess}} for details.}
\item{\code{multiplicityFilter}}{ Define the multiplicity
filtering level. Default is 2, a value of 1 is off (no
filtering) and >2 is harsher filtering.}
\item{\code{titleFormat}}{ The title of MassBank records
is a mini-summary of the record, for example
"Dinotefuran; LC-ESI-QFT; MS2; CE: 35%; R=35000; [M+H]+".
By default, the first compound name \code{CH$NAME},
instrument type \code{AC$INSTRUMENT_TYPE}, MS/MS type
\code{AC$MASS_SPECTROMETRY: MS_TYPE}, collision energy
\code{RECORD_TITLE_CE}, resolution
\code{AC$MASS_SPECTROMETRY: RESOLUTION} and precursor
\code{MS$FOCUSED_ION: PRECURSOR_TYPE} are used. If
alternative information is relevant to differentiate
acquired spectra, the title should be adjusted. For
example, many TOFs do not have a resolution setting. See
MassBank documentation for more.}
\item{\code{filterSettings}}{ A list of settings that
affect the MS/MS processing. The entries
\code{ppmHighMass, ppmLowMass, massRangeDivision} set
values for pre-processing, prior to recalibration.
\code{ppmHighMass} defines the ppm error for the high
mass range (default 10 ppm for Orbitraps),
\code{ppmLowMass} is the error for the low mass range
(default 15 ppm for Orbitraps) and
\code{massRangeDivision} is the m/z value defining the
split between the high and low mass range (default m/z =
120).
Entries under \code{ms_dataprocessing} are added as \code{MS$DATA_PROCESSING:} entries,
in addition to the default \code{WHOLE: RMassBank}.
}
\item{\code{annotator}}{
For advanced users: option to select your own custom annotator.
Check \code{\link{annotator.default}} and the source code for details.}
\item{\code{spectraList}}{
This setting describes the experimental annotations for the single
data-dependent scans. For every data-dependent scan event, a \code{spectraList} entry with
\code{mode, ces, ce, res} denoting collision mode, collision energy in short and verbose
notation, and FT resolution.}
\item{\code{accessionNumberShifts}}{
This denotes the starting points for accession numbers
for different ion types. For example, \code{pH: 0, mH: 50} means that [M+H]+ spectra will
start at \code{XX123401} (\code{XX} being the \code{entry_prefix} and \code{1234} the compound
id) and [M-H]- will start at \code{XX123451}.}
\item{\code{electronicNoise, electronicNoiseWidth}}{
Known electronic noise peaks and the window
to be used by \code{\link{cleanElnoise}}}
\item{\code{recalibrateBy}}{
\code{dppm} or \code{dmz} to recalibrate either by delta ppm or by
delta mz.}
\item{\code{recalibrateMS1}}{
\code{common} or \code{separate} to recalibrate MS1 data points together
or separately from MS2 data points.}
\item{\code{recalibrator: MS1, MS2}}{
The functions to use for recalibration of MS1 and MS2 data points.
Note that the \code{MS1} setting is only meaningful if \code{recalibrateMS1: separate}, otherwise
the \code{MS2} setting is used for a common recalibration curve. See \code{\link{recalibrate.loess}}
for details.}
\item{\code{multiplicityFilter}}{
Define the multiplicity filtering level. Default is 2, a value of 1
is off (no filtering) and >2 is harsher filtering.}
\item{\code{titleFormat}}{
The title of MassBank records is a mini-summary
of the record, for example "Dinotefuran; LC-ESI-QFT; MS2; CE: 35%; R=35000; [M+H]+".
By default, the first compound name \code{CH$NAME}, instrument type
\code{AC$INSTRUMENT_TYPE}, MS/MS type \code{AC$MASS_SPECTROMETRY: MS_TYPE},
collision energy \code{RECORD_TITLE_CE}, resolution \code{AC$MASS_SPECTROMETRY: RESOLUTION}
and precursor \code{MS$FOCUSED_ION: PRECURSOR_TYPE} are used. If alternative
information is relevant to differentiate acquired spectra, the title should be adjusted.
For example, many TOFs do not have a resolution setting.
See MassBank documentation for more.}
\item{\code{filterSettings}}{
A list of settings that affect the MS/MS processing. The entries
\code{ppmHighMass, ppmLowMass, massRangeDivision} set values for
pre-processing, prior to recalibration. \code{ppmHighMass} defines the
ppm error for the high mass range (default 10 ppm for Orbitraps),
\code{ppmLowMass} is the error for the low mass range (default 15 ppm
for Orbitraps) and \code{massRangeDivision} is the m/z value defining
the split between the high and low mass range (default m/z = 120).
The entry \code{ppmFine} defines the ppm cut-off post
recalibration. The default value of 5 ppm is recommended
for Orbitraps. For other instruments this can be
interpreted from the recalibration plot. All ppm limits
are one-sided (e.g. this includes values to +5 ppm or -5
ppm deviation from the exact mass).
The entry \code{ppmFine} defines the ppm cut-off post recalibration.
The default value of 5 ppm is recommended for Orbitraps. For other
instruments this can be interpreted from the recalibration plot.
All ppm limits are one-sided (e.g. this includes values to +5 ppm or -5 ppm
deviation from the exact mass).
The entries \code{prelimCut, prelimCutRatio} define the
intensity cut-off and cut-off ratio (in % of the most
intense peak) for pre-processing. This affects the peak
selection for the recalibration only. Careful: the
default value 1e4 for Orbitrap LTQ positive mode could
remove all peaks for TOF data and will remove too many
peaks for Orbitrap LTQ negative mode spectra!
The entries \code{prelimCut, prelimCutRatio} define the intensity cut-off and
cut-off ratio (in % of the most intense peak) for pre-processing. This affects
the peak selection for the recalibration only. Careful: the default value
1e4 for Orbitrap LTQ positive mode could remove all peaks for TOF data
and will remove too many peaks for Orbitrap LTQ negative mode spectra!
The entry \code{specOKLimit} defines the intensity limit
to include MS/MS spectra. MS/MS spectra must have at
least one peak above this limit to proceed through the
workflow.
The entry \code{specOKLimit} defines the intensity limit to include MS/MS spectra.
MS/MS spectra must have at least one peak above this limit to proceed through
the workflow.
\code{dbeMinLimit} defines the minimum allowable ring and
double bond equivalents (DBE) allowed for assigned
formulas. This assumes maximum valuences for elements
with multiple valence states. The default is -0.5
(accounting for fragments being ions).
\code{dbeMinLimit} defines the minimum allowable ring and double bond equivalents (DBE)
allowed for assigned formulas. This assumes maximum valuences for elements with
multiple valence states. The default is -0.5 (accounting for fragments being ions).
The entries \code{satelliteMzLimit, satelliteIntLimit}
define the cut-off m/z and intensity values for satellite
peak removal (an artefact of Fourier Transform
processing). All peaks within the m/z limit (default 0.5)
and intensity ratio (default 0.05 or 5 %) of the
respective peak will be removed. Applicable to Fourier
Transform instruments only (e.g. Orbitrap). }
\item{\code{filterSettings}}{ Parameters for adjusting
the raw data retrieval. The entry \code{ppmFine} defines
the ppm error to look for the precursor in the MS1
(parent) spectrum. Default is 10 ppm for Orbitrap.
The entries \code{satelliteMzLimit, satelliteIntLimit} define the cut-off m/z and
intensity values for satellite peak removal (an artefact of Fourier Transform
processing). All peaks within the m/z limit (default 0.5) and intensity ratio
(default 0.05 or 5 %) of the respective peak will be removed. Applicable to
Fourier Transform instruments only (e.g. Orbitrap).
}
\item{\code{filterSettings}}{
Parameters for adjusting the raw data retrieval.
The entry \code{ppmFine} defines the ppm error to look for the precursor in
the MS1 (parent) spectrum. Default is 10 ppm for Orbitrap.
\code{mzCoarse} defines the error to search for the
precursor specification in the MS2 spectrum. This is
often only saved to 2 decimal places and thus can be
quite inaccurate. The accuracy also depends on the
isolation window used. The default settings (for e.g.
Orbitrap) is 0.5 (Da, or Th for m/z).
\code{mzCoarse} defines the error to search for the precursor specification
in the MS2 spectrum. This is often only saved to 2 decimal places and thus
can be quite inaccurate. The accuracy also depends on the isolation window used.
The default settings (for e.g. Orbitrap) is 0.5 (Da, or Th for m/z).
The entry \code{fillPrecursorScan} is largely untested.
The default value (FALSE) assumes all necessary precursor
information is available in the mzML file. A setting ot
TRUE tries to fill in the precursor data scan number if
it is missing. Only tested on one case study so far -
feedback welcome! } }
The entry \code{fillPrecursorScan} is largely untested. The default value
(FALSE) assumes all necessary precursor information is available in the mzML file.
A setting ot TRUE tries to fill in the precursor data scan number if it is missing.
Only tested on one case study so far - feedback welcome!
}
}
}
\author{
Michael Stravs, Emma Schymanski
Michael Stravs, Emma Schymanski
}
\seealso{
\code{\link{loadRmbSettings}}
\code{\link{loadRmbSettings}}
}
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/formulaCalculator.R
\name{add.formula}
\alias{add.formula}
\alias{multiply.formula}
\title{Calculations on molecular formulas}
\usage{
add.formula(f1, f2, as.formula = TRUE, as.list = FALSE)
multiply.formula(f1, n, as.formula = TRUE, as.list =
FALSE)
add.formula(f1, f2, as.formula = TRUE, as.list = FALSE)
multiply.formula(f1, n, as.formula = TRUE, as.list = FALSE)
}
\arguments{
\item{f1,f2}{Molecular formulas (in list form or in text
form) to calculate with.}
\item{f1,f2}{Molecular formulas (in list form or in text form) to calculate
with.}
\item{n}{Multiplier (positive or negative, integer or
non-integer.)}
\item{as.formula}{Return the result as a text formula (e.g.
\code{"C6H12O6"}). This is the default}
\item{as.formula}{Return the result as a text formula
(e.g. \code{"C6H12O6"}). This is the default}
\item{as.list}{Return the result in list format (e.g. \code{list(C=6, H=12,
O=6)}).}
\item{as.list}{Return the result in list format (e.g.
\code{list(C=6, H=12, O=6)}).}
\item{n}{Multiplier (positive or negative, integer or non-integer.)}
}
\value{
The resulting formula, as specified above.
The resulting formula, as specified above.
}
\description{
Add, subtract, and multiply molecular formulas.
Add, subtract, and multiply molecular formulas.
}
\details{
Note that the results are not checked for plausibility at
any stage, nor reordered.
Note that the results are not checked for plausibility at any stage, nor
reordered.
}
\examples{
##
......@@ -38,11 +38,10 @@ add.formula("C6H12O6", "C-3H-3")
add.formula("C6H12O6", multiply.formula("C3H3", -1))
}
\author{
Michael Stravs
Michael Stravs
}
\seealso{
\code{\link{formulastring.to.list}},
\code{\link{is.valid.formula}},
\code{\link{order.formula}}
\code{\link{formulastring.to.list}}, \code{\link{is.valid.formula}},
\code{\link{order.formula}}
}
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/leMsmsRaw.R
\name{addMB}
\alias{addMB}
\title{MassBank-record Addition}
\usage{
addMB(w, cpdID, fileName, mode)
addMB(w, cpdID, fileName, mode)
}
\arguments{
\item{w}{The msmsWorkspace that the peaklist should be
added to.}
\item{w}{The msmsWorkspace that the peaklist should be added to.}
\item{cpdID}{The compoundID of the compound that has been
used for the record}
\item{cpdID}{The compoundID of the compound that has been used for the record}
\item{fileName}{The path to the record}
\item{fileName}{The path to the record}
\item{mode}{The ionization mode that has been used to
create the record}
\item{mode}{The ionization mode that has been used to create the record}
}
\value{
The \code{msmsWorkspace} with the additional peaklist
from the record
The \code{msmsWorkspace} with the additional peaklist from the record
}
\description{
Adds the peaklist of a MassBank-Record to the specs of an
msmsWorkspace
Adds the peaklist of a MassBank-Record to the specs of an msmsWorkspace
}
\examples{
\dontrun{
......@@ -30,9 +27,9 @@
}
}
\author{
Erik Mueller
Erik Mueller
}
\seealso{
\code{\link{addPeaksManually}}
\code{\link{addPeaksManually}}
}
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/createMassBank.R
\name{addPeaks}
\alias{addPeaks}
\title{Add additional peaks to spectra}
\usage{
addPeaks(mb, filename_or_dataframe)
addPeaks(mb, filename_or_dataframe)
}
\arguments{
\item{mb}{The \code{mbWorkspace} to load the peaks into.}
\item{mb}{The \code{mbWorkspace} to load the peaks into.}
\item{filename_or_dataframe}{Filename of the csv file, or
name of the R dataframe containing the peaklist.}
\item{filename_or_dataframe}{Filename of the csv file, or name of the R
dataframe containing the peaklist.}
}
\value{
The \code{mbWorkspace} with loaded additional peaks.
The \code{mbWorkspace} with loaded additional peaks.
}
\description{
Loads a table with additional peaks to add to the
MassBank spectra. Required columns are \code{cpdID, scan,
int, mzFound, OK}.
Loads a table with additional peaks to add to the MassBank spectra. Required
columns are \code{cpdID, scan, int, mzFound, OK}.
}
\details{
All peaks with OK=1 will be included in the spectra.
All peaks with OK=1 will be included in the spectra.
}
\examples{
\dontrun{addPeaks("myrun_additionalPeaks.csv")}
}
\author{
Michael Stravs
Michael Stravs
}
\seealso{
\code{\link{mbWorkflow}}
\code{\link{mbWorkflow}}
}
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/leMsmsRaw.R
\name{addPeaksManually}
\alias{addPeaksManually}
\title{Addition of manual peaklists}
\usage{
addPeaksManually(w, cpdID, handSpec, mode)
addPeaksManually(w, cpdID, handSpec, mode)
}
\arguments{
\item{w}{The msmsWorkspace that the peaklist should be
added to.}
\item{w}{The msmsWorkspace that the peaklist should be added to.}
\item{cpdID}{The compoundID of the compound that has been
used for the peaklist}
\item{cpdID}{The compoundID of the compound that has been used for the peaklist}
\item{handSpec}{A peaklist with 2 columns, one with "mz",
one with "int"}
\item{handSpec}{A peaklist with 2 columns, one with "mz", one with "int"}
\item{mode}{The ionization mode that has been used for
the spectrum represented by the peaklist}
\item{mode}{The ionization mode that has been used for the spectrum represented by the peaklist}
}
\value{
The \code{msmsWorkspace} with the additional peaklist
added to the right spectrum
The \code{msmsWorkspace} with the additional peaklist added to the right spectrum
}
\description{
Adds a manual peaklist in matrix-format
Adds a manual peaklist in matrix-format
}
\examples{
\dontrun{
......@@ -32,9 +29,9 @@
}
}
\author{
Erik Mueller
Erik Mueller
}
\seealso{
\code{\link{msmsWorkflow}}
\code{\link{msmsWorkflow}}
}
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/AggregateMethods.R
\docType{methods}
\name{addProperty}
\alias{addProperty}
\alias{addProperty,data.frame,character,character-method}
\title{Add and initialize dataframe column}
\usage{
addProperty(o, name, type, value = NA)
\S4method{addProperty}{data.frame,character,character}(o, name, type,
value = NA)
}
\arguments{
\item{o}{\code{data.frame} to add the column to}
\item{name}{Name of the new column}
\item{type}{Data type of the new column}
\item{value}{Initial value of the new column (\code{NA} if not given)}
}
\value{
Expanded data frame.
}
\description{
Adds a new column of a defined type to a \code{data.frame} and initializes it to a value.
The advantage of doing this over adding it with \code{$} or \code{[,""]} is that the case
\code{nrow(o) == 0} is adequately handled and doesn't raise an error.
}
\section{Methods (by class)}{
\itemize{
\item \code{o = data.frame,name = character,type = character}:
}}
\author{
stravsmi
}
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/leMsMs.r
\name{aggregateSpectra}
\alias{aggregateSpectra}
\title{Aggregate analyzed spectra}
\usage{
aggregateSpectra(spec, addIncomplete=FALSE, spectraList =
getOption("RMassBank")$spectraList)
aggregateSpectra(spec, addIncomplete=FALSE)
}
\arguments{
\item{spec}{The set of spectra to aggregate}
\item{spec}{The \code{RmbSpectraSetList} of spectra sets (\code{RmbSpectraSet} objects) to aggregate}
\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.}
\item{addIncomplete}{Whether or not the peaks from incomplete files (files
for which less than the maximal number of spectra are present)}
}
\value{
\item{foundOK }{ A numeric vector with the compound IDs
of all files for which spectra were found.
\code{names(foundOK)} are the filenames.} \item{foundFail
}{ A numeric vector with the compound IDs of all files
for which no spectra were found. \code{names(foundOK)}
are the filenames.} \item{spectraFound }{ A numeric
vector indicated the number of found spectra per
compound} \item{specFound }{ A list of processed spectral
data for all compounds with at least 1 found spectrum, as
returned by \code{\link{analyzeMsMs}}.} \item{specEmpty
}{ A list of (not-really-)processed spectral data for
compounds without spectra.} \item{specComplete }{ A list
of processed spectral data for all compounds with the
full spectrum count (i.e.
\code{length(getOption("RMassBank")$spectraList)}
spectra.) As such, \code{specComplete} is a subset of
\code{specFound}.} \item{specIncomplete}{ A list of
processed spectral data for all compounds with incomplete
spectrum count. The complement to \code{specComplete}.}
\item{peaksMatched }{ A dataframe of all peaks with a
matched formula, which survived the elimination criteria.
} \item{peaksUnmatched }{ A dataframe of all peaks
without a matched formula, or with a formula which failed
the filter criteria.}
A summary \code{data.frame} with all peaks (possibly multiple rows for one m/z value from a spectrum, see below) with columns:
\item{mzFound, intensity}{Mass and intensity of the peak}
\item{good}{if the peak passes filter criteria}
\item{mzCalc, formula, dbe, dppm}{calculated mass, formula, dbe and ppm deviation of the assigned formula}
\item{formulaCount, dppmBest}{Number of matched formulae for this m/z value, and ppm deviation of the best match}
\item{scan, cpdID, parentScan}{Scan number of the child and parent spectrum in the raw file, also the compound ID to which the peak belongs}
\item{dppmRc}{ppm deviation recalculated from the aggregation function}
\item{index}{Aggregate-table peak index, so the table can be subsetted, edited and results reinserted back into this table easily}
Further columns are later added by workflow steps 6 (electronic noise culler), 7 and 8.
}
\description{
Groups an array of analyzed spectra and creates
aggregated peak tables
Groups an array of analyzed spectra and creates aggregated peak tables
}
\details{
\code{\var{addIncomplete}} is relevant for recalibration.
For recalibration, we want to use only high-confidence
peaks, therefore we set \code{\var{addIncomplete}} to
\code{FALSE}. When we want to generate a peak list for
actually generating MassBank records, we want to include
all peaks into the peak tables.
\code{\var{addIncomplete}} is relevant for recalibration. For recalibration,
we want to use only high-confidence peaks, therefore we set
\code{\var{addIncomplete}} to \code{FALSE}. When we want to generate a peak
list for actually generating MassBank records, we want to include all peaks
into the peak tables.
}
\examples{
## As used in the workflow:
\dontrun{\%
analyzedRcSpecs <- lapply(recalibratedSpecs, function(spec)
w@spectra <- lapply(w@spectra, function(spec)
analyzeMsMs(spec, mode="pH", detail=TRUE, run="recalibrated", cut=0, cut_ratio=0 ) )
aggregatedSpecs <- aggregateSpectra(analyzedSpecs)
w@aggregate <- aggregateSpectra(w@spectra)
}
}
\author{
Michael Stravs
Michael Stravs
}
\seealso{
\code{\link{msmsWorkflow}}, \code{\link{analyzeMsMs}}
\code{\link{msmsWorkflow}}, \code{\link{analyzeMsMs}}
}
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/leMsMs.r
\name{analyzeMsMs}
\alias{analyzeMsMs}
\alias{analyzeMsMs.formula}
\alias{analyzeMsMs.intensity}
\title{Analyze MSMS spectra}
\usage{
analyzeMsMs(msmsPeaks, mode="pH", detail=FALSE,
run="preliminary", filterSettings =
getOption("RMassBank")$filterSettings, spectraList =
getOption("RMassBank")$spectraList, method="formula")
analyzeMsMs(msmsPeaks, mode = "pH", detail = FALSE, run = "preliminary",
filterSettings = getOption("RMassBank")$filterSettings,
spectraList = getOption("RMassBank")$spectraList, method = "formula")
analyzeMsMs.formula(msmsPeaks, mode="pH", detail=FALSE,
run="preliminary", filterSettings =
getOption("RMassBank")$filterSettings, spectraList =
getOption("RMassBank")$spectraList)
analyzeMsMs.formula(msmsPeaks, mode = "pH", detail = FALSE,
run = "preliminary",
filterSettings = getOption("RMassBank")$filterSettings)
analyzeMsMs.intensity(msmsPeaks, mode="pH", detail=FALSE,
run="preliminary", filterSettings =
getOption("RMassBank")$filterSettings, spectraList =
getOption("RMassBank")$spectraList)
analyzeMsMs.intensity(msmsPeaks, mode = "pH", detail = FALSE,
run = "preliminary",
filterSettings = getOption("RMassBank")$filterSettings)
}
\arguments{
\item{msmsPeaks}{A group of parent spectrum and
data-dependent MSMS spectra as returned from
\code{\link{findMsMsHR}} (refer to the corresponding
documentation for the precise format specifications).}
\item{msmsPeaks}{A \code{RmbSpectraSet} object.
Corresponds to a parent spectrum and children MSMS spectra of one compound (plus some metadata).
The objects are typically generated with \code{\link{findMsMsHR}}, and populate the \code{@spectrum} slot
in a \code{msmsWorkspace} (refer to the corresponding
documentation for the precise format specifications).}
\item{mode}{Specifies the processing mode, i.e. which
molecule species the spectra contain. \code{\var{pH}}
(positive H) specifies [M+H]+, \code{\var{pNa}} specifies
[M+Na]+, \code{\var{pM}} specifies [M]+, \code{\var{mH}}
and \code{\var{mNa}} specify [M-H]- and [M-Na]-,
respectively. (I apologize for the naming of
\code{\var{pH}} which has absolutely nothing to do with
chemical \emph{pH} values.)}
\item{mode}{Specifies the processing mode, i.e. which molecule species the
spectra contain. \code{\var{pH}} (positive H) specifies [M+H]+,
\code{\var{pNa}} specifies [M+Na]+, \code{\var{pM}} specifies [M]+,
\code{\var{mH}} and \code{\var{mNa}} specify [M-H]- and [M-Na]-,
respectively. (I apologize for the naming of \code{\var{pH}} which has
absolutely nothing to do with chemical \emph{pH} values.)}
\item{detail}{Whether detailed return information should
be provided (defaults to \code{FALSE}). See below.}
\item{detail}{Whether detailed return information should be provided
(defaults to \code{FALSE}). See below.}
\item{run}{\code{"preliminary"} or \code{"recalibrated"}.
In the \code{preliminary} run, mass tolerance is set to
10 ppm (above m/z 120) and 15 ppm (below m/z 120), the
default intensity cutoff is $10^4$ for positive mode (no
default cutoff in negative mode), and the column
\code{"mz"} from the spectra is used as data source. In
the \code{recalibrated} run, the mass tolerance is set to
5 ppm over the whole mass range, the default cutoff is 0
and the column \code{"mzRecal"} is used as source for the
m/z values. Defaults to \code{"preliminary"}.}
\item{run}{\code{"preliminary"} or \code{"recalibrated"}. In the
\code{preliminary} run, mass tolerance is set to 10 ppm (above m/z 120) and
15 ppm (below m/z 120), the default intensity cutoff is $10^4$ for positive
mode (no default cutoff in negative mode), and the column \code{"mz"} from
the spectra is used as data source. In the \code{recalibrated} run, the
mass tolerance is set to 5 ppm over the whole mass range, the default cutoff
is 0 and the column \code{"mzRecal"} is used as source for the m/z values.
Defaults to \code{"preliminary"}.}
\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{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{spectraList}{The list of MS/MS spectra present in
each data block. As also defined in the settings file.}
\item{spectraList}{The list of MS/MS spectra present in each data block. As also
defined in the settings file.}
\item{method}{Selects which function to actually use for
data evaluation. The default "formula" runs a full
analysis via formula assignment to fragment peaks. The
alternative setting "intensity" calls a "mock"
implementation which circumvents formula assignment and
filters peaks purely based on intensity cutoffs and the
satellite filtering. (In this case, the ppm and dbe
related settings in filterSettings are ignored.)}
\item{method}{Selects which function to actually use for data evaluation. The default
"formula" runs a full analysis via formula assignment to fragment peaks. The
alternative setting "intensity" calls a "mock" implementation which circumvents
formula assignment and filters peaks purely based on intensity cutoffs and the
satellite filtering. (In this case, the ppm and dbe related settings in filterSettings
are ignored.)}
}
\value{
\item{list("foundOK")}{ Boolean. Whether or not child
spectra are present for this compound (inherited from
\code{msmsdata}).} \item{list("mzrange")}{ The maximum
m/z range over all child spectra.} \item{list("id")}{ The
compound ID (inherited from \code{msmsdata})}
\item{list("mode")}{ processing mode}
\item{list("parentHeader")}{ Parent spectrum header data
(ex \code{msmsdata})} \item{list("parentMs")}{ Parent
spectrum (ex \code{msmsdata}) in matrix format}
\item{list("msmsdata")}{ Analysis results for all child
spectra: \itemize{ \item\code{specOK} Boolean. Whether or
not the spectrum contains any useful peaks. If
\code{specOK = FALSE}, all other information (except scan
info and compound ID) may be missing! \item\code{parent}
Parent mass and formula in a one-row data frame format.
Currently rather obsolete, originally contained data from
MolgenMsMs results. \item \code{childFilt} Annotated
peaks of the MSMS spectrum (after filtering by accuracy)
\item \code{childRaw} Raw (\code{mz, int}) spectrum
before any treatment. (With recalibrated data, this is
(\code{mz, int, mzRecal}). } For \code{detail = TRUE},
additionally: \itemize{ \item\code{childRawLow} Peaks cut
away because of low (absolute or relative) intensity
\item\code{childRawSatellite} Peaks cut away
as"satellites" \item\code{childRawOK} Peaks after cutting
away low/satellite peaks. Used for further analysis steps
\item\code{child} Annotated peaks of the MSMS spectrum
before filtering by accuracy \item \code{childBad}
Annotated peaks of the MSMS spectrum which didn't pass
the accuracy threshold \item\code{childUnmatched} Peaks
of the MSMS spectrum with no annotated formula }}
The processed \code{RmbSpectraSet} object.
Added (or filled, respectively, since the slots are present before) data include
\item{list("complete")}{whether all spectra have useful value}
\item{list("empty")}{whether there are no useful spectra}
\item{list("children")}{
The processed \code{RmbSpectrum2} objects (in a \code{RmbSpectrum2List}).
\itemize{
\item \code{ok} if the spectrum was successfully processed with at least one resulting peak
\item \code{mz}, \code{intensity}: note that mz/int pairs can be duplicated when multiple matches
are found for one mz value, therefore the two slots are not necessarily unchanged from before
\item \code{rawOK} (logical) whether the m/z peak passes satellite/low removal
\item \code{low}, \code{satellite} if \code{TRUE}, the peak failed cutoff (\code{low}) or was removed as \code{satellite}
\item \code{formula}, \code{mzCalc}, \code{dppm}, \code{dbe} Formula, calculated mass, ppm deviation and dbe assigned to a peak
\item \code{formulaCount}, \code{dppmBest} Number of formulae matched for this m/z value and ppm deviation of the best match
\item \code{info} Spectrum identifying information (collision energy, resolution, collision mode) from
the \code{spectraList}
\item All other entries are retained from the original \code{RmbSpectrum2}.
}
}
}
\description{
Analyzes MSMS spectra of a compound by fitting formulas
to each subpeak.
Analyzes MSMS spectra of a compound by fitting formulas to each subpeak.
}
\details{
The analysis function uses Rcdk. Note that in this step,
\emph{satellite peaks} are removed by a simple heuristic
rule (refer to the documentation of
\code{\link{filterPeakSatellites}} for details.)
The analysis function uses Rcdk. Note
that in this step, \emph{satellite peaks} are removed by a simple heuristic
rule (refer to the documentation of \code{\link{filterPeakSatellites}} for details.)
}
\section{Functions}{
\itemize{
\item \code{analyzeMsMs.formula}:
\item \code{analyzeMsMs.intensity}:
}}
\examples{
\dontrun{analyzed <- analyzeMsMs(spec, "pH", TRUE)}
}
\author{
Michael Stravs
Michael Stravs
}
\seealso{
\code{\link{msmsWorkflow}},
\code{\link{filterLowaccResults}},
\code{\link{filterPeakSatellites}},
\code{\link{reanalyzeFailpeaks}}
\code{\link{msmsWorkflow}}, \code{\link{filterLowaccResults}},
\code{\link{filterPeakSatellites}}, \code{\link{reanalyzeFailpeaks}}
}
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/createMassBank.R
\name{annotator.default}
\alias{annotator.default}
\title{Generate peak annotation from peaklist}
\usage{
annotator.default(annotation, type)
annotator.default(annotation, type)
}
\arguments{
\item{annotation}{A peak list to be annotated. Contains
columns: \code{"cpdID","formula","mzFound"
,"scan","mzCalc","dppm",
"dbe","mz","int","formulaCount","parentScan","fM_factor","dppmBest",
"formulaMultiplicity","intrel","mzSpec"}}
\item{annotation}{A peak list to be annotated. Contains columns:
\code{"cpdID","formula","mzFound" ,"scan","mzCalc","dppm",
"dbe","mz","int","formulaCount","parentScan","fM_factor","dppmBest",
"formulaMultiplicity","intrel","mzSpec"}}
\item{type}{The ion type to be added to annotated
formulas ("+" or "-" usually)}
\item{type}{The ion type to be added to annotated formulas ("+" or "-" usually)}
}
\value{
The annotated peak table. Table \code{colnames()} will be
used for the titles (preferrably don't use spaces in the
column titles; however no format is strictly enforced by
the MassBank data format.
The annotated peak table. Table \code{colnames()} will be used for the
titles (preferrably don't use spaces in the column titles; however no format is
strictly enforced by the MassBank data format.
}
\description{
Generates the PK$ANNOTATION entry from the peaklist
obtained. This function is overridable by using the
"annotator" option in the settings file.
Generates the PK$ANNOTATION entry from the peaklist obtained. This function is
overridable by using the "annotator" option in the settings file.
}
\examples{
\dontrun{
......@@ -31,6 +29,6 @@ annotation <- annotator.default(annotation)
}
}
\author{
Michele Stravs, Eawag <stravsmi@eawag.ch>
Michele Stravs, Eawag <stravsmi@eawag.ch>
}
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/leMsMs.r
\name{archiveResults}
\alias{archiveResults}
\title{Backup \code{msmsWorkflow} results}
\usage{
archiveResults(w, fileName, settings =
getOption("RMassBank"))
archiveResults(w, fileName, settings = getOption("RMassBank"))
}
\arguments{
\item{w}{The \code{msmsWorkspace} to be saved.}
\item{w}{The \code{msmsWorkspace} to be saved.}
\item{fileName}{The filename to store the results under.}
\item{fileName}{The filename to store the results under.}
\item{settings}{The settings to be stored into the
msmsWorkspace image.}
\item{settings}{The settings to be stored into the msmsWorkspace image.}
}
\description{
Writes the results from different \code{msmsWorkflow}
steps to a file.
Writes the results from different \code{msmsWorkflow} steps to a file.
}
\examples{
# This doesn't really make a lot of sense,
......
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/SpectraSetMethods.R
\docType{methods}
\name{checkSpectra}
\alias{checkSpectra}
\alias{checkSpectra,RmbSpectraSet,character-method}
\title{Check if a spectra set is found, complete, empty}
\usage{
checkSpectra(s, property)
\S4method{checkSpectra}{RmbSpectraSet,character}(s, property)
}
\arguments{
\item{s}{The (\code{RmbSpectraSet}) to check}
\item{property}{The property to check (\code{found}, \code{complete} or \code{empty})}
}
\value{
\code{TRUE} or \code{FALSE}
}
\description{
Checks if a specific compound (\code{RmbSpectraSet}) was found with child spectra in the raw file (\code{found}),
has a complete set of MS2 spectra with useful peaks (\code{complete}), or is empty (note: spectra are currently not ever
marked empty - empty should mean found, but no useful peaks at all. This is not yet currently tested.)
}
\section{Methods (by class)}{
\itemize{
\item \code{s = RmbSpectraSet,property = character}:
}}
\author{
stravsmi
}
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/leMsMs.r
\name{cleanElnoise}
\alias{cleanElnoise}
\title{Remove electronic noise}
\usage{
cleanElnoise(peaks,
noise=getOption("RMassBank")$electronicNoise, width =
getOption("RMassBank")$electronicNoiseWidth)
cleanElnoise(peaks, noise=getOption("RMassBank")$electronicNoise,
width = getOption("RMassBank")$electronicNoiseWidth)
}
\arguments{
\item{peaks}{A data frame with peaks containing at least
the columns \code{mzFound}, \code{dppm} and
\code{dppmBest}.}
\item{peaks}{An aggregated peak frame as described in \code{\link{aggregateSpectra}}. Columns
\code{mzFound}, \code{dppm} and \code{dppmBest} are needed.}
\item{noise}{A numeric vector of known m/z of electronic
noise peaks from the instrument Defaults to the entries
in the RMassBank settings.}
\item{noise}{A numeric vector of known m/z of electronic noise peaks from the instrument
Defaults to the entries in the RMassBank settings.}
\item{width}{The window for the noise peak in m/z units.
Defaults to the entries in the RMassBank settings.}
\item{width}{The window for the noise peak in m/z units. Defaults to the entries in
the RMassBank settings.}
}
\value{
Returns a dataframe where the rows matching electronic
noise criteria are removed. %% ...
Extends the aggregate data frame by column \code{noise} (logical), which is \code{TRUE} if the peak is marked as noise.
}
\description{
Removes known electronic noise peaks from a peak table
Removes known electronic noise peaks from a peak table
}
\examples{
# As used in the workflow:
\dontrun{
aggregatedRcSpecs$peaksUnmatchedC <-
cleanElnoise(aggregatedRcSpecs$peaksUnmatched)
w@aggregated <-
cleanElnoise(w@aggregated)
}
}
\author{
Michael Stravs
Michael Stravs
}
\seealso{
\code{\link{msmsWorkflow}}
\code{\link{msmsWorkflow}}
}
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/tools.R
\name{combineMultiplicities}
\alias{combineMultiplicities}
\title{Combine workspaces for multiplicity filtering}
\usage{
combineMultiplicities(workspaces)
combineMultiplicities(workspaces)
}
\arguments{
\item{workspaces}{A vector of \code{msmsWorkspace} items.
The first item is taken as the "authoritative" workspace,
i.e. the one which will be used for the record
generation. The subsequent workspaces will only be used
for multiplicity filtering.}
\item{workspaces}{A vector of \code{msmsWorkspace} items. The first item is
taken as the "authoritative" workspace, i.e. the one which will be used
for the record generation. The subsequent workspaces will only be used
for multiplicity filtering.}
}
\value{
A \code{msmsWorkspace} object prepared for step 8
processing.
A \code{msmsWorkspace} object prepared for step 8 processing.
}
\description{
Combines multiple msmsWorkspace items to one workspace
which is used for multiplicity filtering.
Combines multiple msmsWorkspace items to one workspace which is used for
multiplicity filtering.
}
\details{
This feature is particularily meant to be used in
conjunction with the \code{confirmMode} option of
\code{\link{msmsWorkflow}}: a file can be analyzed with
\code{confirmMode = 0} (default) and subsequently with
\code{confirmMode = 1} (take second highest scan). The
second analysis should contain "the same" spectra as the
first one (but less intense) and can be used to confirm
the peaks in the first spectra.
This feature is particularily meant to be used in
conjunction with the \code{confirmMode} option of \code{\link{msmsWorkflow}}:
a file can be analyzed with \code{confirmMode = 0} (default) and subsequently
with \code{confirmMode = 1} (take second highest scan). The second analysis
should contain "the same" spectra as the first one (but less intense) and can
be used to confirm the peaks in the first spectra.
TO DO: Enable the combination of workspaces for combining
e.g. multiple energy settings measured separately.
TO DO: Enable the combination of workspaces for combining e.g. multiple
energy settings measured separately.
}
\examples{
\dontrun{
......@@ -44,9 +42,9 @@
}
}
\author{
Stravs MA, Eawag <michael.stravs@eawag.ch>
Stravs MA, Eawag <michael.stravs@eawag.ch>
}
\seealso{
\code{\link{msmsWorkspace-class}}
\code{\link{msmsWorkspace-class}}
}
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/createMassBank.R
\name{compileRecord}
\alias{compileRecord}
\title{Compile MassBank records}
\usage{
compileRecord(spec, mbdata, refiltered, additionalPeaks =
NULL)
compileRecord(spec, mbdata, aggregated, additionalPeaks = NULL)
}
\arguments{
\item{spec}{A spectra block for a compound, as returned
from \code{\link{analyzeMsMs}}. Note that \bold{peaks are
not read from this object anymore}: Peaks come from the
\code{refiltered} dataframe (and from the global
\code{additionalPeaks} dataframe; cf.
\code{\link{addPeaks}} for usage information.)}
\item{spec}{A \code{RmbSpectraSet} for a compound, after analysis (\code{\link{analyzeMsMs}}).
Note that \bold{peaks are not read from this
object anymore}: Peaks come from the \code{aggregated} dataframe (and from
the global \code{additionalPeaks} dataframe; cf. \code{\link{addPeaks}} for
usage information.)}
\item{mbdata}{The information data block for the record
header, as stored in \code{mbdata_relisted} after loading
an infolist.}
\item{mbdata}{The information data block for the record header, as stored in
\code{mbdata_relisted} after loading an infolist.}
\item{refiltered}{A list with at least the member
\code{peaksOK}, and if peaks from reanalysis should be
used, also \code{peaksReanOK}. \code{peaksOK} must be a
dataframe with at least the, containing at least the
columns \code{cpdID, scan, mzFound, formula, int, dppm}.
If reanalyzed peaks are used, the column setup of
\code{peaksReanOK} must be such as returned from
\code{\link{filterMultiplicity}}.}
\item{aggregated}{An aggregated peak data table containing information about refiltered spectra etc.}
\item{additionalPeaks}{If present, a table with
additional peaks to add into the spectra. As loaded with
\code{\link{addPeaks}}.}
\item{additionalPeaks}{If present, a table with additional peaks to add into the spectra.
As loaded with \code{\link{addPeaks}}.}
}
\value{
Returns a MassBank record in list format: e.g.
\code{list("ACCESSION" = "XX123456", "RECORD_TITLE" =
"Cubane", ..., "CH\$LINK" = list( "CAS" = "12-345-6",
"CHEMSPIDER" = 1111, ...))}
Returns a MassBank record in list format: e.g.
\code{list("ACCESSION" = "XX123456", "RECORD_TITLE" = "Cubane", ...,
"CH\$LINK" = list( "CAS" = "12-345-6", "CHEMSPIDER" = 1111, ...))}
}
\description{
Takes a spectra block for a compound, as returned from
\code{\link{analyzeMsMs}}, and an aggregated cleaned peak
table, together with a MassBank information block, as
stored in the infolists and loaded via
\code{\link{loadInfolist}}/\code{\link{readMbdata}} and
processes them to a MassBank record
Takes a spectra block for a compound, as returned from
\code{\link{analyzeMsMs}}, and an aggregated cleaned peak table, together
with a MassBank information block, as stored in the infolists and loaded via
\code{\link{loadInfolist}}/\code{\link{readMbdata}} and processes them to a
MassBank record
}
\details{
\code{compileRecord} calls \code{\link{gatherCompound}}
to create blocks of spectrum data, and finally fills in
the record title and accession number, renames the
"internal ID" comment field and removes dummy fields.
\code{compileRecord} calls \code{\link{gatherCompound}} to create blocks of
spectrum data, and finally fills in the record title and accession number,
renames the "internal ID" comment field and removes dummy fields.
}
\examples{
#
\dontrun{myspec <- aggregatedRcSpecs\\$specFound[[1]]}
\dontrun{myspec <- w@spectra[[2]]}
# after having loaded an infolist:
\dontrun{mbdata <- mbdata_relisted[[which(mbdata_archive\\$id == as.numeric(myspec\\$id))]]}
\dontrun{compiled <- compileRecord(myspec, mbdata, reanalyzedRcSpecs)}
\dontrun{compiled <- compileRecord(myspec, mbdata, w@aggregated)}
}
\author{
Michael Stravs
Michael Stravs
}
\references{
MassBank record format:
\url{http://www.massbank.jp/manuals/MassBankRecord_en.pdf}
MassBank record format:
\url{http://www.massbank.jp/manuals/MassBankRecord_en.pdf}
}
\seealso{
\code{\link{mbWorkflow}}, \code{\link{addPeaks}},
\code{\link{gatherCompound}}, \code{\link{toMassbank}}
\code{\link{mbWorkflow}}, \code{\link{addPeaks}},
\code{\link{gatherCompound}}, \code{\link{toMassbank}}
}
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/createMassBank.R
\name{createMolfile}
\alias{createMolfile}
\title{Create MOL file for a chemical structure}
\usage{
createMolfile(id_or_smiles, fileName = FALSE)
createMolfile(id_or_smiles, fileName = FALSE)
}
\arguments{
\item{id_or_smiles}{The compound ID or a SMILES code.}
\item{id_or_smiles}{The compound ID or a SMILES code.}
\item{fileName}{If the filename is set, the file is
written directly to disk using the specified filename.
Otherwise, it is returned as a text array.}
\item{fileName}{If the filename is set, the file is written directly to disk
using the specified filename. Otherwise, it is returned as a text array.}
}
\value{
A character array containing the MOL/SDF format file,
ready to be written to disk.
A character array containing the MOL/SDF format file, ready to be
written to disk.
}
\description{
Creates a MOL file (in memory or on disk) for a compound
specified by the compound ID or by a SMILES code.
Creates a MOL file (in memory or on disk) for a compound specified by the
compound ID or by a SMILES code.
}
\details{
The function invokes OpenBabel (and therefore needs a
correctly set OpenBabel path in the RMassBank settings),
using the SMILES code retrieved with \code{findSmiles} or
using the SMILES code directly. The current
implementation of the workflow uses the latter version,
reading the SMILES code directly from the MassBank record
itself.
The function invokes OpenBabel (and therefore needs a correctly set
OpenBabel path in the RMassBank settings), using the SMILES code retrieved
with \code{findSmiles} or using the SMILES code directly. The current
implementation of the workflow uses the latter version, reading the SMILES
code directly from the MassBank record itself.
}
\examples{
# Benzene:
......@@ -35,12 +34,12 @@ createMolfile("C1=CC=CC=C1")
}
}
\author{
Michael Stravs
Michael Stravs
}
\references{
OpenBabel: \url{http://openbabel.org}
OpenBabel: \url{http://openbabel.org}
}
\seealso{
\code{\link{findSmiles}}
\code{\link{findSmiles}}
}
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/formulaCalculator.R
\name{dbe}
\alias{dbe}
\title{Calculate Double Bond Equivalents}
\usage{
dbe(formula)
dbe(formula)
}
\arguments{
\item{formula}{A molecular formula in text or list
representation (e.g. \code{"C6H12O6"} or \code{list(C=6,
H=12, O=6)} ).}
\item{formula}{A molecular formula in text or list representation (e.g.
\code{"C6H12O6"} or \code{list(C=6, H=12, O=6)} ).}
}
\value{
Returns the DBE for the given formula.
Returns the DBE for the given formula.
}
\description{
Calculates the Ring and Double Bond Equivalents for a
chemical formula. The highest valence state of each atom
is used, such that the returned DBE should never be below
0.
Calculates the Ring and Double Bond Equivalents for a chemical formula. The
highest valence state of each atom is used, such that the returned DBE
should never be below 0.
}
\examples{
#
dbe("C6H12O6")
}
\author{
Michael Stravs
Michael Stravs
}
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/deprofile.R
\name{deprofile}
\alias{deprofile}
\alias{deprofile.fwhm}
......@@ -6,111 +8,84 @@
\alias{deprofile.spline}
\title{De-profile a high-resolution MS scan in profile mode.}
\usage{
deprofile.scan(scan, noise = NA, method =
"deprofile.fwhm", colnames = TRUE, ...)
deprofile.scan(scan, noise = NA, method = "deprofile.fwhm",
colnames = TRUE, ...)
deprofile(df, noise, method, ...)
deprofile(df, noise, method, ...)
deprofile.fwhm(df, noise = NA, cut = 0.5)
deprofile.fwhm(df, noise = NA, cut = 0.5)
deprofile.localMax(df, noise = NA)
deprofile.localMax(df, noise = NA)
deprofile.spline(df, noise=NA, minPts = 5, step =
0.00001)
deprofile.spline(df, noise=NA, minPts = 5, step = 0.00001)
}
\arguments{
\item{scan}{A matrix with 2 columns for m/z and
intensity; from profile-mode high-resolution data.
Corresponds to the spectra obtained with xcms::getScan or
mzR::peaks.}
\item{noise}{The noise cutoff. A peak is not included if
the maximum stick intensity of the peak is below the
noise cutoff.}
\item{method}{"deprofile.fwhm" for full-width
half-maximum or "deprofile.localMax" for local maximum.}
\item{colnames}{For deprofile.scan: return matrix with
column names (xcms-style, \code{TRUE}, default) or plain
(mzR-style, \code{FALSE}).}
\item{df}{A dataframe with at least the columns \code{mz}
and \code{int} to perform deprofiling on.}
\item{...}{Arguments to the workhorse functions
\code{deprofile.fwhm} etc.}
\item{cut}{A parameter for \code{deprofile.fwhm}
indicating where the peak flanks should be taken.
Standard is 0.5 (as the algorithm name says, at half
maximum.) Setting \code{cut = 0.75} would instead
determine the peak width at 3/4 maximum, which might give
a better accuracy for merged peaks, but could be less
accurate if too few data points are present.}
\item{minPts}{The minimal points count in a peak to build
a spline; for peaks with less points the local maximum
will be used instead. Note: The minimum value is 4!}
\item{step}{The interpolation step for the calculated
spline, which limits the maximum precision which can be
achieved.}
\item{df}{A dataframe with at least the columns \code{mz} and \code{int} to perform deprofiling on.}
\item{noise}{The noise cutoff. A peak is not included if the maximum stick intensity of the peak
is below the noise cutoff.}
\item{method}{"deprofile.fwhm" for full-width half-maximum or "deprofile.localMax" for
local maximum.}
\item{...}{Arguments to the workhorse functions \code{deprofile.fwhm} etc.}
\item{scan}{A matrix with 2 columns for m/z and intensity; from profile-mode high-resolution data. Corresponds
to the spectra obtained with xcms::getScan or mzR::peaks.}
\item{colnames}{For deprofile.scan: return matrix with column names (xcms-style,
\code{TRUE}, default) or plain (mzR-style, \code{FALSE}).}
\item{cut}{A parameter for \code{deprofile.fwhm} indicating where the peak flanks should be taken. Standard is 0.5
(as the algorithm name says, at half maximum.) Setting \code{cut = 0.75} would instead determine the peak
width at 3/4 maximum, which might give a better accuracy for merged peaks, but could be less accurate
if too few data points are present.}
\item{minPts}{The minimal points count in a peak to build a spline; for peaks with less
points the local maximum will be used instead. Note: The minimum value
is 4!}
\item{step}{The interpolation step for the calculated spline, which limits the maximum
precision which can be achieved.}
}
\value{
\code{deprofile.scan}: a matrix with 2 columns for m/z
and intensity
\code{deprofile.scan}: a matrix with 2 columns for m/z and intensity
}
\description{
The \code{deprofile} functions convert profile-mode
high-resolution input data to "centroid"-mode data
amenable to i.e. centWave. This is done using full-width,
half-height algorithm, spline algorithm or local maximum
method.
The \code{deprofile} functions convert profile-mode high-resolution input data to "centroid"-mode
data amenable to i.e. centWave. This is done using full-width, half-height algorithm, spline
algorithm or local maximum method.
}
\details{
The \code{deprofile.fwhm} method is basically an
R-semantic version of the "Exact Mass" m/z deprofiler
from MZmine. It takes the center between the m/z values
at half-maximum intensity for the exact peak mass. The
logic is stolen verbatim from the Java MZmine algorithm,
but it has been rewritten to use the fast R vector
operations instead of loops wherever possible. It's
slower than the Java implementation, but still decently
fast IMO. Using matrices instead of the data frame would
be more memory-efficient and also faster, probably.
The \code{deprofile.localMax} method uses local maxima
and is probably the same used by e.g. Xcalibur. For
well-formed peaks, "deprofile.fwhm" gives more accurate
mass results; for some applications,
\code{deprofile.localMax} might be better (e.g. for fine
isotopic structure peaks which are not separated by a
valley and also not at half maximum.) For MS2 peaks,
which have no isotopes, \code{deprofile.fwhm} is probably
the better choice generally.
\code{deprofile.spline} calculates the mass using a cubic
spline, as the HiRes peak detection in OpenMS does.
The word "centroid" is used for convenience to denote
not-profile-mode data. The data points are NOT
mathematical centroids; we would like to have a better
word for it.
The \code{noise} parameter was only included for
completeness, I personally don't use it.
\code{deprofile.fwhm} and \code{deprofile.localMax} are
the workhorses; \code{deprofile.scan} takes a 2-column
scan as input. \code{deprofile} dispatches the call to
the appropriate worker method.
The \code{deprofile.fwhm} method is basically an R-semantic version of the "Exact Mass" m/z deprofiler
from MZmine. It takes the center between the m/z values at half-maximum intensity for the exact peak mass.
The logic is stolen verbatim from the Java MZmine algorithm, but it has been rewritten to use the fast
R vector operations instead of loops wherever possible. It's slower than the Java implementation, but
still decently fast IMO. Using matrices instead of the data frame would be more memory-efficient
and also faster, probably.
The \code{deprofile.localMax} method uses local maxima and is probably the same used by e.g. Xcalibur.
For well-formed peaks, "deprofile.fwhm" gives more accurate mass results; for some applications,
\code{deprofile.localMax} might be better (e.g. for fine isotopic structure peaks which are
not separated by a valley and also not at half maximum.) For MS2 peaks, which have no isotopes,
\code{deprofile.fwhm} is probably the better choice generally.
\code{deprofile.spline} calculates the mass using a cubic spline, as the HiRes peak detection
in OpenMS does.
The word "centroid" is used for convenience to denote not-profile-mode data.
The data points are NOT mathematical centroids; we would like to have a better word for it.
The \code{noise} parameter was only included for completeness, I personally don't use it.
\code{deprofile.fwhm} and \code{deprofile.localMax} are the workhorses;
\code{deprofile.scan} takes a 2-column scan as input.
\code{deprofile} dispatches the call to the appropriate worker method.
}
\note{
Known limitations: If the absolute leftmost stick or the
absolute rightmost stick in a scan are maxima, they will
be discarded! However, I don't think this will ever
present a practical problem.
Known limitations: If the absolute leftmost stick or the absolute rightmost stick in
a scan are maxima, they will be discarded! However, I don't think this will
ever present a practical problem.
}
\examples{
\dontrun{
......@@ -122,10 +97,9 @@ close(mzrFile)
}
}
\author{
Michael Stravs, Eawag <michael.stravs@eawag.ch>
Michael Stravs, Eawag <michael.stravs@eawag.ch>
}
\references{
mzMine source code
\href{http://sourceforge.net/svn/?group_id=139835}{http://sourceforge.net/svn/?group_id=139835}
mzMine source code \href{http://sourceforge.net/svn/?group_id=139835}{http://sourceforge.net/svn/?group_id=139835}
}
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