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
)
A matrix of bulk data. Rows are genes, columns are samples. Row and column names need to be set.
A matrix with the single-cell data. Rows are genes, columns are samples. Row and column names need to be set.
A vector of the cell type annotations. Has to be in the same order as the samples in single_cell_object.
A vector of the ids of the samples or individuals.
vector or list of gene names, default as NULL. If NULL, use all genes that are provided by both bulk and single cell dataset.
character, the phenoData of single cell dataset used as clusters.
character,the phenoData of single cell dataset used as samples.
vector of cell types. Default as NULL. If NULL, then use all cell types provided.
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.
logical. If TRUE, use the covariance across cell types.
Whether to produce an output on the console.
numeric, maximum iteration number.
regulation parameter, take care of weight when taking recipical.
Thredshold of convergence.
logic, substract avg of Y and D.
logic, divide Y and D by their standard deviation.
a list with elements:
Estimates of MuSiC
Estimates of NNLS
Weight of MuSiC
r.squared of MuSiC
Variance of MuSiC estimates