> For the complete documentation index, see [llms.txt](https://book.ncrnalab.org/teaching/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.ncrnalab.org/teaching/part-iii.-ngs-data-analyses/6.rna-regulation/rna_editing.md).

# 6.4.RNA Editing

## 1) Background

RNA编辑可能发挥多样化的调控作用。

![](/files/-Ll_k4jxJOu0POhpQK9B)

mRNA主要存在四类RNA editing事件。

![](/files/-Ll_k4jvq8vS7aEP_2PY)

A to I editing是最常见的一类editing事件。在RNA-seq建库的过程中,逆转录的过程会把I转化为G。所以A to I的editing会体现为reads中A to G的coversion。

![](/files/-Ll_k4jtaZAeY-4kbHK6)

## 2) Tools

* 把reads mapping回参考基因组后，对于一些已知的RNA editing位点，我们可以统计落在每一个位点的reads有多少发生了editing，有多少没发生editing。用`samtools mpileup`命令再结合一些简单的脚本就可以实现这一目的。GATK提供的[ASEReadCounter](https://gatk.broadinstitute.org/hc/en-us/articles/360036885471-ASEReadCounter)也可以很容易的实现这一点。
* 利用mapping的结果，我们也可以从头发现一些RNA编辑事件。我们这里介绍的[RNAeditor](http://rnaeditor.uni-frankfurt.de/)这个工具用于RNA编辑事件的从头发现。下面我们简述这种从头发现的基本原理。
* RNA编辑导致的A to G的转换是一种RNA水平的单核苷酸变异(SNV)，所以用[GATK](https://gatk.broadinstitute.org/hc/en-us)中[HaplotypeCaller](https://gatk.broadinstitute.org/hc/en-us/articles/4418062719899-HaplotypeCaller)这类进行variant calling的工具原理上可以检测到这些editing事件(在[snv\_rna-seq](/teaching/part-iii.-ngs-data-analyses/6.rna-regulation/snv_rna-seq.md)一节中我们会对GATK的使用进行专门的介绍)。
* 在DNA水平上也会存在很多单核苷酸多态性(SNP)，其中有一部分相对于参考基因组又恰好是A to G的coversion。在这类SNP和RNA编辑事件之间进行区分，理想情况下，如果我们有配套的DNA-seq数据，就可以把DNA水平上存在的A to G coversion给过滤掉，认为剩下的对应着RNA编辑事件。
* 在没有配套的DNA-seq数据的情况下，对于人类数据，由于人已经有很多已知的SNP，一种常见做法是从GATK计算出的A to G conversion中过滤掉已知的A to G的SNP,认为剩下来的对应着真实的editing events。[RNAeditor](http://rnaeditor.uni-frankfurt.de/)采用的就是这样的策略。

## 3) Pipeline

下图展示了RNAeditor内部实现的分析流程。RNAeditor用bwa做RNA-seq的reads mapping，并没有用STAR,hisat2这类spliced aligner，可能是因为作者认为考虑splicing对结果影响不大。

![](/files/-Ll_k4jzEKlamzGChhKx)

## 4) Running steps (RNAEditor)

请首先启动相应 [Docker](/teaching/part-iii.-ngs-data-analyses/6.rna-regulation.md#files)，进入工作目录。

### 4a) input files

We need a configuration file to assign the input files to the `RNAeditor`, here is a brief look of configuration file

```bash
# This file is used to configure the behaviour of RNAeditor
# Standard input files
refGenome = /home/test/data/Homo_sapiens.GRCh38.ch1.fa
gtfFile = /home/test/data/Homo_sapiens.GRCh38.chr1.gtf
dbSNP = /home/test/data/dbSNP.vcf.new
hapmap = /home/test/data/HAPMAP.vcf
omni = /home/test/data/1000GenomeProject.vcf
esp = /home/test/data/ESP.chr1.vcf
aluRegions = /home/test/data/Repeats.chr1.bed
output = /apps/RNAEditor/output/chr1
sourceDir = /usr/local/bin/
maxDiff = 0.04
seedDiff = 2
standCall = 0
standEmit = 0
edgeDistance = 3
intronDistance = 5
minPts = 5
eps = 50
paired = False
keepTemp = True
overwrite = False
threads = 1
```

注意：当使用singularity时，需要改变refGenome、gtfFile、dbSNP、hapmap、omni、esp、aluRegions、output等改成对应路径。

### 4b) starting analysis

```
rm -rf /apps/RNAEditor/output
mkdir /apps/RNAEditor/output
cd /apps/RNAEditor
RNAEditor.py -i /home/test/chr1.fq  -c /home/test/config_new
mv /apps/RNAEditor/output/ /home/test/out_new
```

## 5) Homework

* 参照RNAEditor网页上[Documentation](http://rnaeditor.uni-frankfurt.de/documentation.php)页面，理解示例文件运行完的输出结果中chr1.editingSites.vcf和chr1.editingSites.gvf的含义。根据chr1.editingSites.gvf文件，统计RNA编辑位点在基因组上的分布（3‘UTR,intron等各不同区域各有多少RNA editing sites,用柱形图或表格展示）。

## 6) References

* A-to-I RNA editing — immune protector and transcriptome diversifier. Eli Eisenberg, et al. Nature Reviews, 2018.
* RNAEditor: easy detection of RNA editing events andthe introduction of editing islands. David John, et al. Briefings in Bioinformatics, 2017.
* 有兴趣的同学还可以参考[rMATS-DVR](https://github.com/Xinglab/rMATS-DVR)这个工具。它和我们前面介绍的用于可变剪接分析的rMATs是同一个实验室开发的，在计算组件差异的显著性时用的是同样的的统计检验。
