music_basis: Prepare Design matrix and Cross-subject Variance for MuSiC...

View source: R/construct.R

music_basisR Documentation

Prepare Design matrix and Cross-subject Variance for MuSiC Deconvolution

Description

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.

Usage

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.


xuranw/MuSiC documentation built on March 7, 2024, 11:45 a.m.