Skip to contents

Peak characterization control

Details

Peak characterization associates data with the SCZip, SCPeakRegionFinder, and controls their execution.

Public fields

found_peaks

peaks found by a function

id

a holder for the ID of the sample

filter_remove_outlier_scans

function to be used for filtering scans, see filter_remove_outlier_scans_default as an example

choose_single_frequency_model

function to be used to choose a single model for frequency conversion, see choose_single_frequency_model_default as an example

frequency_fit_description

the model for conversion to frequency

mz_fit_description

the model for converting back to m/z

sc_peak_region_finder

the peak finder object

sc_zip

the SCZip that represents the final file

in_file

the input file

metadata_file

the metadata file

out_file

where everything gets saved

temp_loc

where intermediates get saved

Methods


Method load_file()

Loads the mzml data into the SCZip

Usage

SCCharacterizePeaks$load_file()


Method prepare_mzml_data()

Prepare the mzml data.

Usage

SCCharacterizePeaks$prepare_mzml_data()


Method set_frequency_fit_description()

Set the frequency fit description

Usage

SCCharacterizePeaks$set_frequency_fit_description(frequency_fit_description)

Arguments

frequency_fit_description

the frequency model description


Method set_mz_fit_description()

Set the mz fit description

Usage

SCCharacterizePeaks$set_mz_fit_description(mz_fit_description)

Arguments

mz_fit_description

the m/z model description


Method set_filter_remove_outlier_scans()

Sets the scan filtering and check for outlier function.

Usage

SCCharacterizePeaks$set_filter_remove_outlier_scans(
  filter_remove_outlier_scans
)

Arguments

filter_remove_outlier_scans

the function to remove outlier scans


Method set_choose_single_frequency_model()

Sets the function for choosing a single frequency model

Usage

SCCharacterizePeaks$set_choose_single_frequency_model(
  choose_single_frequency_model
)

Arguments

choose_single_frequency_model

the function for choosing a single model


Method predict_frequency()

Run frequency prediction

Usage

SCCharacterizePeaks$predict_frequency()


Method check_frequency_model()

Check the frequency model

Usage

SCCharacterizePeaks$check_frequency_model()


Method get_frequency_data()

Get the frequency data from the SCMzml bits

Usage

SCCharacterizePeaks$get_frequency_data()


Method scan_info()

Get the SCMzml$scan_info out

Usage

SCCharacterizePeaks$scan_info()


Method find_peaks()

Do the peak characterization without saving

Usage

SCCharacterizePeaks$find_peaks()


Method summarize()

Generates the JSON output summary.

Usage

SCCharacterizePeaks$summarize()


Method save_peaks()

Saves the peaks and JSON to the temp file

Usage

SCCharacterizePeaks$save_peaks()


Method write_zip()

Write the zip file

Usage

SCCharacterizePeaks$write_zip()


Method run_all()

Runs all of the pieces for peak characterization in order

Usage

SCCharacterizePeaks$run_all()


Method prep_data()

Loads and preps the data for characterization

Usage

SCCharacterizePeaks$prep_data()


Method add_regions()

Adds initial regions for finding real peak containing regions

Usage

SCCharacterizePeaks$add_regions()


Method run_splitting()

Does initial region splitting and peak finding in scans

Usage

SCCharacterizePeaks$run_splitting()


Method new()

Creates a new SCCharacterizePeaks class

Usage

SCCharacterizePeaks$new(
  in_file,
  metadata_file = NULL,
  out_file = NULL,
  temp_loc = NULL,
  frequency_fit_description = NULL,
  mz_fit_description = NULL,
  filter_remove_outlier_scans = NULL,
  choose_single_frequency_model = NULL,
  sc_peak_region_finder = NULL
)

Arguments

in_file

the mass spec data file to use (required)

metadata_file

a json metadata file (optional)

out_file

where to save the final zip container

temp_loc

a specified temporary location

frequency_fit_description

mz -> frequency model

mz_fit_description

frequency -> mz model

filter_remove_outlier_scans

function for scan filtering

choose_single_frequency_model

function to choose a single frequency model

sc_peak_region_finder

a blank SCPeakRegionFinder to use instead of the default


Method clone()

The objects of this class are cloneable with this method.

Usage

SCCharacterizePeaks$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (FALSE) {
  lipid_sample = system.file("extdata",
     "lipid_example.mzML",
     package = "ScanCentricPeakCharacterization")
  sc_char = SCCharacterizePeaks$new(lipid_sample)

  # prep data and check model
  library(ggplot2)
  library(patchwork)
  sc_char$load_file()
  sc_char$prepare_mzml_data()
  sc_char$check_frequency_model()

  # run characterization
  save_loc = "test.zip"
  sc_char = SCCharacterizePeaks$new(lipid_sample,
                                    out_file = save_loc)
  sc_char$run_all()
}