SCCharacterizePeaks: R6 Class Controlling Peak Characterization

SCCharacterizePeaksR Documentation

R6 Class Controlling Peak Characterization

Description

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

frequency_fit_description

the model for conversion to frequency

mz_fit_description

the model for converting back to m/z

calculate_peak_area

whether to calculate peak area or not

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

Public methods


Method load_file()

Loads the mzml data into the SCZip

Usage
SCCharacterizePeaks$load_file()

Method filter_scans()

Filter the scans in data.

Usage
SCCharacterizePeaks$filter_scans()

Method choose_frequency_model()

Choose the single frequency model.

Usage
SCCharacterizePeaks$choose_frequency_model()

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 generate_filter_scan_function()

Sets the scan filtering and check for outlier function.

Usage
SCCharacterizePeaks$generate_filter_scan_function(
  rtime = NA,
  y.freq = NA,
  f_function = NULL
)
Arguments
rtime

retention time limits of scans to keep

y.freq

y-frequency coefficient limits of scans to keep (NA)

f_function

a full function to set as the filtering function


Method generate_choose_frequency_model_function()

Sets the function for choosing a single frequency model

Usage
SCCharacterizePeaks$generate_choose_frequency_model_function(f_function = NULL)
Arguments
f_function

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(stop_after_initial_detection = FALSE)
Arguments
stop_after_initial_detection

should it stop after the initial peak finding


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(
  filter_scan_function = NULL,
  choose_frequency_model_function = NULL
)
Arguments
filter_scan_function

the scan filtering function

choose_frequency_model_function

the function for choosing a frequency model


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 = tempfile("scpcms"),
  frequency_fit_description = NULL,
  mz_fit_description = NULL,
  filter_remove_outlier_scans = NULL,
  choose_single_frequency_model = NULL,
  sc_peak_region_finder = NULL,
  calculate_peak_area = FALSE
)
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

calculate_peak_area

should peak areas be returned as well as height?


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

## Not run: 
  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$generate_filter_scan_function()
  sc_char$generate_choose_frequency_model_function()
  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()

## End(Not run)

MoseleyBioinformaticsLab/ScanCentricPeakCharacterization documentation built on March 29, 2024, 11:32 p.m.