getCorrMtx | R Documentation |
Find Pearson's correlations between topics (cell-types) with respect to their proportions across documents (pixels), i.e. thetas, or gene probabilities, i.e. betas.
getCorrMtx(m1, m2, type = c("t", "b"), thresh = NULL, verbose = TRUE)
m1 |
first matrix |
m2 |
second matrix |
type |
must be either "t" (theta; cell-type proportions across pixels) or "b" (beta; cell-type gene expression profiles) |
thresh |
if comparing betas, use to compare genes above this probability (e.g., expression level). NULL or 0 < numeric < 1.0 (default: NULL) |
verbose |
control the verbosity (default: TRUE) |
matrix of Pearson's correlations; m1 (rows) by m2 (cols)
data(mOB)
pos <- mOB$pos
cd <- mOB$counts
counts <- cleanCounts(cd, min.lib.size = 100)
corpus <- restrictCorpus(counts, removeAbove=1.0, removeBelow = 0.05)
ldas <- fitLDA(t(as.matrix(corpus)), Ks = 3)
optLDA <- optimalModel(models = ldas, opt = 3)
results <- getBetaTheta(optLDA, perc.filt = 0.05, betaScale = 1000)
deconProp <- results$theta
corMtx <- getCorrMtx(m1 = as.matrix(deconProp), m2 = as.matrix(deconProp), type = "t")
rownames(corMtx) <- paste0("X", seq(nrow(corMtx)))
colnames(corMtx) <- paste0("X", seq(ncol(corMtx)))
head(corMtx)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.