topGenes: Returns top n genes of each deconvolved cell-type for a given...

View source: R/functions.R

topGenesR Documentation

Returns top n genes of each deconvolved cell-type for a given beta matrix

Description

For a given beta matrix (cell-type gene distribution matrix), returns the top n genes based on their probability.

Usage

topGenes(beta, n = 10)

Arguments

beta

beta matrix (cell-type gene distribution matrix)

n

number of top genes for each deconvolved cell-type to return (default: 10)

Value

a list where each item is a vector of the top genes and their associated probabilities for a given deconvolved cell-type

Examples

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, ncores=2)
optLDA <- optimalModel(models = ldas, opt = 3)
results <- getBetaTheta(optLDA, perc.filt = 0.05, betaScale = 1000)
deconGexp <- results$beta
genes <- topGenes(deconGexp)


JEFworks-Lab/STdeconvolve documentation built on Nov. 14, 2024, 7:24 p.m.