Closed Tommy0398 closed 1 year ago
Hi @Tommy0398,
Between the code and the plots there's kind of a lot going on here, so I might not be able to clear everything up. But it sounds like what you want to do should be entirely possible.
First, there's a lot of code here that doesn't seem necessary. For instance, in both cases you create a subsetted Seurat object called Optimal
, but then never use it. I don't think you need this, since it is quite easy to subset SingleCellExperiment objects. Similarly, you don't need to manually add the UMAP coordinates, as these are carried over by the as.SingleCellExperiment
conversion function (you can check this with reducedDimNames(sce)
). In the first case, you also use an object called seu_trajectory
that is not referenced anywhere else.
Here's the basic pipeline I think you should be using:
as.SingleCellExperiment
slingshot
with specified dimensionality reduction and clustering (both of which will already be part of the SCE)I should also mention that your plots show some of the classic pathologies of Louvain clustering that can cause problems for trajectory inference. Namely, there are some clusters that are clearly represented in different places around the plot, making for a cluster center that doesn't make sense (the light blue cluster in the bottom middle is an example of this).
I would also recommend waiting to run fitGAM
until you have a trajectory you are happy with and ready to move on to temporal expression analysis. Because you're right, it does take a long to run and unfortunately, I don't have any helpful tricks to make it faster.
I hope this helps! Kelly
Hi Kelly,
Thank you for the fast reply, and sorry for the confusion, I missed out a line in both the code blocks where I renamed the Optimal object back to a standard name for simplicity to the code I already had. Seu_combined_sct <- Optimal
and seu_trajectory <- Optimal
. Sorry for asking a question with incomplete code, I've edited the original post to correct that, but the overall method is the same.
Thank you for the information on the singlecellexperiment object, I'm not overly familiar with it yet so its very helpful.
Regarding the clustering issues, I had observed some of the clusters being in multiple places across the trajectory, which I assume is what may cause the trajectory lines to move in unexpected directions. Would you suggest that I use an alternative clustering method for this data? I've tried all the ones supported natively be Seurat, do you have an alternative method you prefer?
I'm still not sure why using a singlecellexperiment object gives different results to just using the dimentional reduction and clustering information, I would have thought the trajectories in the plots would be identical. If I follow the pipeline after converting to a singlecellobject the trajectories are confusing (the second set of plots).
Thanks, Tommy
Hi @Tommy0398,
Best, Kelly
Hi Slingshot-team,
I was hoping you could help me understand a problem I'm having with creating trajectories using a singlecellexperiment object. I was adapting the method used in https://hectorrdb.github.io/condimentsPaper//articles/TGFB.html as its a bit easier to use than the official method (https://bioconductor.org/packages/devel/bioc/vignettes/slingshot/inst/doc/vignette.html#using-slingshot)
When I convert the trajectories from Seurat objects to SingleCellExpreiment (sce) objects and run the pipeline, the trajectories double back onto a single point, whereas if I just run slingshot using the dimensional-reduction and clustering information they don't do this. I'd prefer to use the sce object as alot of the tutorials use this and it'd make it alot easier to do plots but the trajectories don't look right in the SCE object, and I'm not sure if I'm doing this correctly.
Method 1 - Just using UMAP and clustering info
OR Method 2 - Converting the Seurat object to single cell object and then using that
They all pull into the bottom left point and I'm not sure why
So, can I avoid this happening in the sce object? And is subsetting the seurat object even a valid thing to do. I wanted to explore the results and try other methods but the time it takes to fitGAM is quite restrictive. I do also still observe the points pulling back on themselves in the non-subsetted object, although it is a bit less extreme.