calcDM: Calculate a diffusion map

Description Usage Arguments Details Value See Also Examples

View source: R/diffusion-map.R

Description

URD uses the R package destiny to calculate a diffusion map.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
calcDM(
  object,
  genes.use = object@var.genes,
  cells.use = NULL,
  knn = NULL,
  sigma.use = NULL,
  n_local = 5:7,
  distance = c("euclidean", "cosine", "rankcor"),
  density.norm = T,
  dcs.store = 200,
  verbose = T
)

Arguments

object

An URD object

genes.use

(Character vector) Genes to use (default is variable genes, NULL uses all genes)

cells.use

(Character vector) Cells to use (default is NULL, which uses all cells)

knn

(Numeric) Number of nearest neighbors to use (NULL takes a guess)

sigma.use

(NULL, numeric, or "local") Kernel width to use for the diffusion map (NULL uses destiny's global auto-detection procedure, and "local" determines a sigma for each cell based on the distance to its nearest neighbors.)

n_local

(Numeric) If sigma.use="local", the distance to the n-local(th) nearest neighbors are used for determining the kernel width for each cell.

distance

(Character) Distance metric to use for determining transition probabilities.

density.norm

(Logical) If TRUE, use density normalization

dcs.store

(Numeric) How many diffusion components to store

verbose

(Logical) Report determined values for auto-detected parameters?

Details

The diffusion map is stored in the @dm slot of the URD object, and the transition probabilities (@dm@transitions) are used extensively downstream in URD's pipeline. Important parameters to vary while choosing a diffusion map to use are the number of nearest neighbors considered (the square root of the number of cells is a good starting point, or NULL will trigger destiny to try to determine a good starting point), and the sigma of the Gaussian used to transform cells' distance.

Value

An URD object with the diffusion map stored in @dm.

See Also

DiffusionMap

Examples

1
2
3
4
5
# Allow destiny to determine most parameters on its own
object <- calcDM(object, knn=NULL, sigma.use=NULL)

# Refine the diffusion map by adjusting parameters manually
object <- calcDM(object, knn = 200, sigma.use = 8)

farrellja/URD documentation built on June 17, 2020, 4:48 a.m.