cellCounts | R Documentation |
A function to add the frequency (or abundance) of cell clusters per sample to a
cfList
.
cellCounts(cfList, frequency = FALSE, scale = FALSE)
cfList |
a cfList object. It should contain at least data in the 'expr' slot. |
frequency |
one of
|
scale |
a logical value. Do the cell frequencies need to be centered and scaled? The
default |
There are several ways to look at the frequency of the created clusters per sample. First, one
could look at the abundance of the cells (frequency = FALSE
). Second, the frequency of each cluster given
as a percentage of total cells of a sample. For example, if the cfList
is a collection of CD4+ T cells clusters
and one specifies frequency = TRUE
, then the percentage of each cluster of the total CD4+ T cells is returned.
This is done for each sample separately. Lastly, if there is a specific frequency the user wants to look at it is
possible to specify a numeric vector that is treated as the total amount of cells to divide by (e.g. total CD45+ cells).
Make sure that with the latter option specify a numeric vector of same length an order as the sampleID in cfList@samples
.
The rarity of clusters can vary greatly between each other. One cluster can make up a very large chunk of the total,
whereas some clusters only contain a few cells. To equalize the importance of these clusters and make them more
comparable (e.g. in the heatmaps), one could choose to scale the data. The default scale
is called, which
both centers the data to mean zero and scales to unit variance.
Returns the given cfList with a 'counts' slot.
# Read Data dirFCS <- system.file("extdata", package="cytofast") cfData <- readCytosploreFCS(dir = dirFCS, colNames = "description") # Add cell counts to cfList cfData <- cellCounts(cfData)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.