group_designation {pmartR} | R Documentation |
Creates Attribute of omicsData Object for Group Membership
Description
The method assigns each sample to a group, for use in future analyses, based on the variable(s) specified as main effects.
Usage
group_designation(
omicsData,
main_effects = NULL,
covariates = NULL,
cov_type = NULL,
pair_id = NULL,
pair_group = NULL,
pair_denom = NULL,
batch_id = NULL
)
Arguments
omicsData |
an object of the class 'lipidData', 'metabData', 'pepData',
'proData', 'isobaricpepData', 'nmrData', or 'seqData', usually created by
|
main_effects |
a character vector with no more than two variable names
that should be used as main effects to determine group membership of
samples. The variable name must match a column name from |
covariates |
a character vector of no more than two variable names that should be used as covariates in downstream analyses. Covariates are typically variables that a user wants to account for in the analysis but quantifying/examining the effect of the variable is not of interest. |
cov_type |
An optional character vector (must be the same length as
|
pair_id |
A character string indicating the column in |
pair_group |
A character string specifying the column in |
pair_denom |
A character string specifying which pair group is the "control". When taking the difference, the value for the control group will be subtracted from the non-control group value. |
batch_id |
an optional character vector of no more than one variable that should be used as batch information for downstream analyses. Batch ID is similar to covariates but unlike covariates it is specific to that of specific batch effects |
Details
Groups are formed based on the levels of the main effect variables. One or two main effect variables are allowed. In the case of two main effect variables, groups are formed based on unique combinations of the levels of the two main effect variables. Any samples with level NA for a main effect variable will be removed from the data and will not be included in the final group designation results. Groups with a single sample are allowed, as is a single group.
Value
An object of the same class as the input omicsData
object -
the provided object with the samples filtered out, if any NAs were produced
in designating groups. An attribute 'group_DF', a data.frame with columns
for sample id and group, is added to the object. If two main effects are
provided the original main effect levels for each sample are returned as
the third and fourth columns of the data.frame. Additionally, the
covariates provided will be listed as attributes of this data.frame.
Author(s)
Lisa Bramer, Kelly Stratton
Examples
library(pmartRdata)
mylipid <- group_designation(
omicsData = lipid_pos_object,
main_effects = "Virus"
)
attr(mylipid, "group_DF")