Description Usage Arguments Value Examples
View source: R/convenience_funcs.R
count_cells
returns a tibble with counts.
1 | count_cells(seurat_object, group_by_var, subgroup_var)
|
seurat_object |
Seurat object. |
group_by_var |
A character value for grouping the cells. Must correspond to a column in Seurat@meta.data. |
subgroup_var |
Optional parameter. A character value for sub-groups within each group. Must correspond to a column in Seurat@meta.data. |
Tibble with cell counts and percentages. If subgroup_var is provided, percentages are calculated from the sub-groups making up groups; otherwise, percentages are calculated from the total cell count across the groups.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # load example dataset from Seurat
data("pbmc_small", package="Seurat")
# Count group-sub-group combinations and calculate % of sub-groups making up groups.
count_cells(pbmc_small, "groups", "RNA_snn_res.0.8")
# Count groups and calculate % of the total that each group consists of.
count_cells(pbmc_small, "groups")
## Not run:
count_cells(pbmc_small)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.