Skip to contents

The MassSpecEngine R6 class is a framework for parsing, processing, inspecting and storing mass spectrometry (MS) data. MS data (i.e., spectra and chromatograms, including chromatograms produced by UV detection) can be loaded from mzML and mzXML formats. If msconvert from ProteoWizard is installed and found via CLI (i.e., must be added to the environmental variables), the engine can also load vendor formats by direct conversion to mzML. Note that conversion of vendor formats is only possible under Windows OS.

Details

The MassSpecEngine is using patRoon for assembly of Non-Target Screening (NTS) data processing workflows.

References

Helmus R, ter Laak TL, van Wezel AP, de Voogt P, Schymanski EL (2021). “patRoon: open source software platform for environmental mass spectrometry based non-target screening.” Journal of Cheminformatics, 13(1). doi:10.1186/s13321-020-00477-w .

Helmus R, van de Velde B, Brunner AM, ter Laak TL, van Wezel AP, Schymanski EL (2022). “patRoon 2.0: Improved non-target analysis workflows including automated transformation product screening.” Journal of Open Source Software, 7(71), 4029. doi:10.21105/joss.04029 .

Kapoulkine A (2022). “pugixml 1.13: Light-weight, simple and fast XML parser for C++ with XPath support.” Copyright (C) 2006-2018. http://pugixml.org.

Kessner D, Chambers M, Burke R, Agus D, Mallick P (2008). “ProteoWizard: open source software for rapid proteomics tools development.” Bioinformatics, 24(21), 2534–2536. doi:10.1093/bioinformatics/btn323 , http://www.ncbi.nlm.nih.gov/pubmed/18606607.

Chambers MC, Maclean B, Burke R, Amodei D, Ruderman DL, Neumann S, Gatto L, Fischer B, Pratt B, Egertson J, Hoff K, Kessner D, Tasman N, Shulman N, Frewen B, Baker TA, Brusniak M, Paulse C, Creasy D, Flashner L, Kani K, Moulding C, Seymour SL, Nuwaysir LM, Lefebvre B, Kuhlmann F, Roark J, Rainer P, Detlev S, Hemenway T, Huhmer A, Langridge J, Connolly B, Chadick T, Holly K, Eckels J, Deutsch EW, Moritz RL, Katz JE, Agus DB, MacCoss M, Tabb DL, Mallick P (2012). “A cross-platform toolkit for mass spectrometry and proteomics.” Nature Biotechnology, 30(10), 918–920. https://doi.org/10.1038/nbt.2377.

Super class

StreamFind::CoreEngine -> MassSpecEngine

Active bindings

nts

Get/Set for the NTS results class.

spectra

Get/set for the Spectra results class.

chromatograms

Get/set for the chromatograms results class.

Methods

Public methods

Inherited methods


Method new()

Creates an R6 MassSpecEngine class object.

Usage

MassSpecEngine$new(
  file = NULL,
  headers = NULL,
  workflow = NULL,
  analyses = NULL,
  centroid = FALSE,
  levels = c(1, 2)
)

Arguments

file

Character of length one with the full path to the sqlite or 'rds' save file of the engine.

headers

A named list with headers or a ProjectHeaders object. Each list element must have length one. There is no type restrictions except for name (must be type character), author (must be type character character) and date (must be class POSIXct or class POSIXt).

workflow

A Workflow S7 class object or a list of ProcessingSettings S7 class objects.

analyses

A MassSpecAnalyses S7 class object or a character vector with full file paths to mzML/mzXML files or a data.frame with colnames: "file", "replicate" and "blank". The "replicate" column is used to group the analyses and the "blank" column is used to identify the blank samples. The "file" column is the full path to the mzML/mzXML files. If msconvert from ProteoWizard is installed and found via CLI (i.e., must be added to the environmental variables), the engine can also load vendor formats by direct conversion to mzML. Note that conversion of vendor formats is only possible under Windows OS.

centroid

Logical (length 1). Set to TRUE to centroid data when converting from vendor formats to mzML.

levels

Numeric vector with the MS levels to consider when centroiding data. Default is c(1, 2).

Returns

A new MassSpecEngine class object.


Method get_analysis_names()

Gets the analysis replicate names.

Usage

