Fit a generalized binary covariance decomposition (GBCD) to single cell RNA-seq data containing multiple tumors.

fit_gbcd(
  Y,
  Kmax,
  prior = ebnm::ebnm_generalized_binary,
  maxiter1 = 500,
  maxiter2 = 200,
  maxiter3 = 500,
  control = list(),
  verbose = 1
)

fit_gbcd_control_default()

Arguments

Y

Cell x gene matrix of normalized and log-transformed gene expression data.

Kmax

Integer 2 or greater used to determine the number of final number of factors in the GBCD. The final number of factors is often close to Kmax, and is never greater than 2*Kmax - 1.

prior

Nonnegative prior for GEP memberships, usually the generalized binary prior. The ratio \(\rho = \sigma_k/\mu_k\) in the generalized binary prior can be controlled via the flash_ebnm function from flashier, flash_ebnm(prior_family = "generalized_binary", scale = rho). See also the ebnm_generalized_binary function from the ebnm package for more information.

maxiter1

Positive integer specifying the maximum number of backfit iterations during the GEP membership matrix L initialization.

maxiter2

Positive integer specifying the maximum number of backfit iterations during the GEP membership matrix L estimation.

maxiter3

Positive integer specifying the maximum number of backfit iterations during the GEP signature matrix F estimation.

control

List of control parameters with the following elements: “warmstart”, a logical indicator specifying whether to use warmstart to initialize the prior g when solving EBNM subproblems (see ebnm for details); “extrapolate”, a logical indicator specifying whether to use extrapolation to accelerate backfitting GEP memberships (see flashier for details); “corr_thres”, a numeric scalar between 0 and 1 such that we only keep columns \(l_k\) whose Pearson correlation with \(\tilde{l}_k\) exceeds “corr_thres”.

verbose

Integer specifying whether and how to display progress updates, as described in flashier.

Value

A list including the following elements:

L

cell x GEP matrix containing the posterior estimates of the GEP membership matrix L.

F

List containing the posterior summaries of the GEP signature matrix F.

Examples

# Please see the vignettes for examples.