This function is to calculate the MuSiC deconvolution proportions. IMPORTANT: No model is needed. Everything is done inside this method.

deconvolute_music(
  bulk_gene_expression,
  single_cell_object,
  cell_type_annotations,
  batch_ids,
  markers = NULL,
  clusters = "cellType",
  samples = "batchId",
  select_ct = NULL,
  cell_size = NULL,
  ct_cov = FALSE,
  verbose = FALSE,
  iter_max = 1000,
  nu = 1e-04,
  eps = 0.01,
  centered = FALSE,
  normalize = FALSE
)

Arguments

bulk_gene_expression

A matrix of bulk data. Rows are genes, columns are samples. Row and column names need to be set.

single_cell_object

A matrix with the single-cell data. Rows are genes, columns are samples. Row and column names need to be set.

cell_type_annotations

A vector of the cell type annotations. Has to be in the same order as the samples in single_cell_object.

batch_ids

A vector of the ids of the samples or individuals.

markers

vector or list of gene names, default as NULL. If NULL, use all genes that are provided by both bulk and single cell dataset.

clusters

character, the phenoData of single cell dataset used as clusters.

samples

character,the phenoData of single cell dataset 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

Whether to produce an output on the console.

iter_max

numeric, maximum iteration number.

nu

regulation parameter, take care of weight when taking recipical.

eps

Thredshold of convergence.

centered

logic, substract avg of Y and D.

normalize

logic, divide Y and D by their standard deviation.

Value

a list with elements:

  • Estimates of MuSiC

  • Estimates of NNLS

  • Weight of MuSiC

  • r.squared of MuSiC

  • Variance of MuSiC estimates