Hey guys, in this video I'm going to do another single-cell RNA-seq tutorial similar to my last
video. In my last video, I went over how to do cell type labeling and I'm going to include that
as part of this video but this video is going to be on how to do integrated analysis in Seurat. In
my particular example, I'm going to integrate across two species and basically I'm going to
do this whole analysis and go over the R code step by step. This is going to be an R tutorial
video but I think I'm going to do it a little bit differently than I did my last video since the
code is a little long. I've already published it to R Pubs, so it's already publicly available and
I think what I'll do is I'll just go over--and the video will be going over the R Pubs documentation,
since it already has all the graphs and everything printed out. In this particular video,
I'm going to go over how to do something called integrated analysis, or anchoring,
in Seurat and basically what that is is if you have single-cell RNA-seq data for multiple
conditions, or multiple time points, or multiple species, for example, and you want to compare or
integrate across different Seurat objects you can do that using what's called anchoring in
Seurat 3.0. For this particular dataset, I'm comparing across two species, human and mouse,
and basically I have single-cell RNA-seq data for the human, mouse separately and then in Seurat I
can do a combined analysis. I can produce a combined tSNE plot like this that integrates
the two species. And you can see the similarities and differences. And then you can also do cluster
labeling. And at the bottom, you can also produce what are called frequency tables to show you the
frequencies of the different cell types across species or across conditions. And this analysis
is using again a publicly available dataset. It's similar to the one I did in the previous video.
I'm using publicly available data from the Allen Institute again and this time I'm using the human
and mouse data and this is single-cell RNA-seq data from the lateral geniculate nucleus and the
equivalent dorsal lateral geniculate complex in the mouse. Let's go ahead and get started with the
video. I'm basically just going to be explaining what all this code does and also I will put a lot
of links to everything in the description box below. There's a paper on how Seurat integrates
objects and I'll put a link to that. I'll put a link to the publicly available data set and I'll
put a link to the R code. Let's go ahead and get started with the tutorial. The first thing I do
is basically analyze each individual species. The first part, I do pre-processing and importing of
data for the human single-cell RNA-seq data and I basically just do normal analysis as if it's
one species that I'm comparing and I create a tSNE plot for just the human. And I do even cell type
labeling like I showed how to do in the last video for just the human. And I do the same thing for
the mouse. I do that here. Everything above this line is for the human and everything below this
line is for the mouse. And the only thing that's different, or the only thing that I'm going to add
as well for each individual subject is I'm going to add metadata here and I'm going to add metadata
for each Seurat object that I create about the species. I have--I'm creating two Seurat objects,
one for the human and then one for the mouse, and I'm adding metadata to each Seurat object
of what species it is, here. For this part, I do an @ meta dot data. There might be another way of
doing this in Seurat 3.0 but this does work in Seurat 3.0, adding the metadata this way. And I
just call--instead of calling it species, I call it protocol. I say, this Seurat object
protocol is equal to human and then I do the same thing for mouse, except I call it mouse, and I do
that here. At this line here, above integration section, I will have created two Seurat objects,
one called pbmc underscore mouse and another one called pbmc underscore--I think was human. And so
I'll have two Seurat objects that are basically individually analyzed and in the next step I
want to do the integration. For integration, I'm going to create a combined object and use
the function called merge and then I'm going to merge my two Seurat objects and I'm going to call
the first object mouse and the second object human and this is being separated by the group
or category protocol, or species. For this next part, I'm doing a split object and splitting it
by protocol and the split is going to split into human and mouse. This code here is basically just
creating an integrated object and then saying, if I want to split this integrated object, I
want to split it by the two species that I created from each individual analysis. And then I'm going
to do the anchoring step. The anchoring step is the integration--the actual integration step in
Seurat 3.0. The previous versions of Seurat did integrated analysis using canonical correlation
analysis but actually I've tried the old version and it doesn't work very well, so I do recommend
using the 3.0 version, which is anchoring, which works a lot better. And this is basically saying
to find what are called anchoring points between the two species as listed in the reference list.
We're passing through the two subjects or the two species and we're finding anchoring points using
the first 30 dimensions given here. That runs and basically it finds integrated points or anchors
and then it does filtering and in the end we have 1,909 anchors across the two species. And then,
basically, this next line of code will analyze the integrated object. What we're doing is scaling the
data, running PCA, running a tSNE plot, and then plotting the tSNE plot. And this group by command
is saying to split or show the differences in the groups based on protocol, which again, we're
labeling as human and mouse. When you actually plot this, it shows a tSNE plot that is separated
by human in red and mouse in blue. This p1 code is one way of plotting the integrated object, which
is separated by species or by protocol but after you run this analysis you can also run this code,
which is p2, and this plot will show you the integrated object but now it's being separated
by clusters. Seurat found clusters and now it's labeling and separating the dots according to
clusters. And then this next code shows the two tSNE plots plotted side-by-side and this
one again is separated by species and then this one separated by Seurat clusters. And then in
the next part of the code that I show here, I just show some examples and I showed this
in the previous video of how you can do cluster cell type labeling. I'm just using some genetic
markers to determine for the integrated object what I want these cell IDs to be. And so I do
that using feature plots, mainly, in this next part of the code. And then in this next section,
I assign these cell IDs that I want for my different clusters and basically I'm IDing four
different types of cell types for the integrated cluster. And basically it's showing here that I
found four different cell types across the integrated object and that I'm using this
to label them in the tSNE plots. And so for this next part of the code, I'm plotting the combined
integrated object that's been separated by Seurat clusters that have been ID'd. And this next part
of the code is just showing the two tSNE plots. One is separated by species type and the next is
separated by cell ID type. And for this final part of the code, you can create a proportion table or
a frequency table to compare differential gene expressions across species, for example. If you
want to know what percentage of a certain cell type, so let's say glutamatergic neuron. If you
want to know if that's predominantly the main cell ID type in humans or in mice or if you want to
compare across cell types, you can do that using this code and that will plot these two proportions
across each other. This is the four proportions of cell ID types for the human and the four for the
mouse. The mouse only has three cell ID of types found. And then if you run freqtable, it will
give you the actual proportion breakdown for human across all the cell ID types and for mouse for all
cell ID types. You can see for this part of the brain the glutamatergic neuron proportions seem to
be similar and overall there doesn't seem to be a huge difference in cell ID types for this part of
the brain for the human and the mouse. And another thing I forgot to mention in the beginning of
this video is the reason I can do this integrated analysis across species, which have different gene
ID names, is because I've filtered the data prior to running this analysis. Actually I filtered the
data on homologous genes, so I'm not doing a full analysis on the original matrices across
the two because the mouse has some genes that the human doesn't have and the human has some genes
that the mouse doesn't have. In order to compare across species, what I did was I just filtered for
homologous genes. In other words, I filtered for genes that are present in both human and
mouse or are thought to be, you know, equivalent across species. And I did this filtering prior
to the video so my dot CVS files are filtered data. But that's something you would only have
to do if you were comparing across species and I'm not entirely sure how it would affect your
data if you didn't filter. And anyway, that's it for this video and thank you guys for watching.
*chiptune music*