processRandomWalksFromTips: Process random walks from all tips

Description Usage Arguments Value Examples

View source: R/diffusion.R

Description

This processes random walks from several tips automatically. See processRandomWalks for more information. This function can be run directly with the output of simulateRandomWalksFromTips.

Usage

1
2
3
4
5
6
7
processRandomWalksFromTips(
  object,
  walks.list,
  aggregate.fun = mean,
  n.subsample = 10,
  verbose = T
)

Arguments

object

An URD object

walks.list

(List of lists) List of character vectors of cells visited during random walks. (This is the output format of simulateRandomWalksFromTips)

aggregate.fun

(Function) Function to aggregate pseudotime (default: mean)

n.subsample

(Numeric) Number of subsamplings to perform for calculating stability

verbose

(Logical) Report on progress?

Value

An URD object with cell visitation frequencies stored in @diff.data, calculated pseudotimes stored in @pseudotime, and subsampled data in @pseudotime.stability.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Determine the parameters of the logistic used to bias the transition probabilities. The procedure
# is relatively robust to this parameter, but the cell numbers may need to be modified for larger
# or smaller data sets.
axial.ptlogistic <- pseudotimeDetermineLogistic(axial, "pseudotime", optimal.cells.forward=20, max.cells.back=40, do.plot = T)

# Bias the transition matrix acording to pseudotime
axial.biased.tm <- as.matrix(pseudotimeWeightTransitionMatrix(axial, "pseudotime", logistic.params=axial.ptlogistic))

# Simulate the biased random walks from each tip
axial.walks <- simulateRandomWalksFromTips(axial, tip.group.id="tip.clusters", root.cells=root.cells, transition.matrix = axial.biased.tm, n.per.tip = 25000, root.visits = 1, max.steps = 5000, verbose = F)

# Process the biased random walks into visitation frequencies
axial <- processRandomWalksFromTips(axial, axial.walks, verbose = F)

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