Add additional feature statistics to a SingleCellExperiment object

addFeatureStats(
  sce,
  value = c("counts", "cpm", "tpm", "fpkm"),
  log = FALSE,
  offset = 1,
  no.zeros = FALSE
)

Arguments

sce

SingleCellExperiment to add feature statistics to.

value

the expression value to calculate statistics for. Options are "counts", "cpm", "tpm" or "fpkm". The values need to exist in the given SingleCellExperiment.

log

logical. Whether to take log2 before calculating statistics.

offset

offset to add to avoid taking log of zero.

no.zeros

logical. Whether to remove all zeros from each feature before calculating statistics.

Value

SingleCellExperiment with additional feature statistics

Details

Currently adds the following statistics: mean, variance, coefficient of variation, median and median absolute deviation. Statistics are added to the rowData slot and are named Stat[Log]Value[No0] where Log and No0 are added if those arguments are true. UpperCamelCase is used to differentiate these columns from those added by analysis packages.