factorizeMatrix-celda_CG-method: Matrix factorization for results from celda_CG

Description Usage Arguments Value See Also Examples

Description

Generates factorized matrices showing the contribution of each feature in each module, each module in each cell and/or cell population, and each cell population in each sample.

Usage

1
2
3
4
5
6
## S4 method for signature 'celda_CG'
factorizeMatrix(
  counts,
  celdaMod,
  type = c("counts", "proportion", "posterior")
)

Arguments

counts

Integer matrix. Rows represent features and columns represent cells. This matrix should be the same as the one used to generate 'celdaMod'.

celdaMod

Celda model. Options are "celda_C" or "celda_CG". Celda object of class "celda_CG".

type

Character vector. A vector containing one or more of "counts", "proportion", or "posterior". "counts" returns the raw number of counts for each factorized matrix. "proportions" returns the normalized probabilities for each factorized matrix, which are calculated by dividing the raw counts in each factorized matrix by the total counts in each column. "posterior" returns the posterior estimates. Default 'c("counts", "proportion", "posterior")'.

Value

A list with elements for 'counts', 'proportions', or 'posterior' probabilities. Each element will be a list containing factorized matrices for 'module', 'cellPopulation', and 'sample'. Additionally, the contribution of each module in each individual cell will be included in the 'cell' element of 'counts' and 'proportions' elements.

See Also

'celda_CG()' for clustering features and cells

Examples

1
2
3
4
5
data(celdaCGSim, celdaCGMod)
factorizedMatrices <- factorizeMatrix(
  celdaCGSim$counts,
  celdaCGMod, "posterior"
)

celda documentation built on June 9, 2020, 2 a.m.