Compare the cell proportion

CompareCellProp(
  object,
  group.by = NULL,
  prop.in = NULL,
  sample.annotation = NULL,
  cols = NULL,
  comparisons = NULL,
  method.test = "wilcox.test"
)

Arguments

object

Seurat object

group.by

Name of one metadata column to group the cells, usually this refers to the clustering results.

prop.in

Name of one metadata column to compute the cell proportion, usually this refers to the sample identify

sample.annotation

Name of one metadata column to group the samples for comparison

cols

Specific colors for plotting

comparisons

A list of length-2 vectors used to compare the proportion. This parameter is passed to the function stat_compare_means.

method.test

Name of method for statistical test. Default: "wilcox.test"

Value

A ggplot object

Examples

if (FALSE) {
p <- CompareCellProp(
   object = coembed,
   group.by = "RNA_snn_res.0.2",
   prop.in = "patient_region_id",
   sample.annotation = "patient_group",
    comparisons = list(c("myogenic", "ischemic"),
                       c("ischemic", "fibrotic"),
                       c("myogenic", "fibrotic"))
)
}