View source: R/annotateNhoods.R
annotateNhoods | R Documentation |
This function assigns a categorical label to neighbourhoods in the differential abundance results
data.frame (output of testNhoods
), based on the most frequent label among cells in each
neighbourhood. This can be useful to stratify DA testing results by cell types or samples.
Also the fraction of cells carrying that label is stored.
annotateNhoods(x, da.res, coldata_col, subset.nhoods = NULL)
x |
A |
da.res |
A |
coldata_col |
A character scalar determining which column of |
subset.nhoods |
A character, numeric or logical vector that will subset the annotation to the specific nhoods. If
a character vector these should correspond to row names of |
For each neighbourhood, this calculates the most frequent value of colData(x)[coldata_col]
among cells in the neighbourhood and assigns that value as annotation for the neighbourhood, adding a column in the
da.res
data.frame. In addition, a coldata_col_fraction
column will be added, storing the fraction of cells
carrying the assigned label. While in practice neighbourhoods are often homogeneous, one might choose to remove an
annotation label when the fraction of cells with the label is too low (e.g. below 0.6).
A data.frame
of model results (as da.res
input) with two new columns: (1) coldata_col
storing
the assigned label for each neighbourhood; (2) coldata_col_fraction
storing the fraction of cells in the neighbourhood with
the assigned label.
Emma Dann
NULL
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.