Description Usage Arguments Details Value
View source: R/imbalance_score.R
Compute an imbalance score to show whether nearby cells have the same condition of not
1 | imbalance_score(rd, cl, k = 10, smooth = k)
|
rd |
The reduced dimension matrix of the cells |
cl |
the vector of conditions |
k |
The number of neighbours to consider when computing the score. Default to 10. |
smooth |
The smoothing parameter. Default to k. Lower values mean that we smooth more. |
The score is computed in two steps. First, a score is computed for
each cell. The distribution of labels among the k
-nearest- neighbours
is computed to the overall distribution for all cells. This yields a p-value
based on the multinomial distribution, which is squared to return the scores.
Then, splines are used to smooth the scores along the reduced dimension space,
with smooth
nodes. This yields the scaled_scores.
A list with two components:
scores
is the raw score, a vector with one value per cell.
scaled_scores
is the score after local smoothing. A vector with one value per cell.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.