18.4 Slingshot Trajectories
The same general workflow also works for trajectories determined by Slingshot. The only difference is that the workflow for Slingshot is more similar to the workflow for ArchR trajectories. Slingshot only utilizes the addSlingShotTrajectories()
function and in doing so directly adds this trajectory to cellColData
.
Given how Slingshot works in ArchR, we will add a separate trajectory for each branch. Since this is primarily for illustrative purposes, we will only calculate the lymphoid trajectory here.
<- addSlingShotTrajectories(
projHeme5 ArchRProj = projHeme5,
name = "Slingshot_Lymphoid",
useGroups = c("Progenitor","CLP","PreB","B"),
principalGroup = "Progenitor",
groupBy = "Clusters2",
embedding = "UMAP",
seed = 1,
force = TRUE
)
This trajectory gets stored into cellColData
in a column called “Slingshot_Lymphoid.Curve1”.
Now, we can use plotTrajectory()
to show the trajectory on our embedding.
<- plotTrajectory(projHeme5, trajectory = "Slingshot_Lymphoid.Curve1", colorBy = "cellColData", name = "Slingshot_Lymphoid.Curve1", addArrow = FALSE)
p_slingshot ## ArchR logging to : ArchRLogs/ArchR-plotTrajectory-371b0516b9f84-Date-2022-12-23_Time-09-09-29.log
## If there is an issue, please report to github with logFile!
## Plotting
## Plotting Trajectory
## ArchR logging successful to : ArchRLogs/ArchR-plotTrajectory-371b0516b9f84-Date-2022-12-23_Time-09-09-29.log
1]]
p_slingshot[[## Warning: Removed 7681 rows containing non-finite values (stat_summary_hex).