# 2.3.4 算法 | 2021-细胞分群新方法——CNA（co-varying neighborhood analysis）

## 前言

题目：Co-varying neighborhood analysis identifies cell populations associated with phenotypes of interest from single-cell transcriptomics

日期：2021-10-21

期刊：nature biotechnology

链接：<https://www.nature.com/articles/s41587-021-01066-4>

## 方法描述

我们一般进行细胞分群时会进行降维聚类，这个方法也是为了分群，但它认为聚类的方法一般需要假设数据很好地捕获到生物信息，而且聚类的方法一般都需要反复调整聚类参数（比如resolution）。这个方法的**核心是”邻域“**（定义是very small regions in transcriptional space），再根据不同样本中邻域的共同特性去整合数据。

下面这个图展示的非常明白：

* a左：这是一个4个样本组成的单细胞数据，进行了一个降维操作。这里展示的二维图形可以是一个主成分，也可以是多组学数据的canonical co-variates，这个过程一般还需要去除批次效应。反正目的就是把大量的不同来源细胞”铺“在一个面上。
* a中：CNA会将每个细胞划给一个邻域，划分的依据就是其他细胞到达该细胞时随机游走的步数。如果步数最短，那么这个细胞就是Anchor cell。中间的密度图就展示了红色圆圈的细胞被认定为”小范围的C位“

  > 划分依据: every other cell *m*′ belongs to the neighborhood anchored at cell *m* according to the probability that a random walk in the graph from *m*′ will arrive at *m* after *s* steps。
* a右：按照（a中）的方法，随机找几块区域（具体几块CNA会根据数据集计算）去寻找它们的邻域。比如这里的A-E就是（a左）图中的一部分，只是根据这几个小部分内部寻找了邻域而已
* b：代表密度的邻域图找出来以后，就要对应到每个样本了（1-4就是那4个样本）
* c：看每个样本（1-4）在5个区域（A-E）的密度，比如样本1在A区域的细胞数量少，那么就是蓝色（low）；样本3在A区域的细胞数量多，就是红色（high）；如果没有细胞（比如样本4的A区域），那就是紫色
* d：最后将细胞密度信息整理成一个矩阵，蓝色（low，数字 -1表示）；红色（high，数字1表示）；没有细胞就是0

![image-20211022153557677](https://jieandze1314-1255603621.cos.ap-guangzhou.myqcloud.com/blog/2021-10-22-073557.png)

### 方法优势

* 不需要调参数（比如分辨率）
* 运行速度大大提高：CNA has favorable runtime properties: given a nearest neighbor graph, computing the NAM and conducting permutation-based association testing takes **less than 1 min** (and **579 MB** of memory) for a dataset of more than **500,000 cells** and more than 250 samples.

### 方法劣势

* CNA依赖于样本间的差异，所以如果样本数量比较少效果就不好
* 因为CNA不需要假设数据符合生物背景知识，所以如果样本量小但的确符合生物背景知识的数据，CNA可能就不如现有的统计模型
* 虽然CNA可以支持现有的细胞类型注释和轨迹推断方法，但这类方法一般只寻求单一的信息；而CNA由于关注面比较广，可能会得到多方面的信息，可能会产生信息冗余
* CNA的核心就是邻域的划分，那么是否每次都能找到合适的anchor cell，又是否存在划分的边界呢？


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jieandze1314.osca.top/02/2.3.4-suan-fa-2021-xi-bao-fen-qun-xin-fang-fa-cnacovarying-neighborhood-analysis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