MassSpecEngine$get_analysis_names(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_replicate_names()

Gets the analysis replicate names.

Usage

MassSpecEngine$get_replicate_names(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_blank_names()

Gets the analysis blank replicate names.

Usage

MassSpecEngine$get_blank_names(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_files()

Gets the full file paths of each analysis.

Usage

MassSpecEngine$get_files(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_formats()

Gets the file format of each analysis.'

Usage

MassSpecEngine$get_formats(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_instruments()

Gets the instruments information of each analysis.

Usage

MassSpecEngine$get_instruments(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_software()

Gets the software information of each analysis.

Usage

MassSpecEngine$get_software(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_spectra_number()

Gets the number of spectra in each analysis.

Usage

MassSpecEngine$get_spectra_number(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_spectra_mode()

Gets the spectra mode of each analysis (i.e., profile or centroid).

Usage

MassSpecEngine$get_spectra_mode(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_spectra_level()

Gets the spectra levels of each analysis.

Usage

MassSpecEngine$get_spectra_level(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_spectra_lowest_mz()

Gets the lower m/z value of each analysis.

Usage

MassSpecEngine$get_spectra_lowest_mz(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_spectra_highest_mz()

Gets the higher m/z value of each analysis.

Usage

MassSpecEngine$get_spectra_highest_mz(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_spectra_lowest_rt()

Gets the start retention time value of each analysis.

Usage

MassSpecEngine$get_spectra_lowest_rt(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_spectra_highest_rt()

Gets the end retention time value of each analysis.

Usage

MassSpecEngine$get_spectra_highest_rt(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_spectra_polarity()

Gets the polarity of each analysis.

Usage

MassSpecEngine$get_spectra_polarity(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_spectra_headers()

Gets the spectra headers data.table of each analysis.

Usage

MassSpecEngine$get_spectra_headers(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_spectra_tic()

Gets the total ion chromatogram (TIC) of each analysis.

Usage

MassSpecEngine$get_spectra_tic(analyses = NULL, levels = c(1, 2), rt = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

levels

Integer vector with the levels of MS data.

rt

Numeric (length 2). The retention time range to filter the TIC.

Returns

A data.table with the TIC chromatogram.


Method get_spectra_bpc()

Gets the base peak chromatogram (BPC) of each analysis.

Usage

MassSpecEngine$get_spectra_bpc(analyses = NULL, levels = c(1, 2), rt = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

levels

Integer vector with the levels of MS data.

rt

Numeric (length 2). The retention time range to filter the BPC.

Returns

A character vector.


Method get_spectra()

Gets spectra from each analysis.

Usage

MassSpecEngine$get_spectra(
  analyses = NULL,
  levels = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  id = NULL,
  allTraces = TRUE,
  isolationWindow = 1.3,
  minIntensityMS1 = 0,
  minIntensityMS2 = 0,
  useRawData = TRUE,
  useLoadedData = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

levels

Integer vector with the levels of MS data.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

id

Character with the same length as m/z and retention time targets to be used as identifier/s. When not given, the id is built as a combination of the m/z and retention time ranges or values.

allTraces

Logical, when TRUE all level 2 data is returned. When FALSE and level has 2, only the MS2 traces of MS1 targets are returned, using the isolationWindow to calculate the mass window.

isolationWindow

Numeric value with the isolation window (in Da) applied for ion isolation and fragmentation during acquisition of tandem data (i.e., MS2 data).

minIntensityMS1

Numeric value with the minimum intensity of level 1 data (i.e., MS1 data).

minIntensityMS2

Numeric value with the minimum intensity of level 2 data (i.e., MS2 data).

useRawData

Logical of length one. Set to TRUE for parsing raw data not data in results/processed.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.


Method get_spectra_matrix()

Gets a matrix with spectra from analyses.

Usage

MassSpecEngine$get_spectra_matrix(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_spectra_eic()

Gets spectra extract ion chromatograms (EIC) from the analyses based on targets as a data.table.

Usage

MassSpecEngine$get_spectra_eic(
  analyses = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  id = NULL,
  useRawData = TRUE,
  useLoadedData = FALSE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

id

Character with the same length as m/z and retention time targets to be used as identifier/s. When not given, the id is built as a combination of the m/z and retention time ranges or values.

useRawData

Logical of length one. Set to TRUE for parsing raw data not data in results/processed.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.


Method get_spectra_ms1()

Gets level 1 spectra from the analyses based on targets as a data.frame.

Usage

MassSpecEngine$get_spectra_ms1(
  analyses = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  id = NULL,
  mzClust = 0.003,
  presence = 0.8,
  minIntensity = 1000,
  useRawData = TRUE,
  useLoadedData = FALSE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

id

Character with the same length as m/z and retention time targets to be used as identifier/s. When not given, the id is built as a combination of the m/z and retention time ranges or values.

mzClust

Numeric (length 1) with the mass deviation threshold (in Da) to cluster mass traces. Highly dependent on the mass resolution of the MS data.

presence

Numeric (length 1) with the required presence ratio from 0 (i.e., doesn't need to be present in any spectra) to 1 (i.e., must be present in all spectra) for traces during clustering of spectra.

minIntensity

Numeric (length 1) with the minimum intensity.

useRawData

Logical of length one. Set to TRUE for parsing raw data not data in results/processed.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.


Method get_spectra_ms2()

Gets level 2 spectra from the analyses based on targets as a data.frame.

Usage

MassSpecEngine$get_spectra_ms2(
  analyses = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  id = NULL,
  isolationWindow = 1.3,
  mzClust = 0.005,
  presence = 0.8,
  minIntensity = 0,
  useRawData = TRUE,
  useLoadedData = FALSE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

id

Character with the same length as m/z and retention time targets to be used as identifier/s. When not given, the id is built as a combination of the m/z and retention time ranges or values.

isolationWindow

Numeric value with the isolation window (in Da) applied for ion isolation and fragmentation during acquisition of tandem data (i.e., MS2 data).

mzClust

Numeric (length 1) with the mass deviation threshold (in Da) to cluster mass traces. Highly dependent on the mass resolution of the MS data.

presence

Numeric (length 1) with the required presence ratio from 0 (i.e., doesn't need to be present in any spectra) to 1 (i.e., must be present in all spectra) for traces during clustering of spectra.

minIntensity

Numeric (length 1) with the minimum intensity.

useRawData

Logical of length one. Set to TRUE for parsing raw data not data in results/processed.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.


Method get_chromatograms_number()

Gets the number of chromatograms in each analysis.

Usage

MassSpecEngine$get_chromatograms_number(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_chromatograms_headers()

Gets the chromatograms headers data.table of each analysis.

Usage

MassSpecEngine$get_chromatograms_headers(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method get_chromatograms()

Gets chromatograms from each analysis.

Usage

MassSpecEngine$get_chromatograms(
  analyses = NULL,
  chromatograms = NULL,
  rtmin = 0,
  rtmax = 0,
  minIntensity = NULL,
  useRawData = FALSE,
  useLoadedData = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

chromatograms

A character or integer vector with the ID (i.e. name) or the index of the chromatograms.

rtmin

Numeric (length 1) with the minimum retention time.

rtmax

Numeric (length 1) with the maximum retention time.

minIntensity

Numeric (length 1) with the minimum intensity.

useRawData

Logical of length one. Set to TRUE for parsing raw data not data in results/processed.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.


Method get_chromatograms_peaks()

Gets integrated peaks from chromatograms.

Usage

MassSpecEngine$get_chromatograms_peaks(analyses = NULL, chromatograms = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

chromatograms

A character or integer vector with the ID (i.e. name) or the index of the chromatograms.


Method get_features()

Gets a data.table with all features from NTS results or as selected by the arguments.

Usage

MassSpecEngine$get_features(
  analyses = NULL,
  features = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  filtered = FALSE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

features

A character vector with the feature IDs or a data.frame or data.table with a column named feature with the feature IDs. A column named analysis can be given to specify from which analyses the features matched.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.


Method get_features_eic()

Gets a data.table with feature EICs following the targets from the arguments.

Usage

MassSpecEngine$get_features_eic(
  analyses = NULL,
  features = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  rtExpand = 120,
  mzExpand = NULL,
  filtered = FALSE,
  useLoadedData = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

features

A character vector with the feature IDs or a data.frame or data.table with a column named feature with the feature IDs. A column named analysis can be given to specify from which analyses the features matched.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

rtExpand

Numeric (length 1) with the retention time values (in seconds) for expanding left and right the retention time range.

mzExpand

Numeric (length 1) with the mass or mass-to-charge ratio (m/z) (in Da) for expanding left and right the mass range.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.


Method get_features_ms1()

Gets a data.table of averaged MS1 spectrum for features in the analyses or as selected from the arguments.

Usage

MassSpecEngine$get_features_ms1(
  analyses = NULL,
  features = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  rtWindow = c(-2, 2),
  mzWindow = c(-5, 100),
  mzClust = 0.003,
  presence = 0.8,
  minIntensity = 1000,
  filtered = FALSE,
  useLoadedData = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

features

A character vector with the feature IDs or a data.frame or data.table with a column named feature with the feature IDs. A column named analysis can be given to specify from which analyses the features matched.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

rtWindow

Numeric (length 2) with the retention time values (in seconds) for expanding left and right the retention time range. The first element expands left and the second expands right. Note that the first element should be negative to expand to the left.

mzWindow

Numeric (length 2) with the mass or mass-to-charge ratio (m/z) values (in Da) for expanding left and right the mass range. The first element expands left and the second expands right. Note that the first element should be negative to expand to the left.

mzClust

Numeric (length 1) with the mass deviation threshold (in Da) to cluster mass traces. Highly dependent on the mass resolution of the MS data.

presence

Numeric (length 1) with the required presence ratio from 0 (i.e., doesn't need to be present in any spectra) to 1 (i.e., must be present in all spectra) for traces during clustering of spectra.

minIntensity

Numeric (length 1) with the minimum intensity.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.


Method get_features_ms2()

Gets a data.table of averaged MS2 spectrum for features in the analyses or as selected from the arguments.

Usage

MassSpecEngine$get_features_ms2(
  analyses = NULL,
  features = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  isolationWindow = 1.3,
  mzClust = 0.003,
  presence = 0.8,
  minIntensity = 0,
  filtered = FALSE,
  useLoadedData = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

features

A character vector with the feature IDs or a data.frame or data.table with a column named feature with the feature IDs. A column named analysis can be given to specify from which analyses the features matched.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

isolationWindow

Numeric value with the isolation window (in Da) applied for ion isolation and fragmentation during acquisition of tandem data (i.e., MS2 data).

mzClust

Numeric (length 1) with the mass deviation threshold (in Da) to cluster mass traces. Highly dependent on the mass resolution of the MS data.

presence

Numeric (length 1) with the required presence ratio from 0 (i.e., doesn't need to be present in any spectra) to 1 (i.e., must be present in all spectra) for traces during clustering of spectra.

minIntensity

Numeric (length 1) with the minimum intensity.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.


Method get_groups()

Gets a data.table with feature groups from the analyses.

Usage

MassSpecEngine$get_groups(
  groups = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  filtered = FALSE,
  intensities = TRUE,
  average = FALSE,
  sdValues = FALSE,
  metadata = FALSE
)

Arguments

groups

A numeric or character vector with the number or ID of feature groups, respectively.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.

intensities

Logical (length 1). When TRUE, feature intensity values are returned.

average

Logical (length 1). When TRUE, feature intensities from each group are averaged and returned for each analysis replicate group.

sdValues

Logical (length 1). Set to TRUE for returning the sd values when averaging the intensity within analysis replicates.

metadata

Logical (length 1). Set to TRUE for returning extra metadata from feature groups (e.g., presence in each analysis replicate and mass and time widths).


Method get_groups_ms1()

Gets a data.table of averaged MS1 spectrum for feature groups in the analyses.

Usage

MassSpecEngine$get_groups_ms1(
  groups = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  rtWindow = c(-2, 2),
  mzWindow = c(-5, 90),
  mzClustFeatures = 0.003,
  presenceFeatures = 0.8,
  minIntensityFeatures = 1000,
  useLoadedData = TRUE,
  mzClust = 0.003,
  presence = 0.8,
  minIntensity = 1000,
  groupBy = "groups",
  filtered = FALSE
)

Arguments

groups

A numeric or character vector with the number or ID of feature groups, respectively.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

rtWindow

Numeric (length 2) with the retention time values (in seconds) for expanding left and right the retention time range. The first element expands left and the second expands right. Note that the first element should be negative to expand to the left.

mzWindow

Numeric (length 2) with the mass or mass-to-charge ratio (m/z) values (in Da) for expanding left and right the mass range. The first element expands left and the second expands right. Note that the first element should be negative to expand to the left.

mzClustFeatures

Numeric (length 1) with the mass deviation threshold (in Da) to cluster mass traces for features. Highly dependent on the mass resolution of the MS data.

presenceFeatures

Numeric (length 1) with the required presence ratio from 0 (i.e., doesn't need to be present in any spectra) to 1 (i.e., must be present in all spectra) for traces during clustering of spectra.

minIntensityFeatures

Numeric (length 1) with the minimum intensity for features.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.

mzClust

Numeric (length 1) with the mass deviation threshold (in Da) to cluster mass traces. Highly dependent on the mass resolution of the MS data.

presence

Numeric (length 1) with the required presence ratio from 0 (i.e., doesn't need to be present in any spectra) to 1 (i.e., must be present in all spectra) for traces during clustering of spectra.

minIntensity

Numeric (length 1) with the minimum intensity.

groupBy

String with the way of grouping. Possible values are groups and replicates to group by feature groups or feature groups and replicates, respectively.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.


Method get_groups_ms2()

Gets a data.table of averaged MS2 spectrum for feature groups in the analyses.

Usage

MassSpecEngine$get_groups_ms2(
  groups = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  isolationWindow = 1.3,
  mzClustFeatures = 0.003,
  presenceFeatures = 0.8,
  minIntensityFeatures = 100,
  useLoadedData = TRUE,
  mzClust = 0.003,
  presence = 0.8,
  minIntensity = 100,
  groupBy = "groups",
  filtered = FALSE
)

Arguments

groups

A numeric or character vector with the number or ID of feature groups, respectively.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

isolationWindow

Numeric value with the isolation window (in Da) applied for ion isolation and fragmentation during acquisition of tandem data (i.e., MS2 data).

mzClustFeatures

Numeric (length 1) with the mass deviation threshold (in Da) to cluster mass traces for features. Highly dependent on the mass resolution of the MS data.

presenceFeatures

Numeric (length 1) with the required presence ratio from 0 (i.e., doesn't need to be present in any spectra) to 1 (i.e., must be present in all spectra) for traces during clustering of spectra.

minIntensityFeatures

Numeric (length 1) with the minimum intensity for features.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.

mzClust

Numeric (length 1) with the mass deviation threshold (in Da) to cluster mass traces. Highly dependent on the mass resolution of the MS data.

presence

Numeric (length 1) with the required presence ratio from 0 (i.e., doesn't need to be present in any spectra) to 1 (i.e., must be present in all spectra) for traces during clustering of spectra.

minIntensity

Numeric (length 1) with the minimum intensity.

groupBy

String with the way of grouping. Possible values are groups and replicates to group by feature groups or feature groups and replicates, respectively.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.


Method get_MSPeakLists()

Creates S4 class MSPeakLists. Note that feature groups are required. The MS and MSMS spectra of each feature are then average by patRoon to produce the feature group spectra using the parameters of the function getDefAvgPListParams.

Usage

MassSpecEngine$get_MSPeakLists(
  useLoadedData = TRUE,
  maxMSRtWindow = 10,
  precursorMzWindow = 4,
  clusterMzWindow = 0.005,
  topMost = 100,
  minIntensityPre = 10,
  minIntensityPost = 10,
  avgFun = mean,
  method = "distance",
  retainPrecursorMSMS = TRUE
)

Arguments

useLoadedData

Logical of length one. When TRUE and both MS1 and MS2 are loaded to features, these are used otherwise the native function generateMSPeakLists from patRoon is used instead.

maxMSRtWindow

Maximum chromatographic peak window used for spectrum averaging (in seconds, +/- retention time). If NULL all spectra from a feature will be taken into account. Lower to decrease processing time.

precursorMzWindow

The m/z window (in Da) to find MS/MS spectra of a precursor. This is typically used for Data-Dependent like MS/MS data and should correspond to the isolation m/z window (i.e. +/- the precursor m/z) that was used to collect the data. For Data-Independent MS/MS experiments, where precursor ions are not isolated prior to fragmentation (e.g. bbCID, MSe, all-ion, ...) the value should be NULL.

clusterMzWindow

m/z window (in Da) used for clustering m/z values when spectra are averaged. For method="hclust" this corresponds to the cluster height, while for method="distance" this value is used to find nearby masses (+/- window). Too small windows will prevent clustering m/z values (thus erroneously treating equal masses along spectra as different), whereas too big windows may cluster unrelated m/z values from different or even the same spectrum together.

topMost

Only retain this maximum number of MS peaks when generating averaged spectra. Lowering this number may exclude more irrelevant (noisy) MS peaks and decrease processing time, whereas higher values may avoid excluding lower intense MS peaks that may still be of interest.

minIntensityPre

MS peaks with intensities below this value will be removed (applied prior to selection by topMost) before averaging.

minIntensityPost

MS peaks with intensities below this value will be removed after averaging.

avgFun

Function that is used to calculate average m/z values.

method

Method used for producing averaged MS spectra. Valid values are "hclust", used for hierarchical clustering (using the fastcluster package), and "distance", to use the between peak distance. The latter method may reduces processing time and memory requirements, at the potential cost of reduced accuracy.

retainPrecursorMSMS

For MS/MS data only: if TRUE then always retain the precursor mass peak even if is not among the topMost peaks. Note that MS precursor mass peaks are always kept. Furthermore, note that precursor peaks in both MS and MS/MS data may still be removed by intensity thresholds (this is unlike the filter method function).

pruneMissingPrecursorMS

For MS data only: if TRUE then peak lists without a precursor peak are removed. Note that even when this is set to FALSE, functionality that relies on MS (not MS/MS) peak lists (e.g. formulae calculation) will still skip calculation if a precursor is not found.


Method get_components()

Gets feature components (i.e., isotope and adduct related to a main feature) in the analyses.

Usage

MassSpecEngine$get_components(
  analyses = NULL,
  features = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  filtered = FALSE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

features

A character vector with the feature IDs or a data.frame or data.table with a column named feature with the feature IDs. A column named analysis can be given to specify from which analyses the features matched.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.


Method get_suspects()

Gets a data.table of suspects from features according to a defined database and mass (ppm) and time (sec) deviations.

Usage

MassSpecEngine$get_suspects(
  analyses = NULL,
  database = NULL,
  features = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 5,
  sec = 10,
  millisec = 5,
  ppmMS2 = 10,
  minFragments = 3,
  isolationWindow = 1.3,
  mzClust = 0.003,
  presence = 0.8,
  minIntensity = 0,
  filtered = FALSE,
  onGroups = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

database

A data.frame with at least the columns name and mass, indicating the name and neutral monoisotopic mass of the suspect targets.

features

A character vector with the feature IDs or a data.frame or data.table with a column named feature with the feature IDs. A column named analysis can be given to specify from which analyses the features matched.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

ppmMS2

Numeric (length 1) with the mass deviation for MS2, in ppm.

minFragments

Integer (length 1) with the minimum number of fragments.

isolationWindow

Numeric value with the isolation window (in Da) applied for ion isolation and fragmentation during acquisition of tandem data (i.e., MS2 data).

mzClust

Numeric (length 1) with the mass deviation threshold (in Da) to cluster mass traces. Highly dependent on the mass resolution of the MS data.

presence

Numeric (length 1) with the required presence ratio from 0 (i.e., doesn't need to be present in any spectra) to 1 (i.e., must be present in all spectra) for traces during clustering of spectra.

minIntensity

Numeric (length 1) with the minimum intensity.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.

onGroups

Logical (length 1). When TRUE results are return based on feature groups not individual features.

Details

The ppm and sec which indicate the mass (im ppm) and time (in seconds) deviations applied during the screening.


Method get_internal_standards()

Gets a data.table with internal standards found by the find_internal_standards module.

Usage

MassSpecEngine$get_internal_standards(average = TRUE)

Arguments

average

Logical of length one. When TRUE and groups are present, internal standards are averaged per analysis replicate group.


Method get_metadata()

Gets metadata from each analysis.

Usage

MassSpecEngine$get_metadata(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

Returns

A data.table.


Method add_analyses()

Adds analyses. Note that when adding new analyses, any existing results are removed.

Usage

MassSpecEngine$add_analyses(analyses = NULL)

Arguments

analyses

A MassSpecAnalysis class object or a list with MassSpecAnalysis class objects as elements (see ?MassSpecAnalysis for more information) or a character vector with full path to mzML/mzXML files.

Returns

Invisible.


Method remove_analyses()

Removes analyses.

Usage

MassSpecEngine$remove_analyses(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

Returns

Invisible.


Method add_replicate_names()

Adds replicate names to the analysis.

Usage

MassSpecEngine$add_replicate_names(value)

Arguments

value

Character vector with the replicate names. Must have the same length as the number of analyses.


Method add_blank_names()

Adds blank names to the analysis.

Usage

MassSpecEngine$add_blank_names(value)

Arguments

value

Character vector with the replicate names. Must have the same length as the number of analyses and must be one of replicate names.


Method load_spectra()

Loads spectra from analyses.

Usage

MassSpecEngine$load_spectra(
  analyses = NULL,
  levels = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  id = NULL,
  allTraces = TRUE,
  isolationWindow = 1.3,
  minIntensityMS1 = 0,
  minIntensityMS2 = 0
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

levels

Integer vector with the levels of MS data.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

id

Character with the same length as m/z and retention time targets to be used as identifier/s. When not given, the id is built as a combination of the m/z and retention time ranges or values.

allTraces

Logical, when TRUE all level 2 data is returned. When FALSE and level has 2, only the MS2 traces of MS1 targets are returned, using the isolationWindow to calculate the mass window.

isolationWindow

Numeric value with the isolation window (in Da) applied for ion isolation and fragmentation during acquisition of tandem data (i.e., MS2 data).

minIntensityMS1

Numeric value with the minimum intensity of level 1 data (i.e., MS1 data).

minIntensityMS2

Numeric value with the minimum intensity of level 2 data (i.e., MS2 data).

Returns

Invisible.


Method load_chromatograms()

Loads all chromatograms from all analyses.

Usage

MassSpecEngine$load_chromatograms(
  analyses = NULL,
  chromatograms = NULL,
  rtmin = 0,
  rtmax = 0,
  minIntensity = NULL
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

chromatograms

A character or integer vector with the ID (i.e. name) or the index of the chromatograms.

rtmin

Numeric (length 1) with the minimum retention time.

rtmax

Numeric (length 1) with the maximum retention time.

minIntensity

Numeric (length 1) with the minimum intensity.

Returns

Invisible.


Method has_nts()

Checks if there are NTS results, returning TRUE or FALSE.

Usage

MassSpecEngine$has_nts()


Method has_features()

Checks if there are features from NTS results, returning TRUE or FALSE.

Usage

MassSpecEngine$has_features()


Method has_groups()

Checks if there are feature groups from NTS results, returning TRUE or FALSE.

Usage

MassSpecEngine$has_groups()


Method has_MSPeakLists()

Checks if there are MSPeakLists for analyses, returning TRUE or FALSE.

Usage

MassSpecEngine$has_MSPeakLists(analyses = NULL)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.


Method has_formulas()

Checks if there are formulas assigned to feature groups, returning TRUE or FALSE.

Usage

MassSpecEngine$has_formulas()


Method has_compounds()

Checks if there are compounds assigned to feature groups, returning TRUE or FALSE.

Usage

MassSpecEngine$has_compounds()


Method has_chromatograms()

Checks if there are chromatograms, returning TRUE or FALSE.

Usage

MassSpecEngine$has_chromatograms()


Method has_chromatograms_peaks()

Checks if there are integrated peaks from chromatograms, returning TRUE or FALSE.

Usage

MassSpecEngine$has_chromatograms_peaks()


Method has_spectra()

Checks if there are spectra, returning TRUE or FALSE.

Usage

MassSpecEngine$has_spectra()


Method has_spectra_peaks()

Checks if there are spectra peaks, returning TRUE or FALSE.

Usage

MassSpecEngine$has_spectra_peaks()


Method has_spectra_charges()

Checks if there are spectra calculated charges, returning TRUE or FALSE.

Usage

MassSpecEngine$has_spectra_charges()


Method has_neutralized_spectra()

Checks if spectra are neutralized (i.e., m/z converted to mass), returning TRUE or FALSE.

Usage

MassSpecEngine$has_neutralized_spectra()


Method plot_spectra_3d()

Plots raw spectra in 3D for given MS analyses and targets.

Usage

MassSpecEngine$plot_spectra_3d(
  analyses = NULL,
  levels = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  id = NULL,
  allTraces = TRUE,
  isolationWindow = 1.3,
  minIntensityMS1 = 0,
  minIntensityMS2 = 0,
  legendNames = TRUE,
  colorBy = "analyses",
  xVal = "rt",
  yVal = "mz",
  xLab = NULL,
  yLab = NULL,
  zLab = NULL
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

levels

Integer vector with the levels of MS data.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

id

Character with the same length as m/z and retention time targets to be used as identifier/s. When not given, the id is built as a combination of the m/z and retention time ranges or values.

allTraces

Logical, when TRUE all level 2 data is returned. When FALSE and level has 2, only the MS2 traces of MS1 targets are returned, using the isolationWindow to calculate the mass window.

isolationWindow

Numeric value with the isolation window (in Da) applied for ion isolation and fragmentation during acquisition of tandem data (i.e., MS2 data).

minIntensityMS1

Numeric value with the minimum intensity of level 1 data (i.e., MS1 data).

minIntensityMS2

Numeric value with the minimum intensity of level 2 data (i.e., MS2 data).

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

xVal

Character length one. Possible values are "mz", "rt" or "mobility".

yVal

Character length one. Possible values are "mz", "rt" or "mobility".

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

zLab

A string with the title for the z axis.


Method plot_spectra()

Plots spectra given MS analyses.

Usage

MassSpecEngine$plot_spectra(
  analyses = NULL,
  levels = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  id = NULL,
  allTraces = TRUE,
  isolationWindow = 1.3,
  minIntensityMS1 = 0,
  minIntensityMS2 = 0,
  useRawData = FALSE,
  useLoadedData = TRUE,
  legendNames = TRUE,
  colorBy = "analyses",
  xVal = "mz",
  xLab = NULL,
  yLab = NULL,
  title = NULL,
  cex = 0.6,
  showLegend = TRUE,
  interactive = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

levels

Integer vector with the levels of MS data.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

id

Character with the same length as m/z and retention time targets to be used as identifier/s. When not given, the id is built as a combination of the m/z and retention time ranges or values.

allTraces

Logical, when TRUE all level 2 data is returned. When FALSE and level has 2, only the MS2 traces of MS1 targets are returned, using the isolationWindow to calculate the mass window.

isolationWindow

Numeric value with the isolation window (in Da) applied for ion isolation and fragmentation during acquisition of tandem data (i.e., MS2 data).

minIntensityMS1

Numeric value with the minimum intensity of level 1 data (i.e., MS1 data).

minIntensityMS2

Numeric value with the minimum intensity of level 2 data (i.e., MS2 data).

useRawData

Logical of length one. Set to TRUE for parsing raw data not data in results/processed.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

xVal

Character length one. Possible values are "mz", "rt", "mobility" or "mass". spectra from raw data files.

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

title

A string with the title.

cex

Numeric (length 1) defining the scale of the legend for non interactive plotting.

showLegend

Logical (length 1). Set to TRUE to show legend.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.

averaged

Logical of length one. Set to TRUE for plotting the averaged spectra.

baseline

Logical of length one. Set to TRUE for plotting the spectra with baseline corrected.


Method plot_chromatograms()

Plots chromatograms in the analyses.

Usage

MassSpecEngine$plot_chromatograms(
  analyses = NULL,
  chromatograms = NULL,
  rtmin = 0,
  rtmax = 0,
  minIntensity = NULL,
  useRawData = FALSE,
  useLoadedData = TRUE,
  xLab = NULL,
  yLab = NULL,
  title = NULL,
  colorBy = "targets",
  legendNames = NULL,
  showLegend = TRUE,
  xlim = NULL,
  ylim = NULL,
  cex = 0.6,
  interactive = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

chromatograms

A character or integer vector with the ID (i.e. name) or the index of the chromatograms.

rtmin

Numeric (length 1) with the minimum retention time.

rtmax

Numeric (length 1) with the maximum retention time.

minIntensity

Numeric (length 1) with the minimum intensity.

useRawData

Logical of length one. Set to TRUE for parsing raw data not data in results/processed.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

title

A string with the title.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

showLegend

Logical (length 1). Set to TRUE to show legend.

xlim

A length one or two numeric vector for setting the x limits of the plot.

ylim

A length one or two numeric vector for setting the y limits of the plot.

cex

Numeric (length 1) defining the scale of the legend for non interactive plotting.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.


Method plot_chromatograms_baseline()

Plots chromatograms corrected baseline for given analyses.

Usage

MassSpecEngine$plot_chromatograms_baseline(
  analyses = NULL,
  chromatograms = NULL,
  xLab = NULL,
  yLab = NULL,
  title = NULL,
  cex = 0.6,
  showLegend = TRUE,
  colorBy = "analyses",
  interactive = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

chromatograms

A character or integer vector with the ID (i.e. name) or the index of the chromatograms.

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

title

A string with the title.

cex

Numeric (length 1) defining the scale of the legend for non interactive plotting.

showLegend

Logical (length 1). Set to TRUE to show legend.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.


Method plot_spectra_xic()

Plots spectra extract ion chromatograms (EIC) and m/z vs retention time from the analyses.

Usage

MassSpecEngine$plot_spectra_xic(
  analyses = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  id = NULL,
  legendNames = NULL,
  plotTargetMark = TRUE,
  targetsMark = NULL,
  ppmMark = 5,
  secMark = 10,
  numberRows = 1
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

id

Character with the same length as m/z and retention time targets to be used as identifier/s. When not given, the id is built as a combination of the m/z and retention time ranges or values.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

plotTargetMark

Logical (length 1), set to TRUE to plot a target mark.

targetsMark

A data.frame with columns mz and rt, defining the m/z and retention time values of each target. Note that the number of rows should match with the number of targets.

ppmMark

A numeric vector of length one to define the mass deviation, in ppm, of the target mark. The default is 5 ppm.

secMark

A numeric vector of length one to define the time deviation, in seconds, of the target mark. The default is 10 ppm.

numberRows

An integer vector of length one to define the number of rows to grid the plots. Note that each target is always plotted in one row for all selected analyses.


Method plot_spectra_eic()

Plots spectra extract ion chromatograms (EIC) from the analyses based on targets.

Usage

MassSpecEngine$plot_spectra_eic(
  analyses = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  id = NULL,
  legendNames = NULL,
  xLab = NULL,
  yLab = NULL,
  title = NULL,
  colorBy = "targets",
  showLegend = TRUE,
  xlim = NULL,
  ylim = NULL,
  cex = 0.6,
  interactive = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

id

Character with the same length as m/z and retention time targets to be used as identifier/s. When not given, the id is built as a combination of the m/z and retention time ranges or values.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

title

A string with the title.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

showLegend

Logical (length 1). Set to TRUE to show legend.

xlim

A length one or two numeric vector for setting the x limits of the plot.

ylim

A length one or two numeric vector for setting the y limits of the plot.

cex

Numeric (length 1) defining the scale of the legend for non interactive plotting.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.


Method plot_spectra_tic()

Plots the spectra total ion chromatogram (TIC) of each analysis.

Usage

MassSpecEngine$plot_spectra_tic(
  analyses = NULL,
  levels = c(1, 2),
  rt = NULL,
  xLab = NULL,
  yLab = NULL,
  title = NULL,
  colorBy = "analyses",
  legendNames = NULL,
  showLegend = TRUE,
  xlim = NULL,
  ylim = NULL,
  cex = 0.6,
  downsize = 1,
  interactive = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

levels

Integer vector with the levels of MS data.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

title

A string with the title.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

showLegend

Logical (length 1). Set to TRUE to show legend.

xlim

A length one or two numeric vector for setting the x limits of the plot.

ylim

A length one or two numeric vector for setting the y limits of the plot.

cex

Numeric (length 1) defining the scale of the legend for non interactive plotting.

downsize

An integer of length one to downsize the TIC plot. The default is 1.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.


Method plot_spectra_bpc()

Plots the spectra base peak chromatogram (BPC) of each analysis.

Usage

MassSpecEngine$plot_spectra_bpc(
  analyses = NULL,
  levels = c(1, 2),
  rt = NULL,
  xLab = NULL,
  yLab = NULL,
  title = NULL,
  colorBy = "analyses",
  legendNames = NULL,
  showLegend = TRUE,
  xlim = NULL,
  ylim = NULL,
  cex = 0.6,
  interactive = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

levels

Integer vector with the levels of MS data.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

title

A string with the title.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

showLegend

Logical (length 1). Set to TRUE to show legend.

xlim

A length one or two numeric vector for setting the x limits of the plot.

ylim

A length one or two numeric vector for setting the y limits of the plot.

cex

Numeric (length 1) defining the scale of the legend for non interactive plotting.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.


Method plot_spectra_ms2()

Plots level 2 spectra from the analyses based on targets.

Usage

MassSpecEngine$plot_spectra_ms2(
  analyses = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  id = NULL,
  isolationWindow = 1.3,
  mzClust = 0.005,
  presence = 0.8,
  minIntensity = 0,
  legendNames = NULL,
  xLab = NULL,
  yLab = NULL,
  title = NULL,
  colorBy = "targets",
  interactive = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

id

Character with the same length as m/z and retention time targets to be used as identifier/s. When not given, the id is built as a combination of the m/z and retention time ranges or values.

isolationWindow

Numeric value with the isolation window (in Da) applied for ion isolation and fragmentation during acquisition of tandem data (i.e., MS2 data).

mzClust

Numeric (length 1) with the mass deviation threshold (in Da) to cluster mass traces. Highly dependent on the mass resolution of the MS data.

presence

Numeric (length 1) with the required presence ratio from 0 (i.e., doesn't need to be present in any spectra) to 1 (i.e., must be present in all spectra) for traces during clustering of spectra.

minIntensity

Numeric (length 1) with the minimum intensity.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

title

A string with the title.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.


Method plot_spectra_ms1()

Plots level 1 spectra from the analyses based on targets.

Usage

MassSpecEngine$plot_spectra_ms1(
  analyses = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  id = NULL,
  mzClust = 0.003,
  presence = 0.8,
  minIntensity = 1000,
  legendNames = NULL,
  xLab = NULL,
  yLab = NULL,
  title = NULL,
  colorBy = "targets",
  showText = FALSE,
  interactive = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

id

Character with the same length as m/z and retention time targets to be used as identifier/s. When not given, the id is built as a combination of the m/z and retention time ranges or values.

mzClust

Numeric (length 1) with the mass deviation threshold (in Da) to cluster mass traces. Highly dependent on the mass resolution of the MS data.

presence

Numeric (length 1) with the required presence ratio from 0 (i.e., doesn't need to be present in any spectra) to 1 (i.e., must be present in all spectra) for traces during clustering of spectra.

minIntensity

Numeric (length 1) with the minimum intensity.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

title

A string with the title.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

showText

Logical (length 1), set to TRUE to show the text annotations.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.


Method plot_features()

Plots features from analyses.

Usage

MassSpecEngine$plot_features(
  analyses = NULL,
  features = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  rtExpand = 120,
  mzExpand = 0.001,
  useLoadedData = TRUE,
  filtered = FALSE,
  legendNames = NULL,
  xLab = NULL,
  yLab = NULL,
  title = NULL,
  colorBy = "targets",
  showLegend = TRUE,
  xlim = NULL,
  ylim = NULL,
  cex = 0.6,
  interactive = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

features

A character vector with the feature IDs or a data.frame or data.table with a column named feature with the feature IDs. A column named analysis can be given to specify from which analyses the features matched.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

rtExpand

Numeric (length 1) with the retention time values (in seconds) for expanding left and right the retention time range.

mzExpand

Numeric (length 1) with the mass or mass-to-charge ratio (m/z) (in Da) for expanding left and right the mass range.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

title

A string with the title.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

showLegend

Logical (length 1). Set to TRUE to show legend.

xlim

A length one or two numeric vector for setting the x limits of the plot.

ylim

A length one or two numeric vector for setting the y limits of the plot.

cex

Numeric (length 1) defining the scale of the legend for non interactive plotting.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.


Method map_features()

Plots a map of the retention time vs m/z of features from analyses.

Usage

MassSpecEngine$map_features(
  analyses = NULL,
  features = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  filtered = FALSE,
  legendNames = NULL,
  xLab = NULL,
  yLab = NULL,
  title = NULL,
  colorBy = "targets",
  showLegend = TRUE,
  xlim = 30,
  ylim = 0.05,
  cex = 0.6,
  interactive = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

features

A character vector with the feature IDs or a data.frame or data.table with a column named feature with the feature IDs. A column named analysis can be given to specify from which analyses the features matched.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

title

A string with the title.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

showLegend

Logical (length 1). Set to TRUE to show legend.

xlim

A length one or two numeric vector for setting the x limits of the plot.

ylim

A length one or two numeric vector for setting the y limits of the plot.

cex

Numeric (length 1) defining the scale of the legend for non interactive plotting.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.


Method plot_features_ms1()

Plots level 1 spectra from features in the analyses.

Usage

MassSpecEngine$plot_features_ms1(
  analyses = NULL,
  features = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  rtWindow = c(-2, 2),
  mzWindow = c(-5, 100),
  mzClust = 0.003,
  presence = 0.8,
  minIntensity = 1000,
  filtered = FALSE,
  useLoadedData = TRUE,
  legendNames = NULL,
  xLab = NULL,
  yLab = NULL,
  title = NULL,
  colorBy = "targets",
  interactive = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

features

A character vector with the feature IDs or a data.frame or data.table with a column named feature with the feature IDs. A column named analysis can be given to specify from which analyses the features matched.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

rtWindow

Numeric (length 2) with the retention time values (in seconds) for expanding left and right the retention time range. The first element expands left and the second expands right. Note that the first element should be negative to expand to the left.

mzWindow

Numeric (length 2) with the mass or mass-to-charge ratio (m/z) values (in Da) for expanding left and right the mass range. The first element expands left and the second expands right. Note that the first element should be negative to expand to the left.

mzClust

Numeric (length 1) with the mass deviation threshold (in Da) to cluster mass traces. Highly dependent on the mass resolution of the MS data.

presence

Numeric (length 1) with the required presence ratio from 0 (i.e., doesn't need to be present in any spectra) to 1 (i.e., must be present in all spectra) for traces during clustering of spectra.

minIntensity

Numeric (length 1) with the minimum intensity.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

title

A string with the title.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.


Method plot_features_ms2()

Plots level 2 spectra from features in the analyses.

Usage

MassSpecEngine$plot_features_ms2(
  analyses = NULL,
  features = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  isolationWindow = 1.3,
  mzClust = 0.005,
  presence = 0.8,
  minIntensity = 0,
  filtered = FALSE,
  useLoadedData = TRUE,
  legendNames = NULL,
  xLab = NULL,
  yLab = NULL,
  title = NULL,
  colorBy = "targets",
  interactive = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

features

A character vector with the feature IDs or a data.frame or data.table with a column named feature with the feature IDs. A column named analysis can be given to specify from which analyses the features matched.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

isolationWindow

Numeric value with the isolation window (in Da) applied for ion isolation and fragmentation during acquisition of tandem data (i.e., MS2 data).

mzClust

Numeric (length 1) with the mass deviation threshold (in Da) to cluster mass traces. Highly dependent on the mass resolution of the MS data.

presence

Numeric (length 1) with the required presence ratio from 0 (i.e., doesn't need to be present in any spectra) to 1 (i.e., must be present in all spectra) for traces during clustering of spectra.

minIntensity

Numeric (length 1) with the minimum intensity.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

title

A string with the title.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.


Method plot_groups()

Plots feature groups EIC.

Usage

MassSpecEngine$plot_groups(
  groups = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  rtExpand = 15,
  mzExpand = 0.001,
  filtered = FALSE,
  legendNames = NULL,
  xLab = NULL,
  yLab = NULL,
  title = NULL,
  colorBy = "targets",
  showLegend = TRUE,
  xlim = NULL,
  ylim = NULL,
  cex = 0.6,
  interactive = TRUE
)

Arguments

groups

A numeric or character vector with the number or ID of feature groups, respectively.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

rtExpand

Numeric (length 1) with the retention time values (in seconds) for expanding left and right the retention time range.

mzExpand

Numeric (length 1) with the mass or mass-to-charge ratio (m/z) (in Da) for expanding left and right the mass range.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

title

A string with the title.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

showLegend

Logical (length 1). Set to TRUE to show legend.

xlim

A length one or two numeric vector for setting the x limits of the plot.

ylim

A length one or two numeric vector for setting the y limits of the plot.

cex

Numeric (length 1) defining the scale of the legend for non interactive plotting.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.


Method plot_groups_ms1()

Plots level 1 spectra from feature groups in the analyses.

Usage

MassSpecEngine$plot_groups_ms1(
  groups = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  rtWindow = c(-2, 2),
  mzWindow = c(-5, 90),
  mzClustFeatures = 0.005,
  presenceFeatures = 0.8,
  minIntensityFeatures = 1000,
  useLoadedData = TRUE,
  mzClust = 0.005,
  presence = 0.8,
  minIntensity = 1000,
  groupBy = "groups",
  filtered = FALSE,
  legendNames = NULL,
  xLab = NULL,
  yLab = NULL,
  title = NULL,
  colorBy = "targets",
  interactive = TRUE
)

Arguments

groups

A numeric or character vector with the number or ID of feature groups, respectively.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

rtWindow

Numeric (length 2) with the retention time values (in seconds) for expanding left and right the retention time range. The first element expands left and the second expands right. Note that the first element should be negative to expand to the left.

mzWindow

Numeric (length 2) with the mass or mass-to-charge ratio (m/z) values (in Da) for expanding left and right the mass range. The first element expands left and the second expands right. Note that the first element should be negative to expand to the left.

mzClustFeatures

Numeric (length 1) with the mass deviation threshold (in Da) to cluster mass traces for features. Highly dependent on the mass resolution of the MS data.

presenceFeatures

Numeric (length 1) with the required presence ratio from 0 (i.e., doesn't need to be present in any spectra) to 1 (i.e., must be present in all spectra) for traces during clustering of spectra.

minIntensityFeatures

Numeric (length 1) with the minimum intensity for features.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.

mzClust

Numeric (length 1) with the mass deviation threshold (in Da) to cluster mass traces. Highly dependent on the mass resolution of the MS data.

presence

Numeric (length 1) with the required presence ratio from 0 (i.e., doesn't need to be present in any spectra) to 1 (i.e., must be present in all spectra) for traces during clustering of spectra.

minIntensity

Numeric (length 1) with the minimum intensity.

groupBy

String with the way of grouping. Possible values are groups and replicates to group by feature groups or feature groups and replicates, respectively.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

title

A string with the title.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.


Method plot_groups_ms2()

Plots level 1 spectra from feature groups in the analyses.

Usage

MassSpecEngine$plot_groups_ms2(
  groups = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  isolationWindow = 1.3,
  mzClustFeatures = 0.003,
  presenceFeatures = 0.8,
  minIntensityFeatures = 100,
  useLoadedData = TRUE,
  mzClust = 0.003,
  presence = TRUE,
  minIntensity = 100,
  groupBy = "groups",
  filtered = FALSE,
  legendNames = NULL,
  xLab = NULL,
  yLab = NULL,
  title = NULL,
  colorBy = "targets",
  interactive = TRUE
)

Arguments

groups

A numeric or character vector with the number or ID of feature groups, respectively.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

isolationWindow

Numeric value with the isolation window (in Da) applied for ion isolation and fragmentation during acquisition of tandem data (i.e., MS2 data).

mzClustFeatures

Numeric (length 1) with the mass deviation threshold (in Da) to cluster mass traces for features. Highly dependent on the mass resolution of the MS data.

presenceFeatures

Numeric (length 1) with the required presence ratio from 0 (i.e., doesn't need to be present in any spectra) to 1 (i.e., must be present in all spectra) for traces during clustering of spectra.

minIntensityFeatures

Numeric (length 1) with the minimum intensity for features.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.

mzClust

Numeric (length 1) with the mass deviation threshold (in Da) to cluster mass traces. Highly dependent on the mass resolution of the MS data.

presence

Numeric (length 1) with the required presence ratio from 0 (i.e., doesn't need to be present in any spectra) to 1 (i.e., must be present in all spectra) for traces during clustering of spectra.

minIntensity

Numeric (length 1) with the minimum intensity.

groupBy

String with the way of grouping. Possible values are groups and replicates to group by feature groups or feature groups and replicates, respectively.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

title

A string with the title.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.


Method plot_groups_overview()

Method to give an overview of the EIC, alignment and intensity variance from features within target feature groups.

Usage

MassSpecEngine$plot_groups_overview(
  analyses = NULL,
  groups = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  rtExpand = 120,
  mzExpand = 0.001,
  useLoadedData = TRUE,
  correctSuppression = TRUE,
  filtered = FALSE,
  legendNames = NULL,
  title = NULL,
  heights = c(0.35, 0.5, 0.15)
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

groups

A numeric or character vector with the number or ID of feature groups, respectively.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

rtExpand

Numeric (length 1) with the retention time values (in seconds) for expanding left and right the retention time range.

mzExpand

Numeric (length 1) with the mass or mass-to-charge ratio (m/z) (in Da) for expanding left and right the mass range.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.

correctSuppression

Logical (length 1). When TRUE and suppression factor is available the intensities are corrected for suppression.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

title

A string with the title.

heights

A numeric vector of length 3 to control the height of the first, second and third plot, respectively.


Method plot_groups_profile()

Method to plot the intensity profile of feature groups across the analyses.

Usage

MassSpecEngine$plot_groups_profile(
  analyses = NULL,
  groups = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  filtered = FALSE,
  correctSuppression = TRUE,
  normalized = TRUE,
  legendNames = NULL,
  yLab = NULL,
  title = NULL
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

groups

A numeric or character vector with the number or ID of feature groups, respectively.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.

correctSuppression

Logical (length 1). When TRUE and suppression factor is available the intensities are corrected for suppression.

normalized

Logical (length 1). When TRUE the profile intensities are normalized.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

yLab

A string with the title for the y axis.

title

A string with the title.


Method map_components()

Maps feature components in the analyses.

Usage

MassSpecEngine$map_components(
  analyses = NULL,
  features = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 20,
  sec = 60,
  millisec = 5,
  filtered = FALSE,
  xlim = 30,
  ylim = 0.05,
  showLegend = TRUE,
  legendNames = NULL,
  xLab = NULL,
  yLab = NULL,
  title = NULL,
  colorBy = "targets",
  interactive = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

features

A character vector with the feature IDs or a data.frame or data.table with a column named feature with the feature IDs. A column named analysis can be given to specify from which analyses the features matched.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.

xlim

A length one or two numeric vector for setting the x limits of the plot.

ylim

A length one or two numeric vector for setting the y limits of the plot.

showLegend

Logical (length 1). Set to TRUE to show legend.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

title

A string with the title.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.


Method plot_internal_standards()

Plots the quality control assessment of the internal standards.

Usage

MassSpecEngine$plot_internal_standards(
  analyses = NULL,
  presence = TRUE,
  recovery = TRUE,
  deviations = TRUE,
  widths = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

presence

Logical (length 1). When TRUE the presence of the internal standards is plotted.

recovery

Logical (length 1). When TRUE the recovery of the internal standards is plotted.

deviations

Logical (length 1). When TRUE the deviations of the internal standards is plotted.

widths

Logical (length 1). When TRUE the widths of the internal standards is plotted.


Method plot_suspects()

Plots suspects.

Usage

MassSpecEngine$plot_suspects(
  analyses = NULL,
  database = NULL,
  features = NULL,
  mass = NULL,
  mz = NULL,
  rt = NULL,
  mobility = NULL,
  ppm = 4,
  sec = 10,
  millisec = 5,
  ppmMS2 = 10,
  minFragments = 3,
  isolationWindow = 1.3,
  mzClust = 0.003,
  presence = 0.8,
  minIntensity = 0,
  filtered = FALSE,
  rtExpand = 120,
  mzExpand = 0.005,
  useLoadedData = TRUE,
  colorBy = "targets",
  interactive = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

database

A data.frame with at least the columns name and mass, indicating the name and neutral monoisotopic mass of the suspect targets.

features

A character vector with the feature IDs or a data.frame or data.table with a column named feature with the feature IDs. A column named analysis can be given to specify from which analyses the features matched.

mass

A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named min and max with minimum and maximum neutral mass values (in Da), respectively. Alternatively, neutral mass (in Da) and retention time (in seconds) and/or drift time values (in milliseconds) can be given as one data.table or data.frame with columns named mass and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of neutral mass, retention time and drift time targets. In this case, the column names must be min, max, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

mz

A vector with target m/z value/s (in Da) or a two columns data.table or data.frame named mzmin and mzmax with minimum and maximum m/z values (in Da), respectively. Alternatively, m/z (in Da) and retention time values (in seconds) can be given as one data.table or data.frame with columns named mz and rt and/or drift. Then, the deviations given in the ppm, sec and millisec arguments are used to calculate the ranges. Also works with a data.table or data.frame with minimum and maximum values of m/z, retention time and drift time targets. In this case, the column names must be mzmin, mzmax, rtmin, rtmax, driftmin and driftmax. Note that when mass/time ranges are given, the ppm, sec and millisec arguments are not used.

rt

A vector with target retention time values (in seconds) or a two columns data.table or data.frame with minimum and maximum retention time values (in seconds).

mobility

A vector with target drift time values (in milliseconds) or a two columns data.table or data.frame with minimum and maximum drift time values (in milliseconds).

ppm

Numeric of length one with the mass deviation, in ppm.

sec

Numeric of length one with the time deviation, in seconds.

millisec

Numeric of length one with the drift time deviation, in milliseconds.

ppmMS2

Numeric (length 1) with the mass deviation for MS2, in ppm.

minFragments

Integer (length 1) with the minimum number of fragments.

isolationWindow

Numeric value with the isolation window (in Da) applied for ion isolation and fragmentation during acquisition of tandem data (i.e., MS2 data).

mzClust

Numeric (length 1) with the mass deviation threshold (in Da) to cluster mass traces. Highly dependent on the mass resolution of the MS data.

presence

Numeric (length 1) with the required presence ratio from 0 (i.e., doesn't need to be present in any spectra) to 1 (i.e., must be present in all spectra) for traces during clustering of spectra.

minIntensity

Numeric (length 1) with the minimum intensity.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.

rtExpand

Numeric (length 1) with the retention time values (in seconds) for expanding left and right the retention time range.

mzExpand

Numeric (length 1) with the mass or mass-to-charge ratio (m/z) (in Da) for expanding left and right the mass range.

useLoadedData

Logical of length one. Set to TRUE for using loaded data not raw data from files.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.

Details

The ppm and sec which indicate the mass (im ppm) and time (in seconds) deviations applied during the screening.


Method plot_chromatograms_peaks()

Plots peaks from chromatograms from analyses.

Usage

MassSpecEngine$plot_chromatograms_peaks(
  analyses = NULL,
  chromatograms = NULL,
  legendNames = NULL,
  title = NULL,
  colorBy = "targets",
  showLegend = TRUE,
  xlim = NULL,
  ylim = NULL,
  cex = 0.6,
  xLab = NULL,
  yLab = NULL,
  interactive = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

chromatograms

A character or integer vector with the ID (i.e. name) or the index of the chromatograms.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

title

A string with the title.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

showLegend

Logical (length 1). Set to TRUE to show legend.

xlim

A length one or two numeric vector for setting the x limits of the plot.

ylim

A length one or two numeric vector for setting the y limits of the plot.

cex

Numeric (length 1) defining the scale of the legend for non interactive plotting.

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.


Method plot_spectra_charges()

Plots charge assignment of deconvoluted spectra from analyses.

Usage

MassSpecEngine$plot_spectra_charges(
  analyses = NULL,
  legendNames = NULL,
  title = NULL,
  colorBy = "analyses",
  showLegend = TRUE,
  xlim = NULL,
  ylim = NULL,
  cex = 0.6,
  xLab = NULL,
  yLab = NULL,
  interactive = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

title

A string with the title.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

showLegend

Logical (length 1). Set to TRUE to show legend.

xlim

A length one or two numeric vector for setting the x limits of the plot.

ylim

A length one or two numeric vector for setting the y limits of the plot.

cex

Numeric (length 1) defining the scale of the legend for non interactive plotting.

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.


Method plot_spectra_peaks()

Plots peaks from spectra from analyses.

Usage

MassSpecEngine$plot_spectra_peaks(
  analyses = NULL,
  legendNames = NULL,
  title = NULL,
  colorBy = "analyses",
  showLegend = TRUE,
  xlim = NULL,
  ylim = NULL,
  cex = 0.6,
  xLab = NULL,
  yLab = NULL,
  interactive = TRUE
)

Arguments

analyses

A numeric/character vector with the number/name of the analyses.

legendNames

A character vector with the same length as the targets or TRUE or FALSE for using the name in the added targets as legend of the plot.

title

A string with the title.

colorBy

Character (length 1). One of analyses (the default), polarities, levels, targets or replicates. Mixed use (e.g. analyses+polarities) is also possible.

showLegend

Logical (length 1). Set to TRUE to show legend.

xlim

A length one or two numeric vector for setting the x limits of the plot.

ylim

A length one or two numeric vector for setting the y limits of the plot.

cex

Numeric (length 1) defining the scale of the legend for non interactive plotting.

xLab

A string with the title for the x axis.

yLab

A string with the title for the y axis.

interactive

Logical (length 1). When TRUE, the data is plotted interactively using plotly.


Method report_nts()

Saves the HTML report from the function report from the package patRoon. The interface is exactly the same and the arguments description are taken from the documentation in patRoon. Therefore, for further information, we recommend to consult directly the function report in patRoon.

Usage

MassSpecEngine$report_nts(
  path = paste0(getwd(), "/report"),
  filtered = FALSE,
  settingsFile = system.file("report", "settings.yml", package = "patRoon"),
  eicRtWindow = 30,
  eicTopMost = 1,
  eicTopMostByRGroup = TRUE,
  eicOnlyPresent = TRUE,
  eicMzExpWindow = 0.001,
  adductPos = "[M+H]+",
  adductNeg = "[M-H]-",
  specSimMethod = "cosine",
  specSimRemovePrecursor = FALSE,
  specSimMzWeight = 0,
  specSimIntWeight = 1,
  specSimAbsMzDev = 0.005,
  specSimRelMinIntensity = 0.05,
  specSimMinPeaks = 1,
  specSimShift = "none",
  specSimCombineMethod = "mean",
  clearPath = FALSE,
  openReport = TRUE,
  parallel = TRUE
)

Arguments

path

Character (length 1) with the path to the report destination.

filtered

Logical (length 1). When TRUE, filtered features/groups are considered.

settingsFile

The path to the report settings file used for report configuration (see Report settings in report).

eicRtWindow

Retention time (in seconds) that will be subtracted/added to respectively the minimum and maximum retention time of the feature. Thus, setting this value to ‘⁠>0⁠’ will 'zoom out' on the retention time axis.

eicTopMost

Only create EICs for this number of top most intense features. If NULL then EICs are created for all features.

eicTopMostByRGroup

If set to TRUE and topMost is set: only create EICs for the top most features in each replicate group. For instance, when topMost=1 and topMostByRGroup=TRUE, then EICs will be plotted for the most intense feature of each replicate group.

eicOnlyPresent

If TRUE then EICs are created only for analyses in which a feature was detected. If onlyPresent=FALSE then EICs are generated for all analyses. The latter is handy to evaluate if a peak was 'missed' during feature detection or removed during e.g. filtering.

eicMzExpWindow

If eicOnlyPresent is TRUE, to create EICs for analyses in which no feature was found, the m/z value is derived from the min/max values of all features in the feature group. The value of mzExpWindow further expands this window.

adductPos

In sets workflows the adduct must be known to calculate the ionized m/z. If a feature is completely absent in a particular set then it follows no adduct annotations are available and the value of adductPos (positive ionization data) or adductNeg (negative ionization data) will be used instead.

adductNeg

as adductPos.

specSimMethod

The similarity method: either "cosine" or "jaccard".

specSimRemovePrecursor

If TRUE then precursor peaks (i.e. the mass peak corresponding to the feature) are removed prior to similarity calculation.

specSimMzWeight

Mass weights used for cosine calculation.

specSimIntWeight

Intensity weights used for cosine calculation.

specSimAbsMzDev

Maximum absolute m/z deviation between mass peaks, used for binning spectra.

specSimRelMinIntensity

The minimum relative intensity for mass peaks (‘⁠0-1⁠’). Peaks with lower intensities are not considered for similarity calculation. The relative intensities are called after the precursor peak is removed when removePrecursor=TRUE.

specSimMinPeaks

Only consider spectra that have at least this amount of peaks (after the spectrum is filtered).

specSimShift

If and how shifting is applied prior to similarity calculation. Valid options are: "none" (no shifting), "precursor" (all mass peaks of the second spectrum are shifted by the mass difference between the precursors of both spectra) or "both" (the spectra are first binned without shifting, and peaks still unaligned are then shifted as is done when shift="precursor").

specSimCombineMethod

Determines how spectral similarities from different sets are combined. Possible values are "mean", "min" or "max", which calculates the combined value as the mean, minimum or maximum value, respectively. NA values (e.g. if a set does not have peak list data to combine) are removed in advance.

clearPath

If TRUE then the report destination path will be (recursively) removed prior to reporting.

openReport

If set to TRUE then the output report file will be opened with the system browser.

parallel

If set to TRUE then code is executed in parallel.

overrideSettings

A list with settings that override those from the report settings file. See report.

Returns

An interactive HTML report from the package patRoon.


Method clone()

The objects of this class are cloneable with this method.

Usage

MassSpecEngine$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.