{ "metadata": {}, "nbformat": 4, "nbformat_minor": 5, "cells": [ { "id": "metadata", "cell_type": "markdown", "source": "
\n\n# Inferring single cell trajectories with Scanpy (Python)\n\nby [Wendi Bacon](https://training.galaxyproject.org/hall-of-fame/nomadscientist/), [Julia Jakiela](https://training.galaxyproject.org/hall-of-fame/wee-snufkin/), [Mehmet Tekman](https://training.galaxyproject.org/hall-of-fame/mtekman/)\n\nCC-BY licensed content from the [Galaxy Training Network](https://training.galaxyproject.org/)\n\n**Objectives**\n\n- How can I infer lineage relationships between single cells based on their RNA, without a time series?\n\n**Objectives**\n\n- Execute multiple plotting methods designed to maintain lineage relationships between cells\n- Interpret these plots\n\n**Time Estimation: 2H**\n
\n", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-0", "source": "

Run the tutorial!

\n

From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the Scanpy Trajectory inference tutorial.

\n

Install modules & activate them

\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-1", "source": [ "pip install scanpy" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-2", "source": "\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-3", "source": [ "pip install igraph" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-4", "source": "\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-5", "source": [ "pip install louvain" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-6", "source": "\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-7", "source": [ "pip install fa2-modified" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-8", "source": "\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-9", "source": [ "import numpy as np\n", "import pandas as pd\n", "import matplotlib.pyplot as pl\n", "from matplotlib import rcParams\n", "import scanpy as sc" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-10", "source": "

Import dataset

\n

You can now import files from your Galaxy history directly using the following code. This will depend on what number in your history the final annotated object is. If your object is dataset #2 in your history, then you import it as following:

\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-11", "source": [ "thymusobject = get(2)" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-12", "source": "

You now you need to read it in as an h5ad object.

\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-13", "source": [ "adata = sc.read_h5ad(thymusobject)" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-14", "source": "
\n
\n

There shouldn’t be any issues with fetching data from your Galaxy history using get() function. However, if you experience any problems, you can use the code below to download the input data and be able to follow the tutorial.

\n
%%bash\nwget -nv https://zenodo.org/records/13743145/files/Filtered_anndata.h5ad\n
\n
adata = sc.read_h5ad(\"Filtered_anndata.h5ad\")\n
\n
\n

Draw force-directed graph

\n

First, we will calculate a force-directed graph, as an alternate to tSNE, which will likely work better for trajectory analysis.

\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-15", "source": [ "sc.tl.draw_graph(adata)" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-16", "source": "

And now time to plot it!\nNote: We’re saving to png, but you can also choose pdf

\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-17", "source": [ "sc.pl.draw_graph(adata, color='cell_type', legend_loc='on data', save = 'Plot1.png')" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-18", "source": "
\"Plot1-Force-DirectedOpen image in new tab

Figure 1: Plot1-Force-Directed Graph
\n

Well now this is exciting! Our DP-late is more clearly separating, and we might also suppose that DP-M1, DP-M2, and DP-M3 are actually earlier on in the differentiation towards mature T-cells. And we’re only just getting started!

\n

Diffusion maps

\n

We’ll now perform an optional step, that basically takes the place of the PCA. Instead of using PCs, we can use diffusion maps.

\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-19", "source": [ "sc.tl.diffmap(adata)" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-20", "source": "

Now that we have our diffusion map, we need to re-calculate neighbors using the diffusion map instead of the PCs. Then we re-draw and plot a new force directed graph using the new neighbors.

\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-21", "source": [ "sc.pp.neighbors(adata, n_neighbors=15, use_rep='X_diffmap')\n", "sc.tl.draw_graph(adata)\n", "sc.pl.draw_graph(adata, color='cell_type', legend_loc='on data', save = 'Plot2.png')" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-22", "source": "
\"DiffusionOpen image in new tab

Figure 2: Diffusion Map
\n

Oh dear! This doesn’t look great. Maybe the DP-M4 cells are a whole other trajectory? That doesn’t seem right. Saying that, this spreads out our T-mature cells, which makes a lot more sense when it comes to T-cell biology (we expect T-cells to differentiate into two types of T-cells, Cd8+Cd4- and Cd4+Cd8-). If you wanted to, you could also re-cluster your cells (since you’ve changed the neighborhood graph on which the clusterisation depends). You could use this:\nsc.tl.louvain(adata, resolution=0.6)\nHowever, we tried that, and it called far too many clusters given the depth of sequencing in this dataset. Let’s stick with our known cell types and move from there.

\n

Working in a group? Decision-time!

\n

If you are working in a group, you can now divide up a decision here with one control and the rest can vary numbers so that you can compare results throughout the tutorials.

\n\n

PAGA

\n

PAGA is used to generalise relationships between groups, or likely clusters, in this case.

\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-23", "source": [ "sc.tl.paga(adata, groups='cell_type')" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-24", "source": "

Now we want to plot our PAGA, but we might also be interested in colouring our plot by genes as well. In this case, remembering that we are dutifully counting our genes by their EnsemblIDs rather than Symbols (which do not exist for all EnsemblIDs), we have to look up our gene of interest (CD4, CD8a) and plot the corresponding IDs.

\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-25", "source": [ "sc.pl.paga(adata, color=['cell_type', 'ENSMUSG00000023274', 'ENSMUSG00000053977'], title=['Cell type', 'CD4', 'Cd8a'], save = 'Plot4.png')" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-26", "source": "
\"PAGA.Open image in new tab

Figure 3: PAGA
\n

Well now that is interesting! This analysis would find that DP-M1 and DP-M4 are both driving towards differentiation, which is not something we had necessarily been able to specify before by just looking at our cluster graphs or applying our biological knowledge.

\n

Re-draw force-directed graph

\n

Force directed graphs can be initialised randomly, or we can prod it in the right direction. We’ll prod it with our PAGA calculations. Note that you could also try prodding it with tSNE or UMAP. A lot of these tools can be used on top of each other or with each other in different ways, this tutorial is just one example. Similarly, you could be using any obs information for grouping, so could do this for louvain or cell_type for instance.

\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-27", "source": [ "sc.tl.draw_graph(adata, init_pos='paga')\n", "\n", "sc.pl.draw_graph(adata, color=['cell_type'], title=['Cluster'], legend_loc='on data', save = 'Plot5.png')\n", "sc.pl.draw_graph(adata, color=['genotype'], title=['Genotype'], save = 'Plot6.png')\n", "sc.pl.draw_graph(adata, color=['ENSMUSG00000023274', 'ENSMUSG00000053977'], title=['CD4', 'Cd8a'], save = 'Plot7.png')" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-28", "source": "
\"Force-DirectedOpen image in new tab

Figure 4: Force-Directed + PAGA - Cell type
\n
\"Force-DirectedOpen image in new tab

Figure 5: Force-Directed + PAGA - Genotype
\n
\"Force-DirectedOpen image in new tab

Figure 6: Force-Directed + PAGA - Markers
\n\n

Well aren’t those charts interesting! Using the diffusion map to drive the force-directed graph, we see correct ordering of our cells (from DN to DP to T-mature, which was lost with the diffusion map alone) as well as two apparent branches leaving the mature T-cell population, which is what we’d biologically expect. In terms of our experiment, we’re seeing a clear trajectory issue whereby the knockout cells are not found along the trajectory into T-mature (which, well, we kind of already figured out with just the cluster analysis, but we can feel even more confident about our results!) More importantly, we can see the T-mature population dividing itself, which we did not see in the clustering via UMAP/tSNE alone, and we can verify that as the leftmost branch has CD4 but the rightmost branch does not. This is suggesting our branchpoint from to CD4+ and CD8+ single positive cells. Exciting! However, it is important to note, that the branches there are quite small and sparsely populated, which can indicate artifact branches (i.e. trajectory analysis does its best to find branches, particularly diffusion map, so you can pretty easily force branches to appear even if they are not biologically real!). However, to be frank, we were surprised not to find this clearer in the main cluster map, as we know that the T-cells should diverge at that point, so if anything this is a relief that our data is believable!

\n

And now, just for fun, we can compare the scatter graph with our PAGA side by side.

\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-29", "source": [ "sc.pl.paga_compare(\n", " adata, threshold=0.03, title='', right_margin=0.2, size=10, edge_width_scale=0.5,\n", " legend_fontsize=12, fontsize=12, frameon=False, edges=True, save=True)" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-30", "source": "
\"PAGAOpen image in new tab

Figure 7: PAGA Compare
\n\n

Diffusion pseudotime

\n

We know that our cells are initialising at DN. We can feed that information into our algorithms to then calculate a trajectory.

\n

First, let’s name our ‘root’.

\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-31", "source": [ "adata.uns['iroot'] = np.flatnonzero(adata.obs['cell_type'] == 'DN')[0]" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-32", "source": "

Working in a group? Decision-time!

\n

If you called new clusters using the louvain algorithm, you might want to choose one of those clusters to be your root cell instead, so change the cell_type above for louvain and then name the cluster number. Use the plots you created to help you pick the number!

\n

Onto the diffusion pseudotime, where we are infer multiple time points within the same piece of data!

\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-33", "source": [ "sc.tl.dpt(adata)\n", "sc.pl.draw_graph(adata, color=['cell_type', 'dpt_pseudotime'], legend_loc='on data', save = 'Plot8.png')" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-34", "source": "
\"Force-DirectedOpen image in new tab

Figure 8: Force-Directed + Pseudotime
\n

This is nice, as it supports our conclusions thus far on the trajectory of the T-cell differentiation. With single-cell, the more ways you can prove to yourself what you’re seeing is real, the better! If we did not find consistent results, we would need to delve in further to see if the algorithm produced the artefacts (not all algorithms fit all data!) or the biology suprised us.

\n

Where might we go from here? We might consider playing with our louvain resolutions, to get the two branches to be called as different clusters, and then comparing them to each other for gene differences or genotype differences. We might also use different objects (for instance, what if we regressed out cell cycle genes?) and see if that changes the results. Perhaps we would eliminate the DN double-branch input. Or perhaps that’s real, and we should investigate that. What would you do?

\n

Working in a group? The finale!

\n

Look at each others images! How do yours differ, what decisions were made? Previously, when calling clusters in the Filter, Plot, Explore tutorial, the interpretation at the end is largely consistent, no matter what decisions are made throughout (mostly!). Is this the case with your trajectory analyses? You may find that it is not, which is why pseudotime analysis even more crucially depends on your understanding of the underlying biology (we have to choose the root cells, for instance, or recognise that DN cells should not be found in the middle of the DPs) as well as choosing the right analysis. That’s why it is a huge field! With analysing scRNA-seq data, it’s almost like you need to know about 75% of your data and make sure your analysis shows that, for you to then identify the 25% new information.

\n

Export your data, figures, and notebook

\n

It’s now time to export your data! First, we need to get it Jupyter to see it as a file.

\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-35", "source": [ "adata.write('Trajectorythymus.h5ad')" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-36", "source": "

Now you can export it, as well as all your lovely plots! If you go into the figures folder at the left, you’ll see your lovely plots and can choose which ones to export. The following code will push them into your galaxy history. You can also directly download them onto your computer from the file window at the left.

\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-37", "source": [ "put(\"Trajectorythymus.h5ad\")" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-38", "source": "\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-39", "source": [ "put(\"figures/draw_graph_faPlot1.png\")\n", "put(\"figures/draw_graph_faPlot2.png\")\n", "put(\"figures/draw_graph_faPlot5.png\")\n", "put(\"figures/draw_graph_faPlot6.png\")\n", "put(\"figures/draw_graph_faPlot7.png\")\n", "put(\"figures/draw_graph_faPlot8.png\")\n", "put(\"figures/paga_compare.pdf\")\n", "put(\"figures/pagaPlot4.png\")" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-40", "source": "

The cell below will only work if you haven’t changed the name of the notebook. If you renamed it, simply type its new name in the parenthesis.

\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "id": "cell-41", "source": [ "put(\"single-cell-scrna-case_JUPYTER-trajectories.ipynb\")" ], "cell_type": "code", "execution_count": null, "outputs": [], "metadata": { "attributes": { "classes": [ "From now on, you can view this tutorial in the Jupyter notebook, which will allow you to read the material and simultaneously execute the code cells! You may have to change certain numbers in the code blocks, so do read carefully. The tutorial is adapted from the [Scanpy Trajectory inference tutorial](https://scanpy.readthedocs.io/en/stable/tutorials/trajectories/paga-paul15.html)." ], "id": "" } } }, { "id": "cell-42", "source": "

This may take a moment, so go check your Galaxy history to make sure your images, anndata object, and notebook (.ipynb) have all made it back into your Galaxy history. Once they are all there, you can exit this browser and return to the Galaxy tutorial!

\n

If things have gone wrong, you can also download this answer key tutorial.

\n

Citation

\n

Please note, this is largely based on the trajectories tutorial found on the Scanpy site itself https://scanpy-tutorials.readthedocs.io/en/latest/paga-paul15.html.

\n

After Jupyter

\n

Congratulations! You’ve made it through Jupyter!

\n
\n
Hands On: Closing JupyterLab
\n
    \n
  1. Click User: Active Interactive Tools
  2. \n
  3. Tick the box of your Jupyter Interactive Tool, and click Stop
  4. \n
\n
\n

If you want to run this notebook again, or share it with others, it now exists in your history. You can use this ‘finished’ version just the same way as you downloaded the directions file and uploaded it into the Jupyter environment.

\n

Conclusion

\n

Congratulations! You’ve made it to the end! You might be interested in the Answer Key History or the Answer Key Jupyter Notebook. If, for some reason anything didn’t work in Galaxy JupyterLab environment, please don’t get discouraged - we prepared a Google Colab notebook version for you as a backup so that you can enjoy the tutorial no matter what!

\n

In this tutorial, you moved from called clusters to inferred relationships and trajectories using pseudotime analysis. You found an alternative to PCA (diffusion map), an alternative to tSNE (force-directed graph), a means of identifying cluster relationships (PAGA), and a metric for pseudotime (diffusion pseudotime) to identify early and late cells. If you were working in a group, you found that such analysis is slightly more sensitive to your decisions than the simpler filtering/plotting/clustering is. We are inferring and assuming relationships and time, so that makes sense!

\n

To discuss with like-minded scientists, join our Gitter channel for all things Galaxy-single cell!

\n", "cell_type": "markdown", "metadata": { "editable": false, "collapsed": false } }, { "cell_type": "markdown", "id": "final-ending-cell", "metadata": { "editable": false, "collapsed": false }, "source": [ "# Key Points\n\n", "- Trajectory analysis is less robust than pure plotting methods, as such 'inferred relationships' are a bigger mathematical leap\n", "- As always with single-cell analysis, you must know enough biology to deduce if your analysis is reasonable, before exploring or deducing novel insight\n", "\n# Congratulations on successfully completing this tutorial!\n\n", "Please [fill out the feedback on the GTN website](https://training.galaxyproject.org/training-material/topics/single-cell/tutorials/scrna-case_JUPYTER-trajectories/tutorial.html#feedback) and check there for further resources!\n" ] } ] }