View source: R/wrap_add_end_state_probabilities.R
add_end_state_probabilities | R Documentation |
Constructs a multifurcating trajectory using the pseudotime values of each cell and their end state probabilities. If pseudotime values are not given, will use pseudotime already present in the dataset.
add_end_state_probabilities(
dataset,
end_state_probabilities,
pseudotime = NULL,
do_scale_minmax = TRUE,
...
)
dataset |
A dataset created by |
end_state_probabilities |
A dataframe containing the cell_id and additional numeric columns containing the probability for every end milestone. If the tibble contains only a cell_id column, the data will be processed using |
pseudotime |
A named vector of pseudo times. |
do_scale_minmax |
Whether or not to scale the pseudotime between 0 and 1. Otherwise, will assume the values are already within that range. |
... |
Extras to be added to the trajectory |
A trajectory object
dataset <- wrap_data(cell_ids = letters)
pseudotime <- runif(length(dataset$cell_ids))
names(pseudotime) <- dataset$cell_ids
pseudotime
end_state_probabilities <- tibble::tibble(
cell_id = dataset$cell_ids,
A = runif(length(dataset$cell_ids)),
B = 1-A
)
end_state_probabilities
trajectory <- add_end_state_probabilities(dataset, end_state_probabilities, pseudotime)
# for plotting the result, install dynplot
#- dynplot::plot_graph(trajectory)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.