pasteAnnotation: Add annotations to a data frame in "long" format

View source: R/preprocess_hlpFunctions.R

pasteAnnotationR Documentation

Add annotations to a data frame in "long" format

Description

This function adds extra columns to a data frame in "long" format (i.e. the data frame has one observation row per measurement (thus, multiple rows per subject)) based on either a path to an annotation file or an annotation data frame.

Usage

pasteAnnotation(df, run_col, run_col_annot, pData)

Arguments

df

A data frame in "long" format to which extra annotation columns need to be added.

run_col

A character indicating the column in the data frame df that contains a different identifier for each mass spec run. All elements in this column should be present exactly once in exactly one column of the experimental annotation data frame pData and be equal to the elements of the run_col_annot column in the pData data frame.

run_col_annot

A character indicating the column in the annotation data frame pData that contains a different identifier for each mass spec run. All elements in this column should be present exactly once in this column of the experimental annotation data frame pData and be equal to the elements of the run_col column in the data frame df.

pData

A data frame containing the experiment annotation. Exactly one colum in the experiment annotation should contain the mass spec run names.

Value

A data frame to which the annotations are left-joined.


statOmics/MSqRob documentation built on Dec. 8, 2022, 6 a.m.