View source: R/get_peak_data.R
get_peak_data | R Documentation |
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.
get_peak_data(ScanMetadata, ScanNumber, MinAbundance = 0, MinIntensity = 0)
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. |
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 |
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.