get_peak_data: Extracts peak data from a raw or mzML file

View source: R/get_peak_data.R

get_peak_dataR Documentation

Extracts peak data from a raw or mzML file

Description

Extract the M/Z and Intensity data for a specific scan number from a raw or mzML file. Use "make_peak_data" to create a "peak_data" object.

Usage

get_peak_data(ScanMetadata, ScanNumber, MinAbundance = 0, MinIntensity = 0)

Arguments

ScanMetadata

Object of the scan_metadata class from get_scan_metadata. Required.

ScanNumber

Integer indicating which scan number to pull the peak data. Required.

MinAbundance

Filter out peaks with an abundance below threshold. Ranges from 0-100. Default is 0.

MinIntensity

Filter out peaks with an intensity below the threshold. Default is 0. If MinAbundance is 0, then the minimum intensity filter will be applied.

Details

The data.table outputted by this function contains both the M/Z and Intensity vectors of the spectra.

Information regarding user input and calculated metrics are stored in the attributes

ScanNumber The scan number of the spectra, as given by the user in the get_peak_data parameters
TotalNumberPeaks The total number of peaks stored in the MS file.
NumberPeaksPostFilter The number of peaks remaining post filter.
PercentagePeaksRemain The percentage or proportion of peaks remaining post-filter. This is NumberPeaksPostFilter/TotalNumberPeaks.
MSPath The path to the MS file

Examples

## Not run: 

# Pull peak data from various examples
peak1 <- get_peak_data(ScanMetadata = BU_ScanMetadata, ScanNumber = 32000)
peak2 <- get_peak_data(ScanMetadata = TD_ScanMetadata, ScanNumber = 5700, MinAbundance = 0)
peak3 <- get_peak_data(ScanMetadata = TD_ScanMetadata, ScanNumber = 5700, MinAbundance = 2)
peak4 <- get_peak_data(ScanMetadata = RAW_ScanMetadata, ScanNumber = 136, MinAbundance = 0.1)
peak5 <- get_peak_data(ScanMetadata = RAW_ScanMetadata, ScanNumber = 136, MinAbundance = 10)


## End(Not run)


EMSL-Computing/pspecterlib documentation built on Jan. 28, 2024, 8:13 p.m.