-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathqc.atac.Rmd
127 lines (88 loc) · 2.79 KB
/
qc.atac.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
---
title: "ATAC-Seq QC"
output:
html_document:
toc: true
toc_float:
collapsed: false
smooth_scroll: true
number_sections: false
df_print: kable
---
<div>
<a href="https://www.rnaseqcore.vet.cornell.edu/" target="_blank" class="trex-logo"> <img src="/home/fa286/trex-extended-logo.png"
style=
"position:absolute;
top:0px;
right:0;
padding:20px;
height:140px;
text-align:justify;
display:block;
width:32%;
height:auto;
margin:0 auto 20px !important;"> </a>
</div>
<br><br><br><br><br>
***
## Fragment Size Distributions
```{r out.width=c('50%', '50%'), fig.show='hold', echo=F}
p1 <- list.files("./atacQC.out/", pattern = "fragSize.png$", full.names = T)
knitr::include_graphics(p1)
```
## TSSE Scores
[Encode Guidelines](https://www.encodeproject.org/atac-seq/#standards)
![](atacQC.out/TSSE_scores.png){width=1000px}
```{r out.width=c('50%', '50%'), fig.show='hold', echo=F , eval=F}
p3 <- list.files("./atacQC.out/", pattern = "narrowPeak.Annotated.png$", full.names = T)
knitr::include_graphics(p3)
```
## Peak Annotations
```{r echo=FALSE, eval=T, out.width=1000, out.height=1000}
logs = list.files(path = "./atacQC.out/", pattern = "__percent__annot__log.txt$", full.names = T)
logs.list = list()
for (i in 1:length(logs)) {
logs.list[[i]] <- read.table(logs[i], header = T, sep = "\t", row.names = 1)
names(logs.list)[[i]] <- gsub(pattern = "_peaks.narrowPeak__percent__annot__log.txt",
replacement = "", basename(logs[[i]]))
}
logs.df <- do.call("rbind", logs.list)
suppressPackageStartupMessages(library(tidyr))
logs.df$tmp = rownames(logs.df)
logs.df = separate(logs.df, col = tmp, into = "sampleID", sep = "\\.", extra = "drop")
colors<- c("#EF8A62",
"#1f78b4",
"#1b9e77",
"khaki4",
"#E9A3C9",
"#A1D76A",
"#FFFF33",
"grey",
"#b3e2cd",
"#67A9CF",
"peachpuff2",
"red",
"magenta3",
"blue",
"yellow"
)
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(plotly))
logs.df$Frequency = round(logs.df$Frequency, 1)
m <- list(
l = 50,
r = 50,
b = 100,
pad = 20
)
logs.df %>% plot_ly(x = ~Frequency, y = ~sampleID, type = 'bar', orientation = "h",
name = ~Feature, color = ~Feature, colors =rev(colors) ) %>%
layout(yaxis = list(title = 'Percentage(%)'), barmode = 'stack',
legend = list(orientation = 'h', xanchor = "center",
x = 0.5, y = -0.1), margin = m)
```
## Read Count Frequencies
```{r out.width=c('50%', '50%'), fig.show='hold', echo=F}
p2 <- list.files("./atacQC.out/", pattern = "peaks.narrowPeak.Distribution.png$", full.names = T)
knitr::include_graphics(p2)
```