Computes the fold change or log2 fold change (if log=TRUE) in average counts between two groups of cells.

FoldChange(
  object,
  ident.1,
  ident.2 = NULL,
  group.by = NULL,
  cutoff = 0.5,
  assay = NULL,
  verbose = TRUE
)

Arguments

object

A Seurat object

ident.1

Identities of first group of cells to compare.

ident.2

Identities of second group of cells to compare. If NULL, compare cells in the first group to all other cells.

group.by

Grouping variable to use. If NULL, use the current cell identities.

cutoff

Mean count cutoff for classifying as "open". Only used for ordering results. Results will be ordered first by whether the average counts in ident.1 is greater than the cutoff value, then by fold change with respect to ident.2. This prevents very lowly detected peaks from being pushed to the top of the results due to high fold change values.

assay

Name of assay to use. If NULL, use the default assay.

verbose

Display messages

Value

Returns a data.frame

Examples

# \donttest{ fc <- FoldChange(object = atac_small, ident.1 = 0) head(fc)
#> mean_all_other mean_0 fold_change log2_fold_change open #> chr1-1608771-1610748 0.12 0.52 4.333333 2.1154772 TRUE #> chr1-8584964-8586531 0.40 0.74 1.850000 0.8875253 TRUE #> chr1-2130011-2131484 0.68 1.02 1.500000 0.5849625 TRUE #> chr1-1708510-1715065 1.72 2.30 1.337209 0.4192253 TRUE #> chr1-6295272-6296706 0.60 0.78 1.300000 0.3785116 TRUE #> chr1-2125466-2127403 1.34 1.54 1.149254 0.2006974 TRUE
# }