computeAveExpr: Compute averaged expression values for each cell group

View source: R/modeling.R

computeAveExprR Documentation

Compute averaged expression values for each cell group

Description

Compute averaged expression values for each cell group

Usage

computeAveExpr(
  object,
  features = NULL,
  group.by = NULL,
  type = c("triMean", "truncatedMean", "median"),
  trim = NULL,
  slot.name = c("data.signaling", "data"),
  data.use = NULL
)

Arguments

object

CellChat object

features

a char vector giving the used features. default use all features

group.by

cell group information; default is 'object@idents' when input is a single object and 'object@idents$joint' when input is a merged object; otherwise it should be one of the column names of the meta slot

type

methods for computing the average gene expression per cell group.

By default = "triMean", defined as a weighted average of the distribution's median and its two quartiles (https://en.wikipedia.org/wiki/Trimean);

When setting ‘type = "truncatedMean"', a value should be assigned to ’trim'. See the function 'base::mean'.

trim

the fraction (0 to 0.25) of observations to be trimmed from each end of x before the mean is computed.

slot.name

the data in the slot.name to use

data.use

a customed data matrix. Default: data.use = NULL and the expression matrix in the 'slot.name' is used

Value

Returns a matrix with genes as rows, cell groups as columns.


sqjin/CellChat documentation built on Nov. 10, 2023, 4:29 a.m.