Description Usage Arguments Value Examples
This takes the matrix of transition probabilities and biases them according to
the difference in pseudotime between each pair of cells. The parameters of the
logistic function can be manually chosen or determined using pseudotimeDetermineLogistic
.
The biased transition matrix is used as input to simulateRandomWalk
or
simulateRandomWalksFromTips
.
1 2 3 4 5 6 7 8 9 10 | pseudotimeWeightTransitionMatrix(
object,
pseudotime,
x0 = NULL,
k = NULL,
logistic.params = NULL,
pseudotime.direction = "<",
max.records = 2.25e+08,
verbose = F
)
|
object |
An URD object |
pseudotime |
(Character) Name of pseudotime to use for biasing (i.e. a column name of |
x0 |
(Numeric) Inflection point of the logistic function (in terms of pseudotime difference). Can be left |
k |
(Numeric) Slope of the logistic function. Can be left |
logistic.params |
(List) Output from |
pseudotime.direction |
(Character: ">" or "<") Which direction to bias the transition probabilities ( |
max.records |
(Numeric) To prevent RAM / addressable space problems, maximum transitions to process at a time |
verbose |
(Logical) Provide status updates? |
Sparse Matrix (dgCMatrix) of transition probabilities, weighted by pseudotime
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.