Description Usage Arguments Value Examples
This automates the process of performing random walks for many tips. See
simulateRandomWalk
for more information. The output of this
function can be passed to processRandomWalksFromTips
directly
to convert these walk data into visitation frequencies.
1 2 3 4 5 6 7 8 9 10 | simulateRandomWalksFromTips(
object,
tip.group.id,
root.cells,
transition.matrix,
n.per.tip = 10000,
root.visits = 1,
max.steps = ncol(object@logupx.data),
verbose = T
)
|
object |
An URD object |
tip.group.id |
(Character) The name of the clustering that defines tips |
root.cells |
(Character vector) Names of cells that constitute the root |
transition.matrix |
(Matrix or dgCMatrix) Biased transition matrix |
n.per.tip |
(Numeric) Number of walks to do per tip |
root.visits |
(Numeric) Number of steps to take that visit a root.cell before stopping |
verbose |
(Logical) Whether to report on progress |
max.visits |
(Numeric) Abandon walks that take more steps than this, as it likely means that it has gotten stuck. (Default is number of cells in the data. On large data, may want to lower this value.) |
List (of tips) of lists (of walk paths) of character vectors
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.