Scientist Stories: Peter Karchenko, Using Statistics To Understand How Cells Work

Peter Karchenko explains how clustering algorithms help scientists make sense of single-cell RNA data. He walks through different distance metrics, why algorithm choice matters enormously, and a key problem: the same data can yield multiple biologically meaningful clusterings depending on what you're looking for.
Chapters
So, I was asked to talk about clustering and its states and what the challenges are. And obviously, given how exciting the topic of clustering is, we decided to tack on visualization just to make it a little bit more pleasing. So, I'll start with this beautiful illustration from Gary Nolan's lab of mouse hematopoiesis, and it's just I think, to me anyway, very pleasant to stare at. And it's important, you know, to basically illustrate heterogeneity effectively, and clustering sort of comes into this. So the clustering, the main aim is very simple. I'm stating the obvious, to group similar cells. But, you know, how do we use it? What purpose essentially it serves? Well, one purpose is basically illustrating heterogeneity. So some of this has to do with visualization. So here we already have this. Forced layout graph embedding of different cells. But some of the visualization methods will actually try to emphasize the clusters and will be built around maintaining cells within different clusters within certain positions in the visualization space. So you can make for more effective visualization. Clusters are very useful for navigating things. If I wanted to point at a certain place here, I could tell you that it's a cluster, you know, pink cluster or cluster number something. So, in terms of actually navigating the space and communicating, you know, what cells we're talking about, it's a very useful unit. I think the critical part, though, is assigning interpretation, at least at the current state. The— you know, here you see all these subpopulations, all these clusters labeled, and typically when people go through these single-cell datasets, the labeling is done in terms of clusters, even if they represent sort of, in this case, parts of continuous trajectory. So this is actually a site of data. For the purposes of this talk, I'll focus on RNA-seq, on single-cell RNA-seq, because I think at least the initial iteration will have a lot of that data. So the next thing that clusters are used for then are more technical purposes. Once we have the cluster formulated, we can use, for instance, the membership association of these cells to estimate some kind of a pooled signal. And that gives us a more precise expression profile, let's say, or site of profile of that subpopulation, better defined. You could use it also for this kind of clustering for further downstream analysis like differential expression, for instance, or for selecting markers for isolating these types of cells and so on. So these kind of purposes are important to keep in mind when we're going through different clustering methods. And it doesn't work. Okay. So there are quite a few clustering methods. If you've seen— you've just seen the talk about different trajectory construction methods, and these are much more exotic. So as you might imagine, there are 10 times more clustering methods. So I won't be able to go through all of them. I'll try to emphasize, I think, what are key distinctions between some of the classes of these approaches. Now, the important thing here is that the results of these different clustering methods will vary. Not only depending on the methods, but often depending on the parameters you set to a method. It doesn't mean that, you know, all of them are wrong. For instance, there's some similarity between the answers. In some cases, similarity is very strong and obvious. In other cases, the similarity can be less apparent. There is actually— so Martin Hemberg actually made an sc3 package that tries to build consensus clustering out of multiple methods. So how to reconcile them?, and how to choose the appropriate clustering method has been a bit of an art. The important thing is that if the data is good, regardless of the clustering method you choose, usually there's a set of stable features or groups that show up. All right, so first, very simple things. I kind of grouped them under direct clustering methods. So say hierarchical clustering in this case. There are many hierarchical clustering methods. Essentially, here, this is work from Jay West's group. So we have the expression profiles of different genes. Genes are columns, cells are rows. And so there's some kind of a distance metric defined, in this case, correlation metric on the genes, and we simply use the traditional hierarchical clustering methods to arrange the cells. And then you can cut the hierarchy at certain levels to actually determine the clusters. So simple approach, and visualization here sort of emphasizes I think more expression patterns than cells, but the cells are grouped in these clusters in a linear manner. All right, so there are a second set of classes of sort of k-means or similar to k-means, very standard computer science algorithms for clustering things. So this is an example from Alexander Avonardin's lab where they used k-means clustering on a Euclidean distance on correlation measure. I'm repeating these distance measures because I'll come back to them. So that allows you to basically come up with a discrete set of clusters. It's a partitioning method that essentially tries to, given the number of clusters, tries to ideally separate the cells within the space. PAM is a similar method where you could essentially give it an arbitrary distance measure. It's worth mentioning some of the more specialized algorithms, so Backspin from Stan Linderson's lab. So here shown in an example of a recent publication. So this is a bi-clustering method. Essentially, we're trying to separate the cells, which are columns in this case, as well as the genes that define different— distinguish different cell populations of cells. It's a recursive divisive method. So it tries to basically go and optimize— tries to partition the cells to optimize the correlation measure within the partition., and it can go in and divide, you know, multiple times a given subpopulation to generate these very, very detailed cluster profiles. The separate approach is density clustering. So that typically— I mean, the idea is very simple. You essentially try to look for a position in space, some kind of a space, where there's more cells than you would sort of expect, find peaks of this density, and call that a cluster. Typically, it's done in low-dimensional space. So in this case, from Aviv Regev's lab, so this is an initial illustration— sorry, application of SIRA. So in this case, we're dealing with t-SNE projection. You could project it to some other low-dimensional space. In principle, you could estimate density in high-dimensional space as well, though I haven't seen implementations like that. Finally, there's a— as Dana has mentioned, there's a very enthusiastic community based around graph-based clustering. So in this case, we represent cell similarity. We put it on a graph. This is work from Stan Lindstrom's lab from 2011, and they're looking at the ES and EF cells, and then it's a k-nearest neighbor graph, in this case, we connect each cell with 5 closest neighbors based on the overall correlation profile of the expression. And so what we find is that the MEF cells, fibroblasts, they actually connect to each other, and then the ES cells connect to each other, and so you have this very clear partitioning in this case. Now, that's sort of an ideal case, right? So you might actually have some connections between ES and MEF once in a while, depending on the noise,. But you should probably be able to distinguish these kind of communities that connect to each other, but much less so between each other. So in the graph theory in computer science, this is a community detection problem, again, a very well-studied problem with numerous algorithms to actually resolve it. A lot of them are based on optimization modularity, so again, connections within, between different groups. Edge betweenness is another approach evaluating sort of the cost of different edges. You could actually represent the graph again as a connectivity matrix and do some principal component analysis on that Laplacian matrix, and that will yield you major directions in which the subpopulations can be separated. In this case, it would be, again, between ESMEF cells. InfoMap is another popular method that's been used by a number of groups. It's also worth mentioning the specialized more sort of specialized applications to RNA-seq, Phenograph from Dana Peirce's lab, and the newer version of SARA is using smart local moving, I think is the method called, but again, working on k-nearest neighbor graphs. Okay, now drilling into this a little bit more, so all these methods, as I mentioned, they're based on some kind of a cell distance, and that's really the critical underlying metric here. So, in this case, we connect the cells if their, let's say, correlation distance is close enough. And so, depending on how you choose these distances, you can emphasize different features within the, let's say, gene expression space. So, I just wanted to go through some of these to emphasize how different they are. You can use Euclidean distances, Euclidean distance on correlation distances, L1 distance, which is simple, you know, total sum of the differences. Correlation, you've seen quite clearly. Jensen-Shannon, which is more a difference between the distributions that you measure of log counts. Now, these typically work— a lot of them work on transformed expression values as well. So if you're looking at correlation, for instance, or Euclidean distance, you'd probably transform the expression values somehow, either log transformation or somehow otherwise to normalize the variance a little bit. Quite often these are done on reduced dimensions. So first you calculate, let's say, you know, 10 principal components, and then you use Euclidean distance to actually estimate within these components to estimate the distance between cells. Some of the more advanced methods can sort of modify these distances by further looking at these graphs and look at the topological distances within the graphs. There are newer approaches that look at multiple scales, so essentially multiple, let's say, Gaussian kernels in this case, to evaluate the similarity across, let's say, different scales within the dataset and then try to somehow combine it to optimize the cluster definitions. It's worth noting that some of these distances can be modified, let's say, by weighting certain errors or measurements that you expect to be errors. The other feature that's very prominent to these applications is that gene sets are often restricted, you know, whether you call it feature selection or focusing on a particular aspect of the transcriptome, it's often the case. Okay, so there are also a set of model-based distances, so here from Iramine's lab, so let's say based on the Poisson measurement, and I'll talk about this a little bit. So the key thing here is, you know, given this list of distances and options, it's actually, I think, unclear what the, you know, which one of them gets closer to biological significance and which part of biology might emphasize. So first challenge is basically how to actually interpret these distances. One option is to say that the distance is a sort of deviation from equality. So are these two cells the same or not, right? If they're not the same, they're further apart. Now you can think of it as a statistical test, let's say, based on the Poisson distribution or something like that. Well, there are a couple of issues with this. So that statistical power will vary with the coverage of a cell, essentially. No matter how you cut it. So cells that are very well measured will appear to be more significantly further apart than the ones that are poorly measured. Also, these models, we have to think about what are they trying to capture. Are they trying to capture the error of the measurement itself? Our model, let's say, Poisson sampling of the molecules, or are they trying to capture the variability that we expect from the biology? So let's say a Poisson measurement for a highly expressed gene, a Poisson model, if the gene varies by just 1/3, for instance, or even 10% of its expression level, it will be a hugely significant signal just because we have many of these molecules. But in terms of biology, it might actually not matter that much. So, the other option is to look— think of it as a sort of amount of transcriptional change that the cell needs to go through to get from one point to another in this space, kind of like L1 distance, for instance. But obviously, again, not all genes are equal. A change in the transcription factor can be very small in terms of numbers of molecules compared to an effector gene, and yet the biological outcome is quite different. It's also important to think— be aware, at least, of the potential dangers of low-dimensional representations. If we're doing— if not careful about doing, let's say, principal components, one of the components could represent essentially a single gene or, you know, a single highly expressed gene, and then the clustering would be very stable, but probably not reflected of the old complexity of the populations. Finally, you could think of it as a likelihood of transcriptional change, you know, going from one place to another, and that sort of would incorporate more of our understanding of biological variation, how likely a cell will end up in one place or another. All right, so the other question is, is it a real cluster? So how far should we be separating the cells into different clusters? Should we separate this one, for instance,. And that sort of has to do with granularity of the clustering. Hierarchical clustering tends to be a little more stable because you could see the relationship between what the cluster that was just split or not split in the other analysis. The question is how to basically evaluate this type of stability. You could think about likelihood of basically observing that cluster in a theoretical— on an actual repeat experiment. You could look at the stability of that cluster across replicates. You could actually try to evaluate this computationally. That's what some of the methods like Seurat does with, let's say, cell subsampling, or introduce your models of measurement noise and see if the cluster is actually stable under that measurement noise. Finally, there's also— you could think of a robustness of the gene expression signature. If it happens that the cluster is essentially driven by a single gene, perhaps that's not the kind of feature that you want. Finally, the actual thing we'd like to know is if there's a phenotype associated with that cluster. Probably a much better definition, but again, very hard to assess given the mapping. The other thing I wanted to emphasize is that the cluster definition, especially the partition-based clusters, give you some kind of a hierarchy or some kind of configuration with partitioning of the cells. And they may not be unique. So a quick example here from— so columns of cells here. And these are neurons that are maturing. This main feature separating cells shows increasing maturation. And just look at the last line. So this feature marks these DLX genes, essentially showing interneurons. So if you run clustering, any clustering on this, you will see neuronal maturation, which is a true biological feature. But you could alternatively classify them as interneurons versus excitatory neurons. That's a perfectly valid classification. So how does that work in principle? As we have more and more cells, the clustering typically would segment by some subset of properties that it is able to learn from RNA-seq. And in the limit, if we get more and more cells, it would be sort of a combination of all properties. But perhaps, you know, not all of these properties you actually want to see. More importantly, you'd like to have a visualization technique that shows you alternative ways of essentially classifying the cells. And just a very quick example here with cell cycle, you know, we have some kind of a population. We define the clusters. And if you look at the cell cycle signature, you see that basically that separation is a cell cycle separation. And actually, this separation is also cell cycle separation. So we would like to have a visualization technique that actually allows you to capture the fact that these two groups are tied by a similar process, in this case, a state change of a cell. And then, of course, yes, cell type, cell state. I think of it as a lighthearted kind of beer conversation at this point, as opposed to sort of the war of 16th and 17th century between biologists. And there's a, you know, there's a particular definition that I tried to come up with that has to do with reversibility of the transcriptional change under physiological conditions. So as long as cell can go back and forth, we can think of it as a state as opposed to a type. But I should just point out that none of this is universal. You know, there will be a lot of exceptions. That are very important for the biology. So ideally, you'd like to, as Amos pointed out, try to sort of predict the potential futures of the cell and classify it based on that. But I think we're quite far from that, so for now, maybe we can agree on more terminology and guidelines rather than strict definitions. Thank you.
More from Joshua

Scientist Stories: Hans Waterham, The value of phenotypic assays in peroxisomal disorders

Scientist Stories: Joel Zlotogora, Genetic carrier screening programs for reproductive purposes








