10X单细胞(10X空间转录组)聚类算法之leiden

hello,大家好,今天我们来分享一下最新常用的聚类算法----leiden,其实大家在看Seurat的函数FindClusters可能会观察到,其中有一个参数algorithm,有4个可选项,我们列举出来

1 = original Louvain algorithm(原始Louvain算法 )

2 = Louvain algorithm with multilevel refinement(具有多级细化的Louvain算法 )

3 = SLM algorithm(SLM算法,关于这个算法大家可以参考文章Neo4j:SLM群集算法的过程,我会在后续分享的文章中提到这个算法)。

4 = Leiden algorithm(leiden算法,这是我们今天分享的重点)。

在软件scanpy的运行函数中,原来的聚类函数sc.tl.louvain也被函数sc.tl.leiden取代,可见更大范围上,leiden算法比louvain更为合适。

其中关于louvain的算法,在我分享的文章10X单细胞(10X空间转录组)聚类算法之Louvain,详细介绍过,大家可以参考,而今天我们的内容,就从louvain和leiden的关系开始。

首先来总结一下louvain的缺点:

1、社区划分的精度有局限性

2、分组内细胞分布密度的大小会影响亚群的鉴定

3、被鉴定为同一个分群的细胞群内,存在两个没有连线的小分群

Leiden算法主要针对上述的第3个缺点,对louvain算法进行优化。Leiden算法的命名来源于荷兰莱顿大学(Leiden University)。该算法由莱顿大学的三位研究员开发,结果于2020年3月份发表在Scientific Reports上。

图片.png

总结Leiden算法优化louvain的两个要点:

比louvain算法运行更快。

针对louvain聚类结果中出现一些分群内部存在断链的现象(连线没有把所有细胞串起来,存在明显亚群)进行优化,分群更加合理,可能得到更多亚群。

图片.png

图解leiden算法的操作过程

再分享深入的算法之前,我们先来举一个例子

我们可以把聚类过程当作体育课的一场游戏。

学生是细胞,在操场上站队(聚类)。

模块度是体育老师,检查学生站队是否合理。

连线(细胞间权重)表示学生之间有一定的关系,比如同班同学,身高一致等。

18814178-5097858796545d61.png
经过学生的一阵骚动(初始划分聚类)之后,初始的队伍出来了,分成的三个队伍:
bbc62f88ff10f0373d084ed2d8a394f6.png
这时体育老师出来,看了看整体队形(模块度给聚类结果打分),感觉还不行(模块度分数偏低),需要调整分组站队。

Leiden和louvain算法的调整策略不同(leiden优化的要点一):

    1. Louvain:让每个同学去另外两个队伍,每次换队伍都让体育老师评价一下;
  • 2. Leiden:只让每个同学去有连线的其他队伍,节省时间。

当害羞同学从红队调整到绿队时,体育老师发现队形变好看了(模块度打分提高了)。因为红队身高整体比绿队高,害羞同学比较矮,适合绿队。害羞同学刚开始站在红队,是因为她跟红队是同班同学。

d9fa8820f6dc7aa0c4c866ab43862ac8.png

但害羞同学离开红队之后,问题就来了。红队内部出现左右两个没有连线的小队:耶小队和奸笑小队。Louvain算法没有检测这种内部断链的现象。尽管红队都是同班同学,但内部还是有身高的差异,耶小队比奸笑小队普遍矮小。之前不高不矮的害羞同学在的时候,还能起到内部过渡的作用。当害羞同学离开之后,红队内部出现两极化。

5029ff4baf29ffdf58f3e8da4f7ec5f7.png

幸亏体育老师提前备课,看了leiden算法,及时将红队分开。(leiden优化要点二)

下课铃声响起,体育老师手握Leiden书,看着同学们完美的队形,露出了满意的微笑。

那么接下来,我们就要进入深刻的leiden算法环节了。

简单回顾一下Louvain Algorithm

图片.png

对比一下leiden算法

We here introduce the Leiden algorithm, which guarantees that communities are well connected. The Leiden algorithm is partly based on the previously introduced smart local move algorithm, which itself can be seen as an improvement of the Louvain algorithm. The Leiden algorithm also takes advantage of the idea of speeding up the local moving of nodes and the idea of moving nodes to random neighbours. We consider these ideas to represent the most promising directions in which the Louvain algorithm can be improved, even though we recognise that other improvements have been suggested as well. The Leiden algorithm consists of three phases: (1) local moving of nodes, (2) refinement of the partition and (3) aggregation of the network based on the refined partition, using the non-refined partition to create an initial partition for the aggregate network. The Leiden algorithm is considerably more complex than the Louvain algorithm. Figure 3(下图) provides an illustration of the algorithm.

图片.png

we show that the Louvain algorithm has a major problem, for both modularity and CPM. The algorithm may yield arbitrarily badly connected communities, over and above the well-known issue of the resolution limit. Communities may even be internally disconnected. To address this important shortcoming, we introduce a new algorithm that is faster, finds better partitions and provides explicit guarantees and bounds. The new algorithm integrates several earlier improvements, incorporating a combination of smart local move, fast local move and random neighbour move. We prove that the new algorithm is guaranteed to produce partitions in which all communities are internally connected. In addition, we prove that the algorithm converges to an asymptotically stable partition in which all subsets of all communities are locally optimally assigned. The quality of such an asymptotically stable partition provides an upper bound on the quality of an optimal partition. Finally, we demonstrate the excellent performance of the algorithm for several benchmark and real-world networks. To ensure readability of the paper to the broadest possible audience, we have chosen to relegate all technical details to the Supplementary Information. The main ideas of our algorithm are explained in an intuitive way in the main text of the paper. We name our algorithm the Leiden algorithm

好了,就分享这么多了,大家多多学习

生活很好,有你更好

你可能感兴趣的:(10X单细胞(10X空间转录组)聚类算法之leiden)