View source: R/wrap_add_cluster_graph.R
add_cluster_graph | R Documentation |
A trajectory in this form will rarely be useful, given that cells are only placed at the milestones themselves, but not on the edges between milestones. A better alternative might be to project the cells using a dimensionality reduction, see add_dimred_projection()
.
add_cluster_graph(
dataset,
milestone_network,
grouping = NULL,
explicit_splits = FALSE,
...
)
dataset |
A dataset created by |
milestone_network |
A network of milestones. |
grouping |
A grouping of the cells, can be a named vector or a dataframe with group_id and cell_id |
explicit_splits |
Whether to make splits specific by adding a starting node. For example: A->B, A->C becomes A->X, X->B, X->C |
... |
extra information to be stored in the wrapper. |
A trajectory object
library(tibble)
dataset <- wrap_data(cell_ids = letters)
milestone_network <- tibble::tibble(
from = c("A", "B", "B"),
to = c("B", "C", "D"),
directed = TRUE,
length = 1
)
milestone_network
grouping <- sample(c("A", "B", "C", "D"), length(dataset$cell_ids), replace = TRUE)
grouping
trajectory <- add_cluster_graph(dataset, milestone_network, grouping)
# 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.