Subset functions allow to conveniently split your data by certain characteristics such as cell lines, conditions, cluster etc. or for specific cell ids. This might be useful if you want apply some machine learning algorithms such as clustering and correlation on only a subset of cells. See details for more information.
subsetByCluster(
object,
new_name,
cluster_variable,
cluster,
phase = NULL,
verbose = NULL
)
subsetByGroup(
object,
new_name = NULL,
grouping_variable,
groups,
phase = NULL,
verbose = NULL
)
object | A valid cypro object. |
---|---|
new_name | Character value. Denotes the name of the output object. If set to NULL the name of the input object is taken and suffixed with '_subset'. |
cluster_variable, grouping_variable | Character value. Denotes variable from which to subset the cells. |
cluster, groups | Character vector. Denotes the exact cluster/group names carried by the
variable specified with argument |
verbose | Logical. If set to TRUE informative messages regarding the computational progress will be printed. (Warning messages will always be printed.) |
A cypro object that contains the data for the subsetted cells.
Creating subsets of your data affects analysis results such as clustering and correlation which
is why these results are reset in the subsetted object and must be computed again. To prevent inadvertent overwriting
the default directory is reset as well. Make sure to set a new one via setDefaultDirectory()
.
The mechanism with which you create the subset is stored in the output object. Use printSubsetHistory()
to reconstruct the way from the original object to the current one.
In case of experiment set ups with multiple phases:
As creating subsets of your data affects downstream analysis results you have to manually specify the phase for which the grouping of interest has been calculated.
The output object contains data for all phases but only for those cells that matched
the input for argument cluster
/groups
in the specified variable during
the specified phase.