Implementation of dplyr::mutate()
that allows
to modify cell data.frames of the cypro object.
mutateClusterDf(object, ..., group_by = NULL, phase = NULL)
mutateMetaDf(object, ..., group_by = NULL, phase = NULL)
mutateStatsDf(object, ..., group_by = NULL)
object | A valid cypro object. |
---|---|
... | Name-value pairs according to the syntax of |
group_by | Character vector or NULL. If character, denotes the grouping variables
according to which the cell data.frame is grouped via |
phase | Character or numeric. If character, the ordinal value referring to the phase of interest (e.g. 'first', 'second' etc.). referring to the phase of interest or 'all'. If numeric, the number referring to the phase. If set to NULL takes the phase denoted as default with Ignored if the experiment design contains only one phase. |
An updated version of the input cypro
-object.
Process:
The data.frame that is given to dplyr::mutate()
contains all variables
from slots cluster, meta, stats and well_plate. Meaning that you
can refer to variables from slot cluster or well plate, for instance, if you
want to mutate the stats data.frame. Prior to setting the
mutated data.frame back in its original slot data variables from other slots are removed.
Output requirements to ensure the cypro objects integrity:
Protected variables such as cell_id, cell_line, condition, well_plate_name etc. must not be changed. Attempts result in an error message.
In case of the stats data.frame new variables must be numeric. In case of the other three slots new variables must be of class factor or character. The latter is converted to factor automatically.
Discarding variables with e.g. cluster_variable_x = NULL is not allowed. Use
the discard*()
-functions for that matter.