-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.Rmd
138 lines (104 loc) · 3.95 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# raer <a href="https://rnabioco.github.io/raer"><img src="man/figures/logo.png" align="right" height="138" /></a>
<!-- badges: start -->
[![R-CMD-check-bioc](https://github.com/rnabioco/raer/actions/workflows/check-bioc.yml/badge.svg)](https://github.com/rnabioco/raer/actions/workflows/check-bioc.yml)
[![Codecov test coverage](https://codecov.io/gh/rnabioco/raer/branch/devel/graph/badge.svg)](https://app.codecov.io/gh/rnabioco/raer?branch=devel)
[![platforms](https://bioconductor.org/shields/availability/devel/raer.svg)](https://bioconductor.org/checkResults/release/bioc-LATEST/raer)
[![bioc](https://bioconductor.org/shields/years-in-bioc/raer.svg)](https://bioconductor.org/packages/release/bioc/html/raer.html)
<!-- badges: end -->
raer facilitates analysis of RNA adenosine editing in the
[Bioconductor](https://bioconductor.org/) ecosystem.
## Installation
`raer` is available on [Bioconductor](https://bioconductor.org/packages/release/bioc/html/raer.html):
```{r, eval = FALSE}
if (!require("BiocManager", quietly = TRUE)) {
install.packages("BiocManager")
}
BiocManager::install("raer")
```
You can install the development version of raer from [GitHub](https://github.com/rnabioco/raer) with:
```{r, eval = FALSE}
BiocManager::install("rnabioco/raer")
```
## Quick start
![raer workflow overview](man/figures/raer_workflow.png)
raer provides methods to compute per site read count summaries from BAM
alignment files, either for known editing sites, or for all detected sites.
```{r pileup_sites}
library(raer)
bam1fn <- raer_example("SRR5564269_Aligned.sortedByCoord.out.md.bam")
bam2fn <- raer_example("SRR5564277_Aligned.sortedByCoord.out.md.bam")
fafn <- raer_example("human.fasta")
bams <- c("ko" = bam1fn, "wt" = bam2fn)
rse <- pileup_sites(bams, fafn)
```
To facilitate comparisons across groups, base count data and genomic coordinates
are stored in a `RangedSummarizedExperiment`.
```{r}
suppressMessages(library(SummarizedExperiment))
rse
assays(rse)
colData(rse)
```
```{r}
assays(rse)$nRef[1:4, ]
assays(rse)$nAlt[1:4, ]
```
The `FilterParam()` class holds multiple options for customizing the output of `pileup_sites()`.
```{r params}
fp <- FilterParam(
only_keep_variants = TRUE,
library_type = "fr-first-strand",
min_depth = 2
)
rse <- pileup_sites(bams, fafn, param = fp)
rse
```
`pileup_cells()` provides support for quantifying editing sites in single cell libraries.
```{r scrnaseq}
scbam_fn <- raer_example("5k_neuron_mouse_possort.bam")
outdir <- tempdir()
editing_sites <- GRanges(
c(
"2:579:-",
"2:625:-",
"2:589:-"
),
REF = "A",
ALT = "G"
)
cbs <- c(
"CACCAAACAACAACAA-1",
"TATTCCACACCCTCTA-1",
"GACCTTCAGTTGTAAG-1"
)
sce <- pileup_cells(scbam_fn,
sites = editing_sites,
cell_barcodes = cbs,
param = fp,
output_directory = outdir
)
sce
```
```{r}
assays(sce)$nRef
assays(sce)$nAlt
```
## Related work
Core routines in `raer` are implemented using the `htslib` library and methods from `samtools` and `bcftools`. `raer` builds off of approaches from other RNA editing detection tools:
- [REDItools](https://github.com/BioinfoUNIBA/REDItools) from [Picardi E, Pesole G](https://doi.org/10.1093/bioinformatics/btt287)
- [JACUSA2](https://github.com/dieterich-lab/JACUSA2) from [Piechotta M et al ](https://doi.org/10.1186/s12859-016-1432-8)
- [deNovo-Detect](https://github.com/a2iEditing/deNovo-Detect) from [Gabay O et al ](https://doi.org/10.1038/s41467-022-28841-4)
- [RNAEditingIndexer](https://github.com/a2iEditing/RNAEditingIndexer) from [Roth SH et al](https://doi.org/10.1038/s41592-019-0610-9)
- [SAILOR](https://github.com/YeoLab/sailor) from [Washburn MC et al](https://10.1016/j.celrep.2014.01.011)