Fits SAVER object

saver.fit(x, x.est, do.fast, ncores, sf, scale.sf, pred.genes, pred.cells,
  null.model, ngenes = nrow(x), ncells = ncol(x),
  gene.names = rownames(x), cell.names = colnames(x), estimates.only)

saver.fit.mean(x, ncores, sf, scale.sf, mu, ngenes = nrow(x),
  ncells = ncol(x), gene.names = rownames(x),
  cell.names = colnames(x), estimates.only)

saver.fit.null(x, ncores, sf, scale.sf, ngenes = nrow(x),
  ncells = ncol(x), gene.names = rownames(x),
  cell.names = colnames(x), estimates.only)

Arguments

x

An expression count matrix. The rows correspond to genes and the columns correspond to cells.

x.est

The log-normalized predictor matrix. The rows correspond to cells and the columns correspond to genes.

do.fast

Approximates the prediction step. Default is TRUE.

ncores

Number of cores to use. Default is 1.

sf

Normalized size factor.

scale.sf

Scale of size factor.

pred.genes

Index of genes to perform regression prediction.

pred.cells

Index of cells to perform regression prediction.

null.model

Whether to use mean gene expression as prediction.

ngenes

Number of genes.

ncells

Number of cells.

gene.names

Name of genes.

cell.names

Name of cells.

estimates.only

Only return SAVER estimates. Default is FALSE.

mu

Matrix of prior means.

Value

A list with the following components

estimate

Recovered (normalized) expression

se

Standard error of estimates

info

Information about fit

Details

The SAVER method starts by estimating the prior mean and variance for the true expression level for each gene and cell. The prior mean is obtained through predictions from a Lasso Poisson regression for each gene implemented using the glmnet package. Then, the variance is estimated through maximum likelihood assuming constant variance, Fano factor, or coefficient of variation variance structure for each gene. The posterior distribution is calculated and the posterior mean is reported as the SAVER estimate.