.cmsCell | R Documentation |
Function to calculate a cellspecific mixing score (cms) of groups/batches.
.cmsCell(
cell,
group,
knn,
k_min = NA,
batch_min = NULL,
cell_min = 4,
unbalanced = FALSE,
sce
)
cell |
Character. Name of the cell to calculate cms for.
Needs to be one of |
group |
Character. Name of group/batch variable.
Needs to be one of |
knn |
List with three elements. First "index" with indices of knn cells.
Second "distance" with distances to knn cells. Third a slot named by
|
k_min |
Numeric. Minimum number of knn to include. Default is NA (see Details). |
batch_min |
Numeric. Minimum number of cells per batch to include in to the AD test. If set neighbours will be included until batch_min cells from each batch are present. |
cell_min |
Numeric. Minimum number of cells from each group to be included into the AD test. Should be > 4 to make 'ad.test' working. |
unbalanced |
Boolean. If True neighbourhoods with only one batch present will be set to NA. This way they are not included into any summaries or smoothening. |
sce |
A |
The cms function tests the hypothesis, that group-specific distance
distributions of knn cells have the same underlying unspecified distribution.
It performs Anderson-Darling tests as implemented in the
kSamples package
.
In default the function uses all distances and group label defined in knn.
If k_min
is specified, the first local minimum of the overall distance
distribution with at least kmin cells is used. This can be used to adapt to
the local structure of the datatset e.g. prevent cells from a distinct
different cluster to be included.
A p.value as resulting from the ad.test.
ad.test
, cms
, .smoothCms
Other helper functions:
.defineSubspace()
,
.filterKnn()
,
.filterLocMin()
,
.ldfKnn()
,
.smoothCms()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.