makeAnnotation: Create an annotation data frame

View source: R/preprocess_hlpFunctions.R

makeAnnotationR Documentation

Create an annotation data frame

Description

Creates an annotation data frame based on either an existing annotation data frame or a path to a file which contains the experiment annotation. Annotation in a file can be both a tab-delimited text document or an Excel file. For more details, see read.table and read.xlsx. As an error protection measurement, leading and trailing spaces in each column are trimmed off.

Usage

makeAnnotation(exp_annotation, type_annot = NULL, colClasses = NA)

Arguments

exp_annotation

Either the path to the file which contains the experiment annotation or a data frame containing the experiment annotation. Exactly one colum in the experiment annotation should contain the mass spec run names. Annotation in a file can be both a tab-delimited text document or an Excel file. For more details, see read.table and read.xlsx.

type_annot

If exp_annotation is a path to a file, the type of file. type_annot is mostly obsolete as supported files will be automatically recognized by their extension. Currently only "tab-delim" (tab-delimited file), "xlsx" (Office Open XML Spreadsheet file) and NULL (file type decided based on the extension) are supported. If the extension is not recognized, the file will be assumed to be a tab-delimited file. Defaults to NULL.

colClasses

character. Only used when the exp_annotation argument is a filepath. A vector of classes to be assumed for the columns. Recycled if necessary. If named and shorter than required, names are matched to the column names with unspecified values are taken to be NA. Possible values are NA (the default, when type.convert is used), NULL (when the column is skipped), one of the atomic vector classes (logical, integer, numeric, complex, character, raw), or factor, Date or POSIXct. Otherwise there needs to be an as method (from package methods) for conversion from character to the specified formal class.

Value

A data frame containing the experimental annotation. Possible leading and trailing spaces are trimmed.


ludgergoeminne/MSqRob documentation built on Jan. 11, 2023, 1:32 p.m.