Package 'binneR'

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

Help Index


Spectral binning analysis class

Description

An S4 class to store spectrally binned data and accurate mass information.

Slots

version

package version

creation_date

creation date

file_paths

file paths for raw data

sample_info

tibble containing runinfo data

binned_data

list containing tibbles of spectrally binned data for each acquisition mode

accurate_mz

tibble containin accurate mass information

spectra

list containing tibbles of headers and class master mix fingerprints

See Also

binneRlyse


Perform spectral binning

Description

perform spectral binning.

Usage

binneRlyse(files, info, parameters = binParameters(), verbose = TRUE)

Arguments

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

Details

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.

Value

S4 object of class Binalysis.

See Also

Binalysis-class, binParameters, sampleInfo, binnedData, accurateData

Examples

## 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)

Set spectral binning parameters

Description

Selection of parameters to use for spectral binning.

Usage

binParameters(scans = 5:12, cls = character())

Arguments

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

Value

S4 object of class BinParameters

See Also

BinParameters-class, scans, cls

Examples

p <- binParameters(scans = 6:17)

Spectral binning parameters class

Description

An S4 class to store spectral binning parameters.

Slots

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 across all samples

See Also

binParameters


Detect infusion profile scan range

Description

Detect infusion scans for a set of FIE-MS infusion profiles.

Usage

detectInfusionScans(files, thresh = 0.5)

Arguments

files

character vector of file paths to use

thresh

detection threshold as a proportion of the peak of the infusion profile

Value

Numeric vector of detected infusion scans.

See Also

detectParameters

Examples

file_paths <- system.file('example-data/1.mzML.gz',package = 'binneR')

detectInfusionScans(file_paths)

Detect suitable spectral binning parameters

Description

Detect binning parameters from a given list of file paths.

Usage

detectParameters(files)

Arguments

files

character vector of file paths

Value

S4 object of class BinParameters

See Also

BinParameters-class, binParameters

Examples

file_paths <-system.file('example-data/1.mzML.gz',package = 'binneR')
parameters <- detectParameters(file_paths)

Plot a spectral bin feature

Description

Kernal density plot of a specified spectral bin feature.

Usage

plotBin(x, bin, type = c("all", "cls", "sample"))

## S4 method for signature 'Binalysis'
plotBin(x, bin, type = c("all", "cls", "sample"))

Arguments

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.

See Also

accurateData, binneRlyse


Plot bin centrality histogram

Description

Plot the bin centrality distribution for a Binalysis object.

Usage

plotCentrality(x, histBins = 30)

## S4 method for signature 'Binalysis'
plotCentrality(x, histBins = 30)

Arguments

x

S4 object of class Binalysis

histBins

number of bins to use for histogram plotting

See Also

accurateData, binneRlyse, plotPurity


Plot an infusion profile chromatogram

Description

Plot an averaged infusion profile chromatogram from a Binalysis object.

Usage

plotChromatogram(x)

## S4 method for signature 'Binalysis'
plotChromatogram(x)

Arguments

x

S4 object of class Binalysis

See Also

binneRlyse


Plot an infusion profile chromatogram from a file

Description

Plot and averaged infusion profile from a vector of specified file paths.

Usage

plotChromFromFile(files, scans = c())

Arguments

files

character vector of file paths to use

scans

specify scans to highlight within the plot

Examples

file_paths <- system.file('example-data/1.mzML.gz',package = 'binneR')

plotChromFromFile(file_paths, 
                  scans = detectInfusionScans(file_paths))

Plot a fingerprint mass spectrum

Description

Plot averaged spectrum fingerprint.

Usage

plotFingerprint(x)

## S4 method for signature 'Binalysis'
plotFingerprint(x)

Arguments

x

S4 object of class Binalysis

See Also

binneRlyse


Plot bin purity histogram

Description

Plot the bin purity distribution for a Binalysis object.

Usage

plotPurity(x, histBins = 30)

## S4 method for signature 'Binalysis'
plotPurity(x, histBins = 30)

Arguments

x

S4 object of class Binalysis

histBins

number of bins to use for histogram plotting

See Also

accurateData, binneRlyse, plotCentrality


Plot sample total ion counts

Description

Plot sample total ion counts.

Usage

plotTIC(x, by = "injOrder", colour = "block")

## S4 method for signature 'Binalysis'
plotTIC(x, by = "injOrder", colour = "block")

Arguments

x

S4 object of class Binalysis

by

info column to plot against

colour

info column to provide colour labels

See Also

binneRlyse


Read binning parameters from file

Description

Parse binning parameters from a YAML formatted file.

Usage

readBinningParameters(file)

Arguments

file

file path

Value

S4 object of class BinParameters.

See Also

BinParameters-class

Examples

file <- system.file('binning_parameters.yml',package = 'binneR')
parameters <- readBinningParameters(file)

Read and process mulitple data files

Description

Apply spectral binning on multiple data files.

Usage

readFiles(files, dp, scans)

Arguments

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

Details

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.

Value

A list containing peak lists for the relevant scans with combined scan ranges for each present mode in the data file.

Examples

## 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

Description

Get and set spectral binning parameters.

Usage

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) <- value

Arguments

x

S4 object of class BinParameters

value

parameter value to set

See Also

BinParameters-class, binParameters


Show methods for spectral binning classes

Description

Show methods for spectral binning classes.

Usage

## S4 method for signature 'BinParameters'
show(object)

## S4 method for signature 'Binalysis'
show(object)

Arguments

object

S4 objects of class BinParameters or Binanalysi

Author(s)

Jasen Finch [email protected]


Perform single sample spectral binning

Description

Perform spectral binning on a single sample.

Usage

singleSample(file, class = NA, verbose = TRUE)

Arguments

file

file path

class

optional class name

verbose

show console output

Details

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.

Value

S4 object of class Binalysis.

See Also

Binalysis-class

Examples

## 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)

Binalysis class get methods

Description

Methods for accessing spectral binning results from the Binalysis S4 class.

Usage

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)

Arguments

x

S4 object of class Binalysis

Details

  • 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.

See Also

Binalysis-class, binneRlyse