Create and modify data variables

mutateTracksDf(object, ..., group_by = NULL)

Arguments

object

A valid cypro object.

...

Name-value pairs according to the syntax of dplyr::mutate(). This can be single or several expressions as well as usage of dplyr::across() if several variables are supposed to be affected. See details for output requirements.

group_by

Character vector or NULL. If character, denotes the grouping variables according to which the cell data.frame is grouped via dplyr::group_by() prior to the call to dplyr::mutate().

Value

An updated version of the input cypro-object.

Details

The data.frame that is given to dplyr::mutate() contains all variables from slots cluster, meta and well_plate. Meaning that you can refer to these variables in more complex mutations. 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, x_coords, y_coords etc. must not be changed. Attempts result in an error message.

New variables must be numeric.

In case of multiple phase experiment design the mutation is applied to track data.frame of all phases.

Discarding variables with e.g. new_variable = NULL is not allowed. Use the discard*()-functions for that matter.