View source: R/gsdensity_functions.R
compute.kld | R Documentation |
2.2 compute KL-divergence (some are adapted from https://github.com/alexisvdb/singleCellHaystack/)
## S3 method for class 'kld'
compute(
coembed,
genes.use,
n.grids = 100,
gene.set.list,
gene.set.cutoff = 3,
n.times = 100
)
coembed |
the result from compute.mca |
genes.use |
which genes to use; no default; can use genes based on the gene set selection or use rownames(object) |
n.grids |
number of grid points used for gene set density estimation; larger number is more accurate and slower; default is 100 (recommended to test 100 first) 'coembed', 'genes.use', 'n.grids' are passed to 'compute.grid.coords()' |
gene.set.list |
a list of gene sets; e.g., gene.set.list <- list(gene.set.a = c("A", "B", "C"), gene.set.b = c("a", "b", "c")) |
gene.set.cutoff |
gene sets with length less than this cutoff will not be used; the length is after the intersection of the gene set and genes.use |
n.times |
to evaluate how likely the gene set density is not caused by randomness, size-matched gene sets will be used to compute the background density distribution; This simulation will be done n.times; default is 100 |
kl-divergence between given gene set and random gene sets
compute.kld(coembed = ce,
genes.use = intersect(rownames(ce), rownames(pbmc.mtx)),
gene.set.list = gene.set.list[1:10])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.