compute_complexity: Compute cell complexity

Description Usage Arguments Value Author(s) Examples

View source: R/preprocess.R

Description

Computes the complexity, i.e. the number of genes with count greater than zero for each cell (column).

Usage

1
2
3
4
5
6
compute_complexity(
  x,
  return_sorted = FALSE,
  cell_subset = NULL,
  verbose = FALSE
)

Arguments

x

a numeric matrix or Matrix object.

return_sorted

should the result be returned sorted. Default is FALSE.

cell_subset

a vector of cell IDs for which the complexity should be calculated. Default is NULL.

verbose

suppresses all messages from this function. Default is FALSE.

Value

A named vector of complexity per cell ID.

Author(s)

Avishay Spitzer

Examples

1
2
3
4
5
m <- matrix(c(10, 0, 2, 3, 0, 0, 1, 15, 3), nrow = 3, ncol = 3)

c <- compute_complexity(m) # 2, 1, 3

c <- compute_complexity(m, cell_subset = c(1, 3)) # 2, 3

dravishays/scandal documentation built on Jan. 8, 2020, 1:30 p.m.