The MassSpecEngine
R6 class is a framework for parsing, processing and inspecting
mass spectrometry (MS) data. MS data (i.e., spectra and chromatograms, including
chromatograms produced by UV detection) can be loaded from mzML and mzXML. 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
(i.e., Agilent MassHunter .d, Thermo Scientific RAW, Shimadzu LCD (except ITOF), Sciex WIFF /
WIFF2) by direct conversion to mzML. Note that conversion of vendor formats is only possible
under Windows OS.
Details
The MassSpecEngine
is using several patRoon patRoon for assembly of Non-Target Analysis (NTA) 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
NonTargetAnalysisResults
Get/Set for the
NonTargetAnalysisResults
results class.Spectra
Get/set for the
Spectra
results class.Chromatograms
Get/set for the chromatograms results class.
Methods
Inherited methods
StreamFind::CoreEngine$clear_cache()
StreamFind::CoreEngine$clear_results()
StreamFind::CoreEngine$get_cache_info()
StreamFind::CoreEngine$get_cache_size()
StreamFind::CoreEngine$has_analyses()
StreamFind::CoreEngine$has_results()
StreamFind::CoreEngine$load()
StreamFind::CoreEngine$print()
StreamFind::CoreEngine$run()
StreamFind::CoreEngine$run_app()
StreamFind::CoreEngine$run_workflow()
StreamFind::CoreEngine$save()
Method new()
Creates an R6 MassSpecEngine
class object.
Usage
MassSpecEngine$new(
metadata = NULL,
workflow = NULL,
analyses = NULL,
centroid = FALSE,
levels = c(1, 2)
)
Arguments
metadata
A named list or a
Metadata
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) and date (must be class POSIXct or POSIXt). A file entry must be a character string with a full path to a file.workflow
A
Workflow
object, a list ofProcessingStep
objects or a character string with a full path to a rds or json file containing aWorkflow
.analyses
A
MassSpecAnalyses
S7 class object or acharacter vector
with full file paths to mzML files or adata.frame
withcolnames
: "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 files. Ifmsconvert
from ProteoWizard is installed and found via CLI (i.e., must be added to the environmental variables), the engine can also load vendor formats (i.e., Agilent MassHunter .d, Thermo Scientific RAW, Shimadzu LCD (except ITOF), Sciex WIFF / WIFF2) 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)
.
Method add_analyses()
Adds analyses. Note that when adding new analyses, any existing results are removed.
Arguments
analyses
A character vector with full file paths to mzML/mzXML files. f
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 (i.e., Agilent MassHunter .d, Thermo Scientific RAW, Shimadzu LCD (except ITOF), Sciex WIFF / WIFF2) by direct conversion to mzML. Note that conversion of vendor formats is only possible under Windows OS.
Method get_spectra_mode()
Gets a character vector with the spectra mode of each analysis (i.e., profile or centroid).
Method get_spectra_level()
Gets a character vector with the spectra levels (e.g., "1, 2") of each analysis.
Method get_spectra_lowest_rt()
Gets a numeric vector with the start retention time value of each analysis.
Method get_spectra_highest_rt()
Gets a numeric vector with the end retention time value of each analysis.
Method get_spectra_tic()
Gets a data.table of the total ion chromatogram (TIC) from each analysis.
Usage
MassSpecEngine$get_spectra_tic(analyses = NULL, levels = c(1, 2), rt = NULL)
Method get_spectra_bpc()
Gets a data.table of the base peak chromatogram (BPC) from each analysis.
Usage
MassSpecEngine$get_spectra_bpc(analyses = NULL, levels = c(1, 2), rt = NULL)
Method get_raw_spectra()
Gets a data.table of spectra from the analyses based on targets.
Usage
MassSpecEngine$get_raw_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
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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. WhenFALSE
and level has 2, only the MS2 traces of MS1 targets are returned, using theisolationWindow
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).
Method get_spectra_eic()
Gets a data.table of extract ion chromatograms (EIC) from the analyses based on targets.
Usage
MassSpecEngine$get_spectra_eic(
analyses = NULL,
mass = NULL,
mz = NULL,
rt = NULL,
mobility = NULL,
ppm = 20,
sec = 60,
millisec = 5,
id = NULL
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.mass
A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named
min
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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.
Method get_spectra_ms1()
Gets a data.table of level 1 spectra from the analyses based on targets.
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
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.mass
A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named
min
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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.
Method get_spectra_ms2()
Gets a data.table of level 2 spectra from the analyses based on targets.
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
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.mass
A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named
min
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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.
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,
downsize = 1,
interactive = TRUE,
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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
orreplicates
. Mixed use (e.g.analyses+polarities
) is also possible.legendNames
A character vector with the same length as the targets or
TRUE
orFALSE
for using the name in the added targets as legend of the plot.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.renderEngine
The engine to render the data. The default is "webgl".
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,
interactive = TRUE,
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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
orreplicates
. Mixed use (e.g.analyses+polarities
) is also possible.legendNames
A character vector with the same length as the targets or
TRUE
orFALSE
for using the name in the added targets as legend of the plot.interactive
Logical (length 1). When
TRUE
, the data is plotted interactively using plotly.renderEngine
The engine to render the data. The default is "webgl".
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",
interactive = TRUE,
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.mass
A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named
min
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
orFALSE
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
orreplicates
. Mixed use (e.g.analyses+polarities
) is also possible.interactive
Logical (length 1). When
TRUE
, the data is plotted interactively using plotly.renderEngine
The engine to render the data. The default is "webgl".
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,
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.mass
A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named
min
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
orFALSE
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
andrt
, 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.
renderEngine
The engine to render the data. The default is "webgl".
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
Character or numeric vector with names or indexes of analyses in the
Analyses
object.mass
A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named
min
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
orFALSE
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
orreplicates
. 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_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
Character or numeric vector with names or indexes of analyses in the
Analyses
object.mass
A vector with target neutral mass value/s (in Da) or a two columns data.table or data.frame named
min
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
orFALSE
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
orreplicates
. Mixed use (e.g.analyses+polarities
) is also possible.interactive
Logical (length 1). When
TRUE
, the data is plotted interactively using plotly.
Method get_raw_chromatograms()
Gets a list of chromatograms data.table objects from each analysis.
Usage
MassSpecEngine$get_raw_chromatograms(
analyses = NULL,
chromatograms = NULL,
rtmin = 0,
rtmax = 0,
minIntensity = NULL
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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.
Method has_results_nts()
Checks if there are NonTargetAnalysisResults results, returning TRUE
or FALSE
.
Method get_chromatograms()
Gets a list of chromatograms from the Chromatograms results.
Usage
MassSpecEngine$get_chromatograms(
analyses = NULL,
chromatograms = NULL,
rtmin = 0,
rtmax = 0,
minIntensity = NULL
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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.
Method get_chromatograms_peaks()
Gets a data.table of integrated peaks from the Chromatograms results.
Usage
MassSpecEngine$get_chromatograms_peaks(
analyses = NULL,
chromatograms = NULL,
rtmin = 0,
rtmax = 0,
minIntensity = NULL
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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.
Method plot_chromatograms()
Plots chromatograms from the Chromatograms results.
Usage
MassSpecEngine$plot_chromatograms(
analyses = NULL,
chromatograms = NULL,
rtmin = 0,
rtmax = 0,
minIntensity = NULL,
normalized = TRUE,
xLab = NULL,
yLab = NULL,
title = NULL,
colorBy = "analyses+targets",
legendNames = NULL,
interactive = TRUE,
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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.
normalized
Logical (length 1). Set to
TRUE
to normalize 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.
colorBy
Character (length 1). One of
analyses
(the default),polarities
,levels
,targets
orreplicates
. Mixed use (e.g.analyses+polarities
) is also possible.legendNames
A character vector with the same length as the targets or
TRUE
orFALSE
for using the name in the added targets as legend of the plot.interactive
Logical (length 1). When
TRUE
, the data is plotted interactively using plotly.renderEngine
The engine to render the data. The default is "webgl".
Method plot_chromatograms_baseline()
Plots baseline correction from the Chromatograms results.
Usage
MassSpecEngine$plot_chromatograms_baseline(
analyses = NULL,
chromatograms = NULL,
xLab = NULL,
yLab = NULL,
title = NULL,
colorBy = "analyses",
interactive = TRUE,
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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.
colorBy
Character (length 1). One of
analyses
(the default),polarities
,levels
,targets
orreplicates
. Mixed use (e.g.analyses+polarities
) is also possible.interactive
Logical (length 1). When
TRUE
, the data is plotted interactively using plotly.renderEngine
The engine to render the data. The default is "webgl".
Method plot_chromatograms_peaks()
Plots chromatographic peaks from the Chromatograms results.
Usage
MassSpecEngine$plot_chromatograms_peaks(
analyses = NULL,
chromatograms = NULL,
rtmin = 0,
rtmax = 0,
minIntensity = NULL,
xLab = NULL,
yLab = NULL,
title = NULL,
colorBy = "analyses+targets",
legendNames = NULL,
interactive = TRUE,
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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.
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
orreplicates
. Mixed use (e.g.analyses+polarities
) is also possible.legendNames
A character vector with the same length as the targets or
TRUE
orFALSE
for using the name in the added targets as legend of the plot.interactive
Logical (length 1). When
TRUE
, the data is plotted interactively using plotly.renderEngine
The engine to render the data. The default is "webgl".
Method get_spectra()
Gets a list of data.table object with spectra 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
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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. WhenFALSE
and level has 2, only the MS2 traces of MS1 targets are returned, using theisolationWindow
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).
Method plot_spectra()
Plots spectra.
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,
legendNames = TRUE,
colorBy = "analyses",
xVal = "mz",
xLab = NULL,
yLab = NULL,
title = NULL,
interactive = TRUE,
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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. WhenFALSE
and level has 2, only the MS2 traces of MS1 targets are returned, using theisolationWindow
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
orFALSE
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
orreplicates
. Mixed use (e.g.analyses+polarities
) is also possible.xVal
Character length one. Possible values are "mz", "rt", "mobility" or "mass".
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.
interactive
Logical (length 1). When
TRUE
, the data is plotted interactively using plotly.renderEngine
The engine to render the data. The default is "webgl".
Method plot_spectra_3d()
Plots spectra in 3D.
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,
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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. WhenFALSE
and level has 2, only the MS2 traces of MS1 targets are returned, using theisolationWindow
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
orFALSE
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
orreplicates
. 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.
renderEngine
The engine to render the data. The default is "webgl".
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",
xLab = NULL,
yLab = NULL,
interactive = TRUE,
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.legendNames
A character vector with the same length as the targets or
TRUE
orFALSE
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
orreplicates
. Mixed use (e.g.analyses+polarities
) is also possible.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.renderEngine
The engine to render the data. The default is "webgl".
Method get_spectra_peaks()
Gets a data.table with peaks from spectra in each analysis.
Method plot_spectra_peaks()
Plots peaks from spectra in each analysis.
Usage
MassSpecEngine$plot_spectra_peaks(
analyses = NULL,
legendNames = TRUE,
colorBy = "analyses",
xVal = "mz",
xLab = NULL,
yLab = NULL,
title = NULL,
interactive = TRUE,
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.legendNames
A character vector with the same length as the targets or
TRUE
orFALSE
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
orreplicates
. Mixed use (e.g.analyses+polarities
) is also possible.xVal
Character length one. Possible values are "mz" or "mobility".
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.
interactive
Logical (length 1). When
TRUE
, the data is plotted interactively using plotly.renderEngine
The engine to render the data. The default is "webgl".
Method plot_spectra_baseline()
Plots spectra baseline correction.
Usage
MassSpecEngine$plot_spectra_baseline(
analyses = NULL,
legendNames = TRUE,
colorBy = "analyses",
xVal = "mz",
xLab = NULL,
yLab = NULL,
title = NULL,
interactive = TRUE,
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.legendNames
A character vector with the same length as the targets or
TRUE
orFALSE
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
orreplicates
. Mixed use (e.g.analyses+polarities
) is also possible.xVal
Character length one. Possible values are "mz" or "mobility".
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.
interactive
Logical (length 1). When
TRUE
, the data is plotted interactively using plotly.renderEngine
The engine to render the data. The default is "webgl".
Method get_spectra_matrix()
Gets a matrix with spectra from analyses.
Method get_features_count()
Gets a data.table with the features count from NonTargetAnalysisResults results.
Method plot_features_count()
Plots the features count from NonTargetAnalysisResults results.
Usage
MassSpecEngine$plot_features_count(
analyses = NULL,
filtered = FALSE,
yLab = NULL,
title = NULL,
colorBy = "analyses",
showLegend = TRUE,
showHoverText = TRUE
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.filtered
Logical (length 1). When
TRUE
, filtered features/groups are considered.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
orreplicates
. Mixed use (e.g.analyses+polarities
) is also possible.showLegend
Logical (length 1). Set to
TRUE
to show legend.showHoverText
Logical (length 1). Set to
TRUE
to show hover text.
Method get_features()
Gets a data.table with all features from NonTargetAnalysisResults 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
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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 namedanalysis
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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 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,
neutral_mass = TRUE,
filtered = FALSE,
legendNames = NULL,
xLab = NULL,
yLab = NULL,
title = NULL,
colorBy = "replicates+targets",
showLegend = TRUE,
interactive = TRUE,
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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 namedanalysis
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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.
neutral_mass
Logical (length 1). Set to
TRUE
to use neutral mass.filtered
Logical (length 1). When
TRUE
, filtered features/groups are considered.legendNames
A character vector with the same length as the targets or
TRUE
orFALSE
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
orreplicates
. Mixed use (e.g.analyses+polarities
) is also possible.showLegend
Logical (length 1). Set to
TRUE
to show legend.interactive
Logical (length 1). When
TRUE
, the data is plotted interactively using plotly.renderEngine
The engine to render the data. The default is "webgl".
Method map_features_intensity()
Plots a map of the retention time vs m/z of features from analyses.
Usage
MassSpecEngine$map_features_intensity(
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 = "replicates+targets",
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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 namedanalysis
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
orFALSE
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
orreplicates
. Mixed use (e.g.analyses+polarities
) is also possible.renderEngine
The engine to render the data. The default is "webgl".
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 = 0,
mzExpand = 0,
filtered = FALSE,
useLoadedData = TRUE
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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 namedanalysis
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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 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",
interactive = TRUE,
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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 namedanalysis
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
orFALSE
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
orreplicates
. Mixed use (e.g.analyses+polarities
) is also possible.interactive
Logical (length 1). When
TRUE
, the data is plotted interactively using plotly.renderEngine
The engine to render the data. The default is "webgl".
Method get_features_ms1()
Gets a data.table of averaged MS1 spectrum for features in the analyses or as selected from the arguments.
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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 namedanalysis
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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 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",
showText = FALSE,
interactive = TRUE
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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 namedanalysis
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
orFALSE
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
orreplicates
. 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 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
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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 namedanalysis
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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 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",
showText = TRUE,
interactive = TRUE
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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 namedanalysis
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
orFALSE
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
orreplicates
. 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 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,
correctIntensity = 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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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).correctIntensity
Logical (length 1) with
TRUE
for correcting the intensity for matrix suppression before applying intensity based filters. Note that suppression factor as obtained by the processing methodCorrectMatrixSuppression
must be present. When not available the correction is ignored even if set toTRUE
.
Method plot_groups()
Plots feature groups EIC.
Usage
MassSpecEngine$plot_groups(
analyses = NULL,
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",
interactive = TRUE,
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
orFALSE
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
orreplicates
. Mixed use (e.g.analyses+polarities
) is also possible.interactive
Logical (length 1). When
TRUE
, the data is plotted interactively using plotly.renderEngine
The engine to render the data. The default is "webgl".
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.005,
useLoadedData = TRUE,
correctIntensity = TRUE,
filtered = FALSE,
legendNames = NULL,
title = NULL,
heights = c(0.35, 0.5, 0.15),
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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.correctIntensity
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
orFALSE
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.
renderEngine
The engine to render the data. The default is "webgl".
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,
correctIntensity = TRUE,
averaged = FALSE,
normalized = TRUE,
legendNames = NULL,
yLab = NULL,
title = NULL,
showLegend = TRUE,
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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.correctIntensity
Logical (length 1) with
TRUE
for correcting the intensity for matrix suppression before applying intensity based filters. Note that suppression factor as obtained by the processing methodCorrectMatrixSuppression
must be present. When not available the correction is ignored even if set toTRUE
.averaged
Logical (length 1). When
TRUE
the profile intensities are averaged.normalized
Logical (length 1). When
TRUE
the profile intensities are normalized.legendNames
A character vector with the same length as the targets or
TRUE
orFALSE
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.
showLegend
Logical (length 1). Set to
TRUE
to show legend.renderEngine
The engine to render the data. The default is "webgl".
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andreplicates
to group by feature groups or feature groups and replicates, respectively.filtered
Logical (length 1). When
TRUE
, filtered features/groups are considered.
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",
showText = FALSE,
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andreplicates
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
orFALSE
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
orreplicates
. 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 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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andreplicates
to group by feature groups or feature groups and replicates, respectively.filtered
Logical (length 1). When
TRUE
, filtered features/groups are considered.
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",
showText = TRUE,
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andreplicates
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
orFALSE
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
orreplicates
. 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 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
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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 namedanalysis
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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 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,
legendNames = NULL,
xLab = NULL,
yLab = NULL,
title = NULL,
colorBy = "targets",
interactive = TRUE,
showLegend = TRUE,
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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 namedanalysis
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
orFALSE
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
orreplicates
. Mixed use (e.g.analyses+polarities
) is also possible.interactive
Logical (length 1). When
TRUE
, the data is plotted interactively using plotly.showLegend
Logical (length 1). Set to
TRUE
to show legend.renderEngine
The engine to render the data. The default is "webgl".
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,
mzrMS2 = 0.008,
minCusiness = 0.7,
minFragments = 3,
filtered = FALSE
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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 namedanalysis
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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.
mzrMS2
Numeric (length 1). The m/z resolution for MS2 spectra.
minCusiness
Numeric (length 1). The minimum Cusiness value for the suspects.
minFragments
Integer (length 1) with the minimum number of fragments.
filtered
Logical (length 1). When
TRUE
, filtered features/groups are considered.
Method plot_suspects()
Plots suspects.
Usage
MassSpecEngine$plot_suspects(
analyses = NULL,
database = NULL,
features = NULL,
mass = NULL,
mz = NULL,
rt = NULL,
mobility = NULL,
ppm = 5,
sec = 10,
millisec = 5,
ppmMS2 = 10,
mzrMS2 = 0.008,
minCusiness = 0.7,
minFragments = 3,
filtered = FALSE,
rtExpand = 120,
mzExpand = 0.005,
useLoadedData = TRUE,
legendNames = NULL,
colorBy = "replicates+targets",
heights = c(0.5, 0.5),
interactive = TRUE
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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 namedanalysis
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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.
mzrMS2
Numeric (length 1). The m/z resolution for MS2 spectra.
minCusiness
Numeric (length 1). The minimum Cusiness value for the suspects.
minFragments
Integer (length 1) with the minimum number of fragments.
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.legendNames
A character vector with the same length as the targets or
TRUE
orFALSE
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
orreplicates
. Mixed use (e.g.analyses+polarities
) is also possible.heights
A numeric vector of length 2 to control the height of the first and second plot, respectively.
interactive
Logical (length 1). When
TRUE
, the data is plotted interactively using plotly.
Method get_internal_standards()
Gets a data.table with internal standards found by the FindInternalStandards
processing method.
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,
renderEngine = "webgl"
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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.renderEngine
The engine to render the data. The default is "webgl".
Method get_fold_change()
Gets a data.table with fold-change analysis between the replicatesIn
and
replicatesOut
.
Usage
MassSpecEngine$get_fold_change(
replicatesIn = NULL,
replicatesOut = NULL,
groups = NULL,
mass = NULL,
mz = NULL,
rt = NULL,
mobility = NULL,
ppm = 4,
sec = 10,
millisec = 5,
filtered = FALSE,
constantThreshold = 0.5,
eliminationThreshold = 0.2,
correctIntensity = FALSE,
fillZerosWithLowerLimit = FALSE,
lowerLimit = NA_real_
)
Arguments
replicatesIn
Character vector with the names of the replicates to be considered as the denominator.
replicatesOut
Character vector with the names of the replicates to be considered as the numerator.
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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.constantThreshold
Numeric of length one. The threshold to consider a feature as constant.
eliminationThreshold
Numeric of length one. The threshold to consider a feature as eliminated.
correctIntensity
Logical of length one. When
TRUE
the suppression factor (when available) is used to correct the intensity before fold-change analysis.fillZerosWithLowerLimit
Logical of length one. When
TRUE
the zero values are filled with the lower limit.lowerLimit
Numeric of length one. The lower limit to fill the zero values.
Method plot_fold_change()
Plots the fold-change analysis between the replicatesIn
and replicatesOut
.
Usage
MassSpecEngine$plot_fold_change(
replicatesIn = NULL,
replicatesOut = NULL,
groups = NULL,
mass = NULL,
mz = NULL,
rt = NULL,
mobility = NULL,
ppm = 4,
sec = 10,
millisec = 5,
filtered = FALSE,
constantThreshold = 0.5,
eliminationThreshold = 0.2,
correctIntensity = FALSE,
fillZerosWithLowerLimit = FALSE,
lowerLimit = NA_real_,
normalized = TRUE,
yLab = NULL,
title = NULL,
interactive = TRUE,
showLegend = TRUE
)
Arguments
replicatesIn
Character vector with the names of the replicates to be considered as the denominator.
replicatesOut
Character vector with the names of the replicates to be considered as the numerator.
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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.constantThreshold
Numeric of length one. The threshold to consider a feature as constant.
eliminationThreshold
Numeric of length one. The threshold to consider a feature as eliminated.
correctIntensity
Logical of length one. When
TRUE
the suppression factor (when available) is used to correct the intensity before fold-change analysis.fillZerosWithLowerLimit
Logical of length one. When
TRUE
the zero values are filled with the lower limit.lowerLimit
Numeric of length one. The lower limit to fill the zero values.
normalized
Logical of length one. When
TRUE
the fold-change values are normalized.yLab
A string with the title for the y axis.
title
A string with the title.
interactive
Logical (length 1). When
TRUE
, the data is plotted interactively using plotly.showLegend
Logical (length 1). Set to
TRUE
to show legend.
Method get_compounds()
Gets a data.table with compounds from the analyses.
Usage
MassSpecEngine$get_compounds(
analyses = NULL,
features = NULL,
mass = NULL,
mz = NULL,
rt = NULL,
mobility = NULL,
ppm = 20,
sec = 60,
millisec = 5,
filtered = FALSE,
averaged = TRUE
)
Arguments
analyses
Character or numeric vector with names or indexes of analyses in the
Analyses
object.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 namedanalysis
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
andmax
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 namedmass
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemin
,max
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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
andmzmax
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 namedmz
andrt
and/ordrift
. Then, the deviations given in theppm
,sec
andmillisec
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 bemzmin
,mzmax
,rtmin
,rtmax
,driftmin
anddriftmax
. Note that when mass/time ranges are given, theppm
,sec
andmillisec
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.averaged
Logical of length one. When
TRUE
the compounds are averaged per analysis replicate group.
Method get_patRoon_features()
Creates an S4 class features
or featureGroups
from the patRoon package.
Method get_patRoon_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_patRoon_MSPeakLists(
clusterMzWindow = 0.005,
topMost = 100,
minIntensityPre = 50,
minIntensityPost = 50,
avgFun = "mean",
method = "distance"
)
Arguments
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.