dynwrap always represents trajectories in the same way, as illustrated here with a tree trajectory
## # A tibble: 5 × 4
## from to length directed
## <chr> <chr> <dbl> <lgl>
## 1 Milestone_A Milestone_B 1 FALSE
## 2 Milestone_B Milestone_C 2 FALSE
## 3 Milestone_B Milestone_D 1 FALSE
## 4 Milestone_C Milestone_E 1 FALSE
## 5 Milestone_C Milestone_F 1.5 FALSE
## # A tibble: 10 × 3
## cell_id milestone_id percentage
## <chr> <chr> <dbl>
## 1 Cell_a Milestone_C 0.393
## 2 Cell_a Milestone_F 0.607
## 3 Cell_b Milestone_B 0.492
## 4 Cell_b Milestone_C 0.508
## 5 Cell_c Milestone_C 0.653
## 6 Cell_c Milestone_E 0.347
## 7 Cell_d Milestone_A 0.686
## 8 Cell_d Milestone_B 0.314
## 9 Cell_e Milestone_C 0.210
## 10 Cell_e Milestone_F 0.790
## # A tibble: 10 × 4
## cell_id from to percentage
## <chr> <chr> <chr> <dbl>
## 1 Cell_a Milestone_C Milestone_F 0.607
## 2 Cell_b Milestone_B Milestone_C 0.508
## 3 Cell_c Milestone_C Milestone_E 0.347
## 4 Cell_d Milestone_A Milestone_B 0.314
## 5 Cell_e Milestone_C Milestone_F 0.790
## 6 Cell_f Milestone_B Milestone_C 0.729
## 7 Cell_g Milestone_C Milestone_F 0.837
## 8 Cell_h Milestone_B Milestone_C 0.0851
## 9 Cell_i Milestone_B Milestone_C 0.462
## 10 Cell_j Milestone_B Milestone_C 0.0415
## # A tibble: 3 × 3
## divergence_id milestone_id is_start
## <chr> <chr> <lgl>
## 1 Divergence_1 Milestone_B TRUE
## 2 Divergence_1 Milestone_C FALSE
## 3 Divergence_1 Milestone_D FALSE
These three objects (with either milestone percentages or progressions) are enough to form a trajectory using add_trajectory
.
<- wrap_data(cell_ids = cell_ids) %>%
trajectory add_trajectory(
milestone_network = milestone_network,
milestone_percentages = milestone_percentages,
divergence_regions = divergence_regions
)
Often, you don’t want to directly output the milestone network and percentages, but want to output an alternative representation that is converted by dynwrap to the common representation:
Check out the reference documentation for an overview and examples of the different wrappers