Counterfactual confounder adjustment for individual-level differential expression analysis

make.cocoa(
  mtx.data,
  celltype,
  cell2indv,
  indv2exp = NULL,
  knn = 10,
  celltype.mat = NULL,
  .rank = 10,
  .take.ln = TRUE,
  .pca.reg = 1,
  .col.norm = 10000,
  .em.iter = 0,
  .em.tol = 1e-04,
  num.threads = 1,
  impute.by.knn = FALSE,
  ...
)

Arguments

mtx.data

fileset.header ($mtx, $row, $col, $idx)

celltype

celltype/cluster assignments (cells x 2 mapping, cells x 1, or just a single string)

cell2indv

cell-level individual assignments (cells x 2), cell -> indv

indv2exp

individual treatment/exposure assignments (indiv x 2), indv -> exposure

knn

number of neighbours k in kNN for matching

celltype.mat

celltype/cluster assignment matrix (cells x cell types)

.rank

SVD rank for spectral matching

.take.ln

take log(1 + x) trans or not

.pca.reg

regularization parameter (default = 1)

.col.norm

column normalization for SVD

.em.iter

EM iteration for factorization (default: 0)

.em.tol

EM convergence (default: 1e-4)

num.threads

number of threads for multi-core processing

impute.by.knn

imputation by kNN weighting (default: FALSE)

a0

hyperparameter for gamma(a0, b0) (default: 1)

b0

hyperparameter for gamma(a0, b0) (default: 1)

eps

small number (default: 1e-8)

Value

a list of sufficient statistics matrices

Details

If treatment/exposure variables are assigned, it will calculate counterfactual individual effects (resid.mu). Otherwise, it will only compute average effect estimations (mu).