Initialize data-driven prior covariance matrices based on principal component analysis.

pois_cov_init(
  data,
  ruv = FALSE,
  Fuv = NULL,
  rho = NULL,
  prop = 1,
  seed = 1,
  npc = 5,
  cutoff = 3
)

Arguments

data

“pois.mash” data object, typically created by calling pois_mash_set_data.

ruv

Logical scalar indicating whether to account for unwanted variation. Default is FALSE. If ruv = TRUE, Fuv and rho must be provided.

Fuv

J x D matrix of latent factors causing unwanted variation, with features as rows and latent factors as columns.

rho

D x R matrix of effects corresponding to unwanted variation, such that bias = Fuv %*% rho.

prop

The proportion by which to take a random subset of genes for prior covariance estimation (useful in case of many genes).

seed

Useful for reproducibility when prop is less than 1.

npc

The number of principal components to use.

cutoff

The threshold for the maximum of absolute values of Z-scores taken across conditions to include as "strong" features used for prior covariance estimation.

Value

A list with initial estimates of prior covariances, and indices of the features (j = 1,...,J) to include in the subsequent ED step.