avgSpectra: Average Spectral Replicates

Description Usage Arguments Value Author(s) References Examples

View source: R/avgSpectra.R

Description

Combines spectral replicates either by averaging (method = "mean") or summing (method = "sum") the intensity values across each row representing a mass-to-charge value in full_mz.

Usage

1
avgSpectra(dat, method = "mean", spectra_cols)

Arguments

dat

The mapped spectral data frame, containing full_mz in the first column.

method

A character string; the method used to combine the spectra. Methods include "sum" and "mean". Default = "mean."

spectra_cols

A character vector; the names of the column in dat containing the intensity data for the spectra-of-interest.

Value

Returns a new column in the input data frame containing the averaged intensity data.

Author(s)

Kristen Yeh <kristenyeh@trentu.ca> Wesley Burr <wesleyburr@trentu.ca> Sophie Castel <sophie.castel@ontariotechu.net>

References

https://github.com/wesleyburr/subMaldi

Examples

1
2
3
4
5
6
7
8
## Load sample dataset "Master.rda"
data("Master")

## Average blank spectrum 1 and 2 using the method "mean"
ex <- avgSpectra(Master, method = "mean", spectra_cols = c("Blank1", "Blank2"))

## Average blank spectrum 1 and 2 using the method "sum"
ex <- avgSpectra(Master, method = "sum", spectra_cols = c("Blank1", "Blank2"))

wesleyburr/subMaldi documentation built on Oct. 1, 2021, 7:07 a.m.