| Title: | Spectral Processing for High Resolution Flow Infusion Mass Spectrometry |
|---|---|
| Description: | A spectral binning approach for flow infusion electrospray high resolution mass spectrometry (FIE-HRMS) metabolome fingerprinting data. The methodology for this approach is outlined in Finch et al. (2022) <doi:10.1007/s11306-022-01923-6>. |
| Authors: | Jasen Finch [aut, cre] |
| Maintainer: | Jasen Finch <[email protected]> |
| License: | GPL-3 |
| Version: | 2.6.4 |
| Built: | 2026-05-31 09:50:19 UTC |
| Source: | https://github.com/aberHRML/binneR |
An S4 class to store spectrally binned data and accurate mass information.
versionpackage version
creation_datecreation date
file_pathsfile paths for raw data
sample_infotibble containing runinfo data
binned_datalist containing tibbles of spectrally binned data for each acquisition mode
accurate_mztibble containin accurate mass information
spectralist containing tibbles of headers and class master mix fingerprints
perform spectral binning.
binneRlyse(files, info, parameters = binParameters(), verbose = TRUE)binneRlyse(files, info, parameters = binParameters(), verbose = TRUE)
files |
character vector of file paths to use for spectral binning |
info |
tibble containing sample information |
parameters |
object of class BinParameters containing parameters for spectral binning |
verbose |
show console output |
Parallel processing is managed by the future package. This can
be specified using the plan() function. See the example below
and ?future::plan for details on how this can be specified.
By default, spectral binning is performed at the recommended 2 decimal
places. This can be altered by setting either the global option
binner_dp or the environment variable BINNER_DP.
S4 object of class Binalysis.
Binalysis-class, binParameters,
sampleInfo, binnedData, accurateData
## Not run: files <- metaboData::filePaths('FIE-HRMS','BdistachyonTechnical') info <- metaboData::runinfo('FIE-HRMS','BdistachyonTechnical') parameters <- detectParameters(files) cls(parameters) <- 'class' ## Optionally declare parallel processing backend # plan(future::multisession,workers = 2) analysis <- binneRlyse(files, info, parameters = parameters) ## End(Not run)## Not run: files <- metaboData::filePaths('FIE-HRMS','BdistachyonTechnical') info <- metaboData::runinfo('FIE-HRMS','BdistachyonTechnical') parameters <- detectParameters(files) cls(parameters) <- 'class' ## Optionally declare parallel processing backend # plan(future::multisession,workers = 2) analysis <- binneRlyse(files, info, parameters = parameters) ## End(Not run)
Selection of parameters to use for spectral binning.
binParameters(scans = 5:12, cls = character())binParameters(scans = 5:12, cls = character())
scans |
numeric vector containing the scan indexes to use for binning |
cls |
the column of class labels to use for aggregating accurate mass data. Defaults to NULL where accurate mass data will be averaged accross all samples |
S4 object of class BinParameters
BinParameters-class, scans,
cls
p <- binParameters(scans = 6:17)p <- binParameters(scans = 6:17)
An S4 class to store spectral binning parameters.
scansnumeric vector containing the scan indexes to use for binning
clsthe column of class labels to use for aggregating accurate mass data. Defaults to NULL where accurate mass data will be averaged across all samples
Detect infusion scans for a set of FIE-MS infusion profiles.
detectInfusionScans(files, thresh = 0.5)detectInfusionScans(files, thresh = 0.5)
files |
character vector of file paths to use |
thresh |
detection threshold as a proportion of the peak of the infusion profile |
Numeric vector of detected infusion scans.
file_paths <- system.file('example-data/1.mzML.gz',package = 'binneR') detectInfusionScans(file_paths)file_paths <- system.file('example-data/1.mzML.gz',package = 'binneR') detectInfusionScans(file_paths)
Detect binning parameters from a given list of file paths.
detectParameters(files)detectParameters(files)
files |
character vector of file paths |
S4 object of class BinParameters
BinParameters-class, binParameters
file_paths <-system.file('example-data/1.mzML.gz',package = 'binneR') parameters <- detectParameters(file_paths)file_paths <-system.file('example-data/1.mzML.gz',package = 'binneR') parameters <- detectParameters(file_paths)
Kernal density plot of a specified spectral bin feature.
plotBin(x, bin, type = c("all", "cls", "sample")) ## S4 method for signature 'Binalysis' plotBin(x, bin, type = c("all", "cls", "sample"))plotBin(x, bin, type = c("all", "cls", "sample")) ## S4 method for signature 'Binalysis' plotBin(x, bin, type = c("all", "cls", "sample"))
x |
S4 object of class Binalysis |
bin |
0.01amu bin to plot |
type |
bin to be plotted as a total (all), class (cls) or sample spectra. |
Plot the bin centrality distribution for a Binalysis object.
plotCentrality(x, histBins = 30) ## S4 method for signature 'Binalysis' plotCentrality(x, histBins = 30)plotCentrality(x, histBins = 30) ## S4 method for signature 'Binalysis' plotCentrality(x, histBins = 30)
x |
S4 object of class Binalysis |
histBins |
number of bins to use for histogram plotting |
accurateData, binneRlyse,
plotPurity
Plot an averaged infusion profile chromatogram from a Binalysis object.
plotChromatogram(x) ## S4 method for signature 'Binalysis' plotChromatogram(x)plotChromatogram(x) ## S4 method for signature 'Binalysis' plotChromatogram(x)
x |
S4 object of class |
Plot and averaged infusion profile from a vector of specified file paths.
plotChromFromFile(files, scans = c())plotChromFromFile(files, scans = c())
files |
character vector of file paths to use |
scans |
specify scans to highlight within the plot |
file_paths <- system.file('example-data/1.mzML.gz',package = 'binneR') plotChromFromFile(file_paths, scans = detectInfusionScans(file_paths))file_paths <- system.file('example-data/1.mzML.gz',package = 'binneR') plotChromFromFile(file_paths, scans = detectInfusionScans(file_paths))
Plot averaged spectrum fingerprint.
plotFingerprint(x) ## S4 method for signature 'Binalysis' plotFingerprint(x)plotFingerprint(x) ## S4 method for signature 'Binalysis' plotFingerprint(x)
x |
S4 object of class Binalysis |
Plot the bin purity distribution for a Binalysis object.
plotPurity(x, histBins = 30) ## S4 method for signature 'Binalysis' plotPurity(x, histBins = 30)plotPurity(x, histBins = 30) ## S4 method for signature 'Binalysis' plotPurity(x, histBins = 30)
x |
S4 object of class Binalysis |
histBins |
number of bins to use for histogram plotting |
accurateData, binneRlyse,
plotCentrality
Plot sample total ion counts.
plotTIC(x, by = "injOrder", colour = "block") ## S4 method for signature 'Binalysis' plotTIC(x, by = "injOrder", colour = "block")plotTIC(x, by = "injOrder", colour = "block") ## S4 method for signature 'Binalysis' plotTIC(x, by = "injOrder", colour = "block")
x |
S4 object of class Binalysis |
by |
info column to plot against |
colour |
info column to provide colour labels |
Parse binning parameters from a YAML formatted file.
readBinningParameters(file)readBinningParameters(file)
file |
file path |
S4 object of class BinParameters.
file <- system.file('binning_parameters.yml',package = 'binneR') parameters <- readBinningParameters(file)file <- system.file('binning_parameters.yml',package = 'binneR') parameters <- readBinningParameters(file)
Apply spectral binning on multiple data files.
readFiles(files, dp, scans)readFiles(files, dp, scans)
files |
A vector of converted data file paths |
dp |
An integer denoting the number of decimal places for spectral binning |
scans |
A vector of scan numbers that should be retrieved |
Parallel processing is managed by the future package. This can
be specified using the plan() function. See the example below
and ?future::plan for details on how this can be specified.
A list containing peak lists for the relevant scans with combined scan ranges for each present mode in the data file.
## Example file path file_paths <- system.file('example-data/1.mzML.gz',package = 'binneR') ## Optionally declare parallel processing backend # plan(future::multisession,workers = 2) ## Process example file res <- readFiles(file_paths, dp = 2, scans = detectInfusionScans(file_paths))## Example file path file_paths <- system.file('example-data/1.mzML.gz',package = 'binneR') ## Optionally declare parallel processing backend # plan(future::multisession,workers = 2) ## Process example file res <- readFiles(file_paths, dp = 2, scans = detectInfusionScans(file_paths))
Get and set spectral binning parameters.
scans(x) scans(x) <- value cls(x) cls(x) <- value ## S4 method for signature 'BinParameters' scans(x) ## S4 replacement method for signature 'BinParameters' scans(x) <- value ## S4 method for signature 'BinParameters' cls(x) ## S4 replacement method for signature 'BinParameters' cls(x) <- valuescans(x) scans(x) <- value cls(x) cls(x) <- value ## S4 method for signature 'BinParameters' scans(x) ## S4 replacement method for signature 'BinParameters' scans(x) <- value ## S4 method for signature 'BinParameters' cls(x) ## S4 replacement method for signature 'BinParameters' cls(x) <- value
x |
S4 object of class BinParameters |
value |
parameter value to set |
BinParameters-class, binParameters
Show methods for spectral binning classes.
## S4 method for signature 'BinParameters' show(object) ## S4 method for signature 'Binalysis' show(object)## S4 method for signature 'BinParameters' show(object) ## S4 method for signature 'Binalysis' show(object)
object |
S4 objects of class BinParameters or Binanalysi |
Jasen Finch [email protected]
Perform spectral binning on a single sample.
singleSample(file, class = NA, verbose = TRUE)singleSample(file, class = NA, verbose = TRUE)
file |
file path |
class |
optional class name |
verbose |
show console output |
Parallel processing is managed by the future package. This can
be specified using the plan() function. See the example below
and ?future::plan for details on how this can be specified.
By default, spectral binning is performed at the recommended 2 decimal
places. This can be altered by setting either the global option
binner_dp or the environment variable BINNER_DP.
S4 object of class Binalysis.
## Not run: file_path <- metaboData::filePaths('FIE-HRMS','BdistachyonTechnical')[1] ## Optionally declare parallel processing backend # plan(future::multisession,workers = 2) bd <- singleSample(file_path) ## End(Not run)## Not run: file_path <- metaboData::filePaths('FIE-HRMS','BdistachyonTechnical')[1] ## Optionally declare parallel processing backend # plan(future::multisession,workers = 2) bd <- singleSample(file_path) ## End(Not run)
Methods for accessing spectral binning results from the Binalysis S4 class.
version(x) creationDate(x) filePaths(x) sampleInfo(x) binnedData(x) accurateData(x) binningParameters(x) ## S4 method for signature 'Binalysis' version(x) ## S4 method for signature 'Binalysis' creationDate(x) ## S4 method for signature 'Binalysis' filePaths(x) ## S4 method for signature 'Binalysis' sampleInfo(x) ## S4 method for signature 'Binalysis' binnedData(x) ## S4 method for signature 'Binalysis' accurateData(x) ## S4 method for signature 'Binalysis' binningParameters(x)version(x) creationDate(x) filePaths(x) sampleInfo(x) binnedData(x) accurateData(x) binningParameters(x) ## S4 method for signature 'Binalysis' version(x) ## S4 method for signature 'Binalysis' creationDate(x) ## S4 method for signature 'Binalysis' filePaths(x) ## S4 method for signature 'Binalysis' sampleInfo(x) ## S4 method for signature 'Binalysis' binnedData(x) ## S4 method for signature 'Binalysis' accurateData(x) ## S4 method for signature 'Binalysis' binningParameters(x)
x |
S4 object of class Binalysis |
version - Extract package version used to create the object.
creationDate - Extract the creation date of the object.
filePaths - Extract the sample file paths.
sampleInfo - Extract sample meta information.
binnedData - Extract a binned data intensity matrix.
accurateData - Extract sample-wise accurate mass data and bin measures.
binningParametesrExtract the binning parameters.