Root the trajectory

Roots the trajectory by changing the directionality of all edges given a root cell

add_root(trajectory, root_cell_id = trajectory$root_cell_id,
  root_milestone_id = trajectory$root_milestone_id, flip_edges = TRUE)

add_root_using_expression(trajectory, features_oi,
  expression_source = "expression")

is_rooted(trajectory)

Arguments

trajectory

The trajectory as created by infer_trajectory() or add_trajectory()

root_cell_id

The root cell id, not required if root_milestone_id is given

root_milestone_id

The root milestone id, not required if root_cell_id is given

flip_edges

Whether to flip edges which are going in the other direction compared to the root

features_oi

The feature ids which will be used to root

expression_source

Source of the expression, either a string or a matrix