Closed connerlambden closed 1 year ago
Hi @connerlambden ,
I think this is the best strategy (running Slingshot in PC space and only using UMAP for visualization), but unfortunately since UMAP is non-linear, it doesn't always produce congruent results.
One thing you could try is to re-run UMAP with slightly different parameters (or even just a different random seed) and see if it improves. Otherwise, I would just color the points on the UMAP plot by pseudotime and either forgo the lines or draw them by hand/in PowerPoint (I've seen a lot of published papers do something like this). This isn't the most satisfying solution, but it is only for visualization, and the actual pseudotime values will be derived from the PCs, anyway.
Best, Kelly
Thanks for the help. I'm trying the following:
umap_curve_embedding <- embedCurves(sce, newDimRed=reducedDims(sce)$UMAP) lines(SlingshotDataSet(umap_curve_embedding)@curves[[1]]$s, lwd = 2, col = 'red')
Results look super weird. Any ideas? Also, how do I do this on a per-lineage basis?
Haha, I often get this type of plot myself. The issue is that the s
matrix is not re-ordered, so the cells in that matrix match up with the cells in your original data. If you want to put them in order of pseudotime, there is a corresponding index you can use (SlingshotDataSet(umap_curve_embedding)@curves[[1]]$ord
), but we wrote a lines
function for SlingshotDataSet
objects that should know how to handle this properly. If lines(SlingshotDataSet(umap_curve_embedding), lwd = 2, col = 'red')
doesn't work, let me know! And you can give a vector of different colors if you don't want all lineages to be the same color.
Thanks that worked!
Hi, I want to use PC space for calculating trajectories and UMAP to visualize them. However, when I visualize using UMAP, lines are being drawn where there are no cells. How should I reconcile using slingshot in these 2 different spaces? Thanks for the help.