forked from stemangiola/ppcseq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
67 lines (49 loc) · 1.38 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
---
title: "Posterior predictive check for bulk RNA sequencing data"
output: github_document
---
The input data set is a tidy representation of a differential gene transcript abundance analysis
```{r echo=FALSE, include=FALSE}
library(tidyverse)
library(ppcSeq)
```
To install:
For linux systems, in order to exploit multi-threading, from R write:
```{r}
fileConn<-file("~/.R/Makevars")
writeLines(c( "CXX14FLAGS += -O3","CXX14FLAGS += -DSTAN_THREADS", "CXX14FLAGS += -pthread"), fileConn)
close(fileConn)
```
Then, install with
```{r eval=FALSE}
devtools::install_github("stemangiola/ppcSeq")
```
You can get the test dataset with
```{r eval=FALSE}
ppcSeq::counts
```
You can convert a list of BAM/SAM files into a tidy data frame of annotated counts
```{r warning=FALSE, message=FALSE}
counts.ppc =
ppcSeq::counts %>%
mutate(is_significant = FDR < 0.01) %>%
ppc_seq(
formula = ~ Label,
significance_column = PValue,
do_check_column = is_significant,
value_column = value,
percent_false_positive_genes = "5%"
)
```
The new posterior predictive check has been added to the original data frame
```{r }
counts.ppc
```
The new data frame contains plots for each gene
We can visualise the top five differentially transcribed genes
```{r }
counts.ppc %>%
slice(1:2) %>%
pull(plot) %>%
cowplot::plot_grid(plotlist = ., align = "v", ncol = 1, axis="b", rel_widths = 1 )
```