kstreet13 / slingshot

Functions for identifying and characterizing continuous developmental trajectories in single-cell data.
265 stars 43 forks source link

Pulling and plotting Differential pseudotime data across different conditions/metadata slots #237

Open Yanst86 opened 10 months ago

Yanst86 commented 10 months ago

Hi Kelly,

First of all, thank you for producing and maintaining this package, it is great and gave me very interesting insights about my data. I recently came across this vignette about differential expression and progression and it is very useful for me. Perhaps it's a very basic detail that I missed, but how do you produce the plot that compares between different conditions (e.g. the curves comparing mock to TGF-beta under 'Differential progression' section, I don't see the code producing this plot)? More generally, how do you pull pseudotime data from different conditions/metadata slots?

Many thanks, Yan

kstreet13 commented 10 months ago

Hi Yan,

Thank you for the kind words. For the specific plot you mentioned, we just used the density() function to get the curves and then dressed it up a bit to look nicer. The code is available on the GitHub repository and that plot can be found here.

Pulling pseudotime values from different conditions is relatively easy, if you performed trajectory inference on the full dataset. You can subset the entire object or, as we do in the vignette, pull out the matrix of pseudotime values and subset that based on condition.

Hope this helps! Kelly