set_annotations: Set Annotations for Samples

View source: R/params_functions.R View source: R/Package-Code5-Compiled.R

set_annotationsR Documentation

Set Annotations for Samples

Description

Set sample annotations that are passed to a variety of functions in the dataVisEasy package.

Usage

set_annotations(annotations)

Arguments

annotations

a data frame where the samples/colnames of the data matrix are the same as the rownames of the annotations matrix. Colnames of provided annotations data frame will serve as the name of the annotations when specifying a "group" or "groupings" argument for a variety of functions. Helpful if the columns of the data frame are factors but not necessary.

Details

Setting up annotations through use of this function allows for a wide range of versatility for all other functions in the package. The rownames of the annotations MUST match with the colnames of input data (an error will be returned if that is not the case) and this allows the user to supply subsets of their data without having to worry about subsetting annotations or data being in the same order as the annotations, all of which is done within the functions themselves. By simply supplying the appropriate arguments with one of the colnames of this annotaitons data frame, data can be grouped and/or colored by these annotations in addition to serving as levels for ANOVAs, template matching, and volcano plots. Importantly, for functionality purposes NAs are not permitted within the dataframe and if NAs are present they will be coerced to "No_Annot" and will function as their own category.

To specify the colors that will accompany each level of each annotation, see set_annot_cols. If colors are not specified, default color values will be applied when necessary. (Not all annotations need to have custom colors, those that do not will be given default colors while those that are specified will be shown as such.)

Please see params for more information about accessing and setting up these variables.

Author(s)

~~Alison Moss~~

See Also

See set_annot_samps and update_annotations for more usage and update these annotations and see set_annotations.genes for the corresponding annotations for the genes/rows of the data.

Examples

##initiate parameters
initiate_params()

##set annotations to data frame where the rownames of the annotations match the colnames of data
head(RAGP_annots)
head(colnames(RAGP_norm)) #(names must match but need not be in the same order)
set_annotations(RAGP_annots)

axm323/dataVisEasy documentation built on Feb. 1, 2024, 11:53 p.m.