combine_techreps: Combine technical replicates of an omicsData object

View source: R/combine_techreps.R

combine_techrepsR Documentation

Combine technical replicates of an omicsData object

Description

For each biomolecule, this function aggregates the technical replicates of the biological samples using a specified aggregation method

Usage

combine_techreps(omicsData, combine_fn = NULL, bio_sample_names = NULL)

Arguments

omicsData

an object of the class 'lipidData', 'metabData', 'pepData', 'proData', 'nmrData', or 'seqData', created by as.lipidData, as.metabData, as.pepData, as.proData, as.nmrData, or as.seqData, respectively. The parameter techrep_cnames must have been specified when creating this object.

combine_fn

a character string specifying the function used to aggregate across technical replicates. Currently supported functions are 'sum' and 'mean'. Defaults to 'sum' for seqData and 'mean' for all other omicsData.

bio_sample_names

a character string specifying the column in f_data which contains names by which to label aggregated samples in omicsData$e_data and omicsData$f_data OR a character vector with number of elements equal to the number of biological samples. If a column name is specified, it should have a one-to-one correspondence with the technical replicate ID column in f_data. Defaults to NULL, in which case default names are used according to the technical replicate ID column, which was specified at data object creation.

Details

Loss of information after aggregation

f_data: If there are columns in f_data that have more than 1 value per biological sample, then for each biological sample, only the first value in that column will be retained. Technical replicate specific information will be lost.
group information: If a grouping structure has been set using a main effect from f_data that has more than 1 level within any given biological sample, that grouping structure will be removed. Call group_designation again on the aggregated data to assign a grouping structure.
sample names: Identifiers for each biological sample will replace the identifiers for technical replicates as column names in e_data as well as the identifier column attr(omicsData, 'fdata_cname') in f_data.

Value

An object with the same class as omicsData that has been aggregated to the biological sample level

Author(s)

Daniel Claborne

Examples


library(pmartRdata)

pep_object_averaged <- combine_techreps(omicsData = pep_techrep_object)


pmartR/pmartRqc documentation built on March 4, 2024, 3:46 p.m.