-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEVscope_report.Rmd
371 lines (259 loc) · 9.9 KB
/
EVscope_report.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
---
title: "EVscope output report"
author:
- Rambo (Yiyong) Zhao^[[email protected]]
- Xianjun Dong^[[email protected]]
- Himanshu Chintalapudi^[[email protected]]
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
bookdown::html_document2:
collapsed: true
fig_width: 8
highlight: haddock
number_sections: false
keep_md: false
theme: cerulean
toc: true
toc_depth: 4
toc_float:
collapsed: yes
css: !expr file.path(here::here(), "EVscope.css")
editor_options:
chunk_output_type: console
---
```{r, echo=FALSE, message = FALSE}
knitr::opts_chunk$set(echo = F, fig.height=8, fig.width=8, message=F, warning=F, cache=F, fig.align = 'center')
library(DT)
library(kableExtra)
library(here)
# some required helper functions:
downloadableDT<- function(atable, rownames = NULL, pageLength = 50){
require(DT)
datatable(atable,
rownames = rownames,
extensions = 'Buttons',
options = list(
autoWidth = TRUE,
scrollX=TRUE,
dom = 'Blfrtip', # 'B' adds buttons, 'frtip' keeps other controls
pageLength = pageLength, # Number of rows per page
buttons = c('copy', 'csv', 'excel', 'pdf'),
lengthMenu = list( c(10, 20, -1), # declare values
c(10, 20, "All") # declare titles
)
),
class = "compact stripe hover")
}
```
**This report contains a comprehensive breakdown of all relevant QC reports, log files and plots for all steps after running EVscope. **
```{r, echo=FALSE, results='asis'}
knitr::asis_output("\n\n \n\n")
```
```{r, out.width="75%", out.height="75%"}
knitr::include_graphics("figures/EVscope_pipeline.png")
```
```{r, echo=FALSE, results='asis'}
fp = file.path
here::i_am(knitr::current_input())
proj_dir<- here()
dirs <- list.dirs(proj_dir, recursive = FALSE, full.names = TRUE)
output_dir<- dirs[grep("processed", dirs, ignore.case = TRUE)][1]
# Only proceed if the output_dir is found, else stop knitting
if (is.na(output_dir) || output_dir == "") {
stop("Error: The output directory was not found, required module outputs have not been generated by the pipeline!")
}
```
# 01_raw_fastqc {.tabset}
This section contains the QC reports generated by <a href="https://www.bioinformatics.babraham.ac.uk/projects/fastqc">FastQC</a>.
```{r, echo=FALSE, results='asis'}
raw_fastc_01<- list.files(fp(output_dir, "01_raw_fastqc"), pattern = ".html", full.names = T)
html_links <- paste0("[", basename(raw_fastc_01), "](", raw_fastc_01, ")")
for (file in raw_fastc_01) {
cat(basename(file), "\n\n") # Display the filename
cat(sprintf('<iframe src="%s" width="100%%" height="1000px"></iframe>\n\n', file)) # Embed the file in an iframe
}
cat('<br>')
cat('<br>')
```
# 02_UMI_motif
This section contains the results of UMI motif extraction (14-bp motifs) from Read2
```{r}
umi_motif_02_files<- list.files(fp(output_dir, "02_UMI_motif"), full.names = T)
umi_motif_02_png<- umi_motif_02_files[grepl("png", umi_motif_02_files)]
knitr::include_graphics(umi_motif_02_png)
umi_motif_02_csv_name<- umi_motif_02_files[grepl(".csv", umi_motif_02_files)]
```
`r basename(umi_motif_02_csv_name)`
```{r, class.output="scroll-100"}
umi_motif_02_csv<- read.csv(umi_motif_02_csv_name)
#downloadableDT(umi_motif_02_csv, pageLength=10)
datatable(umi_motif_02_csv, rownames = NULL, options = list(scrollX=F))
```
```{r, results='asis'}
cat("<br><br><br>")
```
# 03_trim_galore
```{r, echo=FALSE, results='asis', class.output="scroll-100"}
trim_galore_03_files<- list.files(fp(output_dir, "03_trim_galore"), full.names = T)
trim_galore_03_reports<- trim_galore_03_files[grepl("report", trim_galore_03_files)]
for (file in trim_galore_03_reports) {
cat(basename(file), "\n\n") # Display the filename
cat(sprintf('<iframe src="%s" width="100%%" height="600px"></iframe>\n\n', file)) # Embed the file in an iframe
}
cat('<br>')
cat('<br>')
```
# 04_trim_galore_fastqc
```{r, echo=FALSE, results='asis'}
trim_galore_fastqc_files<- list.files(fp(output_dir, "04_trim_galore_fastqc"), full.names = T, pattern = ".html")
for (file in trim_galore_fastqc_files) {
cat(basename(file), "\n\n") # Display the filename
cat(sprintf('<iframe src="%s" width="100%%" height="1000px"></iframe>\n\n', file)) # Embed the file in an iframe
}
cat('<br>')
cat('<br>')
```
# 07_second_STAR
```{r}
second_STAR_07_files<- list.files(fp(output_dir, "07_second_STAR"), full.names = T)
second_STAR_07_log<- second_STAR_07_files[grepl("\\_dedup_Log.final.out$", second_STAR_07_files)]
#second_STAR_07_log<- read.delim(second_STAR_07_log, header = F)
```
[`r basename(second_STAR_07_log)`](`r second_STAR_07_log`)
```{r, results='asis'}
cat("<br><br><br>")
```
# 08_CIRCexplorer2
```{r, class.output="scroll-100"}
CIRCexplorer2_08_files<- list.files(fp(output_dir, "08_CIRCexplorer2"), full.names = T)
CIRCexplorer2_08_cpm_tsv<- CIRCexplorer2_08_files[grepl("\\_CPM.tsv$", CIRCexplorer2_08_files)]
```
`r basename(CIRCexplorer2_08_cpm_tsv)`
```{r, class.output="scroll-100"}
CIRCexplorer2_08_cpm_tsv<- read.table(CIRCexplorer2_08_cpm_tsv, header = T)
downloadableDT(CIRCexplorer2_08_cpm_tsv)
CIRCexplorer2_08_circularRNA<- CIRCexplorer2_08_files[grepl("circularRNA", CIRCexplorer2_08_files)]
```
`r basename(CIRCexplorer2_08_circularRNA)`
```{r}
CIRCexplorer2_08_circularRNA<- read.table(CIRCexplorer2_08_circularRNA)
downloadableDT(CIRCexplorer2_08_circularRNA)
```
```{r, results='asis'}
cat("<br><br><br>")
```
# 09_BWA_CIRI2
```{r}
BWA_CIRI2_09_files<- list.files(fp(output_dir, "09_BWA_CIRI2"), full.names = T)
BWA_CIRI2_09_readcounts_CPM <- BWA_CIRI2_09_files[grepl("\\_readcounts_CPM.tsv$", BWA_CIRI2_09_files)]
```
`r basename(BWA_CIRI2_09_readcounts_CPM)`
```{r}
BWA_CIRI2_09_readcounts_CPM<- read.table(BWA_CIRI2_09_readcounts_CPM, header = T)
downloadableDT(BWA_CIRI2_09_readcounts_CPM)
BWA_CIRI2_09_CIRI2_out<- BWA_CIRI2_09_files[grepl("\\_CIRI2_out.tsv$", BWA_CIRI2_09_files)]
```
`r basename(BWA_CIRI2_09_CIRI2_out)`
```{r}
BWA_CIRI2_09_CIRI2_out<- read.delim(BWA_CIRI2_09_CIRI2_out)
downloadableDT(BWA_CIRI2_09_CIRI2_out)
```
```{r, results='asis'}
cat("<br><br><br>")
```
# 10_merge_CIRI2_CIRCexplorer2
```{r}
merge_CIRI2_CIRCexplorer2_files<- list.files(fp(output_dir, "10_merge_CIRI2_CIRCexplorer2"), full.names = T)
merge_CIRI2_CIRCexplorer2_CIRI2_tsv<- merge_CIRI2_CIRCexplorer2_files[grepl("\\CIRI2.tsv$", merge_CIRI2_CIRCexplorer2_files)]
```
`r basename(merge_CIRI2_CIRCexplorer2_CIRI2_tsv)`
```{r}
merge_CIRI2_CIRCexplorer2_CIRI2_tsv<- read.delim(merge_CIRI2_CIRCexplorer2_CIRI2_tsv)
downloadableDT(merge_CIRI2_CIRCexplorer2_CIRI2_tsv)
```
```{r,echo=FALSE, results='asis'}
merge_CIRI2_CIRCexplorer2_pdfs<- merge_CIRI2_CIRCexplorer2_files[grepl("\\.pdf$", merge_CIRI2_CIRCexplorer2_files)]
for (pdf in merge_CIRI2_CIRCexplorer2_pdfs) {
cat(basename(pdf), "<br>\n")
cat(sprintf('<iframe src="%s" width="100%%" height="600px"></iframe><br><br>\n\n', pdf)) # Add iframe and extra breaks
}
cat('<br>')
cat('<br>')
```
# 11_picard_metrics
```{r, fig.height=12}
picard_metrics_files<- list.files(fp(output_dir, "11_picard_metrics"), full.names = T)
picard_metrics_pdf<- picard_metrics_files[grepl("pdf", picard_metrics_files)]
#knitr::include_graphics(picard_metrics_pdf)
```
<iframe src="`r picard_metrics_pdf`" width="100%" height="600px"></iframe>
```{r, results='asis'}
cat("<br><br><br>")
```
# 12_featureCounts
```{r}
featureCounts_12_files<- list.files(fp(output_dir, "12_featureCounts"), full.names = T,
pattern = "fragment_level_featureCounts\\.tsv$")
# featureCounts_12_tsv<- read.table(featureCounts_12_files, header = T)
#
# featureCounts_12_tsv%>%
# DT::datatable(
# extensions = 'Buttons',
# options = list(dom = 'Bfrtip',
# pageLength = 10,
# buttons = c('excel', "csv")))
links <- paste0("<a href='", featureCounts_12_files, "' download>", basename(featureCounts_12_files), "</a>")
knitr::kable(data.frame(Files = links), escape = FALSE)
```
```{r, results='asis'}
cat("<br><br><br>")
```
# 13_plot_RNA_distribution
```{r}
plot_RNA_distribution_files<- list.files(fp(output_dir, "13_plot_RNA_distribution"), full.names = T)
plot_RNA_distribution_tsv<- plot_RNA_distribution_files[grepl("CPM.tsv", plot_RNA_distribution_files)]
```
`r basename(plot_RNA_distribution_tsv)`
```{r, echo=FALSE, results='asis'}
plot_RNA_distribution_tsv<- read.table(plot_RNA_distribution_tsv, header = T)
downloadableDT(plot_RNA_distribution_tsv)
plot_RNA_distribution_pdfs<- plot_RNA_distribution_files[grepl("pdf", plot_RNA_distribution_files)]
for (pdf in plot_RNA_distribution_pdfs) {
cat(basename(pdf), "<br>\n")
cat(sprintf('<iframe src="%s" width="100%%" height="600px"></iframe><br><br>\n\n', pdf)) # Add iframe and extra breaks
}
cat('<br>')
cat('<br>')
```
# 15_Kraken
```{r}
kraken_15_files<- list.files(fp(output_dir, "15_Kraken"), full.names = T, pattern = ".html")
```
`r basename(kraken_15_files)`
<iframe src=`r kraken_15_files` width="100%" height="600px"></iframe>
```{r, results='asis'}
cat("<br><br><br>")
```
# 17_QC_matrix
```{r}
QC_matrix_files<- list.files(fp(output_dir, "17_QC_matrix"), full.names = T, pattern = "\\.tsv$")
QC_matrix_tsv<- read.delim(QC_matrix_files)
```
`r basename(QC_matrix_files)`
```{r}
downloadableDT(QC_matrix_tsv)
```
```{r, results='asis'}
cat("<br><br><br>")
```
# R session info
This section includes technical details about the R packages used to produce this report. Most readers can safely ignore it.
<button class="btn btn-rcode" data-toggle="collapse" data-target="#BlockName"> Show/Hide R Session Details </button>
<div id="BlockName" class="collapse">
```{r session info}
sess <- devtools::session_info()
sess$platform
knitr::kable(as.data.frame(sess$packages), caption="Package versions")
```
</div>
<div class="tocify-extend-page" data-unique="tocify-extend-page" style="height: 0;"></div>