Calculate the network propagation score using a set of seed cells and cell-to-cell graph.

randomWalk_sparse(
  intM,
  queryCells,
  gamma = 0.05,
  seedWeight = "NO",
  stationary_cutoff = 1e-05
)

Arguments

intM

a sparse matrix indicating the adjacent matrix (m x m, where m is the cell number) of cell-to-cell network (M-kNN graph).

queryCells

a logical vector indicating seed cells (TRUE) and non-seed cells (FALSE) with length of m, where m is the cell number. The length and position are corresponding to intM.

gamma

a numeric value indicating the probability of node restart at each step of random walk.

seedWeight

a numeric vector indicating the weight assigned to each node. "NO" (by default) means considering weights are equal (no weight).

stationary_cutoff

Delta used for determine the stationary state between any two adjacent iterations.

Value

a numeric vector of network propagation score with length of m, where m is the cell number.

Examples

mutualknn30 <- example_results$mutualknn30
seed_idx <- example_results$seed_idx
np_score <- randomWalk_sparse(intM = mutualknn30,
                              queryCells = rownames(mutualknn30)[seed_idx])
#> Stationary step: 95
#> Stationary Delta: 9.37125805585418e-06