This function is used for generating cell type specific cross-subject mean and variance for each gene. Cell type specific library size is also calcualted.

music_basis(
  x,
  non.zero = TRUE,
  markers = NULL,
  clusters,
  samples,
  select.ct = NULL,
  cell_size = NULL,
  ct.cov = FALSE,
  verbose = TRUE
)

Arguments

x

SingleCellExperiment, single cell dataset

non.zero

logical, default as TRUE. If true, remove all gene with zero expression.

markers

vector or list of gene names. Default as NULL. If NULL, then use all genes provided.

clusters

character, the colData used as clusters;

samples

character,the colData used as samples;

select.ct

vector of cell types. Default as NULL. If NULL, then use all cell types provided.

cell_size

data.frame of cell sizes. 1st column contains the names of cell types, 2nd column has the cell sizes per cell type. Default as NULL. If NULL, then estimate cell size from data.

ct.cov

logical. If TRUE, use the covariance across cell types.

verbose

logical, default as TRUE.

Value

a list of

  • gene by cell type matrix of Design matrix;

  • subject by celltype matrix of Library size;

  • vector of average library size for each cell type;

  • gene by celltype matrix of average relative abundance;

  • gene by celltype matrix of cross-subject variation.