compute.kld: 2.2 compute KL-divergence (some are adapted from...

View source: R/gsdensity_functions.R

compute.kldR Documentation

2.2 compute KL-divergence (some are adapted from https://github.com/alexisvdb/singleCellHaystack/)

Description

2.2 compute KL-divergence (some are adapted from https://github.com/alexisvdb/singleCellHaystack/)

Usage

## S3 method for class 'kld'
compute(
  coembed,
  genes.use,
  n.grids = 100,
  gene.set.list,
  gene.set.cutoff = 3,
  n.times = 100
)

Arguments

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

Value

kl-divergence between given gene set and random gene sets

Examples


compute.kld(coembed = ce,
            genes.use = intersect(rownames(ce), rownames(pbmc.mtx)),
            gene.set.list = gene.set.list[1:10])



gsdensity documentation built on March 31, 2023, 8:32 p.m.