# 2.3.6 工具 | 2021-MACA: 一款自动注释细胞类型的工具

## 前言

题目：MACA: Marker-based automatic cell-type annotation for single cell expression data

日期：2021-10-25

期刊：biorxiv预印本

链接：<https://www.biorxiv.org/content/10.1101/2021.10.25.465734v1>

GitHub：<https://github.com/ImXman/MACA>

## 设计的初衷

目前细胞类型鉴定工具中，Support Vector Machine(SVM) 的准确性超过大多数监督注释方法

> “Support Vector Machine” (SVM) is a **supervised machine learning** algorithm that can be used for both classification or regression challenges. However, it is mostly used in classification problems.

但是，由于监督注释方法在大多数单细胞数据中缺乏真实参照，所以易用性没有非监督方法好，这也是目前非监督方法占主流的原因之一。既然使用非监督方法，那么就需要人工介入，调整分群的分辨率，以及提供marker基因，这样带来的问题就是挑选marker基因耗费时间，并且重复性差（因为每个人选择的marker基因也不同）。

基于第一个问题（挑选marker基因耗费时间），有人做了数据库，专门收录这些基因，比如PanglaoDB, CellMarker涵盖了人和小鼠多种细胞类型的marker 基因；另外NeuroExpresso是大脑组织的marker基因数据库。

这个工具MACA，全称是marker-based automatic cell-type annotation，旨在解决细胞注释的速度和准确性

## 设计的结构

> 整个设计逻辑还是很容易理解的：先判断单个细胞属于什么类型，然后聚类再判断一次属于什么类型

读入数据：single cell或者single nuclei RNA-Seq的表达矩阵

对每个细胞计算2个label：

* 首先，结合marker数据库，使用raw count表达矩阵，计算每个细胞的cell-type score =》 将 gene expression matrix转换成cell-type score matrix
* 然后，对每个细胞分配细胞类型：将score最大的细胞类型对应到这个细胞 =》 Label 1 产生
* 同时，利用cell-type score matrix + Louvain community detection algorithm，将细胞聚类 =》 Label 2 产生（也就是某群细胞属于什么类型）

因为一开始不知道具体有几种细胞类型，这里**MACA默认将分辨率调大**，避免很多同源的细胞被拆分成很多小的cluster

之后就是通过一系列统计知识，将Label1 和Label2利用起来：MACA records **significant or at least the top-3 celltypes for each cell** in cluster based on cell-type scores

意思就是挑出个人很能打，并且整体也很符合要求的那组

![image-20211027151738178](https://jieandze1314-1255603621.cos.ap-guangzhou.myqcloud.com/blog/2021-10-27-071738.png)

## 实际测试

### **使用的方法、数据**

* investigated **4 scoring methods** that have been proposed to transform gene expression matrix to cell-type score matrix
* 2 public marker databases
* 6 single cell studies comprised of 3000 to 20000 cells
* 使用Adjusted Rand Index (ARI) and Normalized Mutual Information (NMI)进行评测

> ARI & NMI are measuring similarity or agreement between our annotations and authors’ annotations

### **评测打分工具**

发现全部6个数据集中 annotations using **PlinerScore** with markers in **PanglaoDB** have the largest agreement。于是采用PlinerScore作为打分方法

### **接下来和自动细胞注释工具比较**

利用PanglaoDB的marker，和CellAssign, SCINA, Cell-ID, and scCATCH比较

发现速度差异：

* **MACA** can finish annotation **within 1 minute (cells around 3,000)** and **less than 2 minutes** for a relatively large dataset (cells up to **20,000** cells)
* scCATCH and Cell-ID took longer than MACA
* SCINA took around 20-minute for a large dataset
* CellAssign took the longest time with > 20,000 cells due to lack of memory

发现注释结果差异：

* **MACA** labels cells had a higher consensus than CellAssign, SCINA, Cell-ID, and scCATCH
* 和作者的结果相似：**MACA and scCATCH** identify similar numbers of cell-types to author’s annotations


---

# 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.6-gong-ju-2021maca-yi-kuan-zi-dong-zhu-shi-xi-bao-lei-xing-de-gong-ju.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.
