Skip to contents

Pre-treat both positive and negative ionisation modes for Binalysis and MetaboProfile classes.

Usage

preTreatModes(processed_data, parameters, verbose = TRUE)

# S4 method for Binalysis
preTreatModes(processed_data, parameters, verbose = TRUE)

# S4 method for MetaboProfile
preTreatModes(processed_data, parameters, verbose = TRUE)

Arguments

processed_data

an object of S4 class Binalysis or MetaboProfile

parameters

an object of S4 class AnalysisParameters containing pre-treatment parameters

verbose

print console output

Value

An object of S4 class Analysis.

Examples

## Retrieve file paths and sample information for example data
files <- metaboData::filePaths('FIE-HRMS','BdistachyonEcotypes')[1:2]

info <- metaboData::runinfo('FIE-HRMS','BdistachyonEcotypes')[1:2,]

## Detect spectral binning parameters
bp <- binneR::detectParameters(files)

## Perform spectral binning
analysis <- binneR::binneRlyse(files, 
                               info, 
                               parameters = bp)
#> binneR v2.6.3 Fri Jul 21 17:29:19 2023
#> ________________________________________________________________________________
#> Scans: 5:14 
#> ________________________________________________________________________________
#> Reading raw data
#> Gathering bins
#> Removing single scan events
#> Averaging intensities across scans
#> Calculating bin metrics
#> Calculating accurate m/z
#> Building intensity matrix
#> Gathering file headers
#> 
#> Completed! [1.5S]

## Dectect the pre-treatment parameters
pre_treatment_parameters <- detectPretreatmentParameters(analysis)
#> Batches with < 3 replicates removed: "3", "5"
#> Only 1 batch detected, skipping detection
metabolyseR::changeParameter(pre_treatment_parameters,'parallel') <- 'no'

## Perform pre-treatment
pre_treated_data <- preTreatModes(analysis,
                                  pre_treatment_parameters)
#> 
#> metabolyseR v0.15.1 Fri Jul 21 17:29:21 2023
#> ________________________________________________________________________________
#> Parameters:
#> pre-treatment
#> 	occupancyFilter
#> 		maximum
#> 			cls = class
#> 			occupancy = 2/3
#> 	impute
#> 		class
#> 			cls = class
#> 			occupancy = 2/3
#> 			seed = 1234
#> 	transform
#> 		TICnorm
#> 
#> ________________________________________________________________________________
#> 
#> Negative modeNegative mode 		 [0.5S]
#> Positive modePositive mode 		 [0.6S]
#> ________________________________________________________________________________
#> 
#> Complete! [1.1S]
#>