pseudotimeDetermineLogistic: Determine logistic parameters for biasing transition matrix

Description Usage Arguments Details Value Examples

View source: R/diffusion.R

Description

This determines the slope and inflection point of the logistic function used to bias the transition probabilities, based on the pseudotimes of cells in the data.

Usage

1
2
3
4
5
6
7
8
9
pseudotimeDetermineLogistic(
  object,
  pseudotime,
  optimal.cells.forward,
  max.cells.back,
  pseudotime.direction = "<",
  do.plot = T,
  print.values = T
)

Arguments

object

An URD object

pseudotime

(Character) Name of pseudotime to use for biasing (i.e. a column name of @pseudotime)

optimal.cells.forward

(Numeric) The number of cells in the direction specified by pseudotime.direction at which the logistic should reach 1-asymptote.

max.cells.back

(Numeric) The number of cells in the direction opposite from that specified by pseudotime.direction at which the logistic should reach asymptote.

pseudotime.direction

(Character: "<" or ">") Which direction to bias the transition probabilities ("<" is default, which biases them to move toward cells with younger pseudotime.)

do.plot

(Logical) Should the logistic function be plotted?

print.values

(Logical) Should the values determined for the logistic be printed?

Details

For determining the developmental trajectories, it is critical to ensure that when walks reach a branchpoint in the data, they continue toward the root, rather than turning down the path toward a different differentiated population. Thus, we convert the undirected graph defined by the transition probabilities into a directed graph where transitions are much more likely to earlier or equally pseudotimed cells than to later pseudotimed cells (which would correspond to a different, more differentiated branch). To do this, we biased the transition probabilities between each pair of cells by multiplying the original transition probabilities with a factor that ranges from 0 to 1. These factors are obtained by transforming the difference in pseudotime between the two cells with a logistic function. This function uses the average difference in pseudotime between cells that are optimal.cells.forward and max.cells.back apart (when all cells in the data are ranked according to pseudotime) to determine k and x0 for the logistic function.

Value

A list: Logistic parameters to use in pseudotimeWeightTransitionMatrix.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Determine parameters of logistic function
diffusion.logistic <- pseudotimeDetermineLogistic(object, "pseudotime", optimal.cells.forward = 40, max.cells.back = 80, pseudotime.direction = "<", do.plot = T, print.values = T)

# Generate biased transition matrix
biased.tm <- pseudotimeWeightTransitionMatrix(object, pseudotime = "pseudotime", logistic.params = diffusion.logistic, pseudotime.direction = "<")

# Simulate random walks
these.walks <- simulateRandomWalk(start.cells = tip.10.cells, transition.matrix = biased.tm, end.cells = root.cells, n = 50000, end.visits = 1, verbose.freq = 2500, max.steps = 5000)

# Process walks into visitation frequency
object <- processRandomWalks(object, walks = these.walks, walks.name = "10", verbose = F)

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