View source: R/runDeconvolution.R
runDeconvolution | R Documentation |
This function takes in the mixture data, the trained model & the topic profiles and returns the proportion of each cell type within each mixture
runDeconvolution(
x,
mod,
ref,
scale = TRUE,
min_prop = 0.01,
verbose = TRUE,
slot = "counts"
)
x |
mixture dataset. Can be a numeric matrix,
|
mod |
object of class NMFfit as obtained from trainNMF. |
ref |
Object of class matrix containing the topic profiles for each cell type as obtained from trainNMF. |
scale |
logical specifying whether to scale single-cell counts to unit variance. This gives the user the option to normalize the data beforehand as you see fit (CPM, FPKM, ...) when passing a matrix or specifying the slot from where to extract the count data. |
min_prop |
scalar in [0,1] setting the minimum contribution
expected from a cell type in |
verbose |
logical. Should information on progress be reported? |
slot |
If the object is of class |
base a list where the first element is an NMFfit
object and
the second is a matrix containing the topic profiles learnt.
Marc Elosua Bayes & Helena L Crowell
set.seed(321)
# mock up some single-cell, mixture & marker data
sce <- mockSC(ng = 200, nc = 10, nt = 3)
spe <- mockSP(sce)
mgs <- getMGS(sce)
res <- trainNMF(
x = sce,
y = spe,
groups = sce$type,
mgs = mgs,
weight_id = "weight",
group_id = "type",
gene_id = "gene")
# Run deconvolution
decon <- runDeconvolution(
x = spe,
mod = res[["mod"]],
ref = res[["topic"]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.