0
|
1
|
|
2
|
|
3
|
|
4 # Run FastQC
|
|
5
|
|
6 ```{bash eval=TRUE,echo=FALSE}
|
|
7 cd ${X_d}
|
|
8 cp ${X_r} ${X_d}/read_1.fq
|
|
9 cp ${X_R} ${X_d}/read_2.fq
|
|
10
|
|
11 mkdir -p read_1 read_2
|
|
12 cat >temp.sh <<EOL
|
|
13 fastqc \\
|
|
14 -q \\
|
|
15 -c ${X_c} \\
|
|
16 -l ${X_l} \\
|
|
17 ${X_d}/read_1.fq > /dev/null 2>&1
|
|
18
|
|
19 fastqc \\
|
|
20 -q \\
|
|
21 -c ${X_c} \\
|
|
22 -l ${X_l} \\
|
|
23 ${X_d}/read_2.fq > /dev/null 2>&1
|
|
24 EOL
|
|
25
|
|
26 grep -v None temp.sh > fastqc.sh
|
|
27
|
|
28 # run fastqc
|
|
29 sh fastqc.sh
|
|
30
|
|
31 # unzip outputs
|
|
32 unzip -q read_1_fastqc.zip
|
|
33 unzip -q read_2_fastqc.zip
|
|
34 ```
|
|
35
|
|
36 ```{r}
|
|
37 # display fastqc job script
|
|
38 fastqc_sh = paste0(opt$X_d, '/fastqc.sh')
|
|
39 tags$code(tags$pre(readChar(fastqc_sh, file.info(fastqc_sh)$size )))
|
|
40 ```
|
|
41
|
|
42 # Raw FastQC reports
|
|
43
|
|
44 ## Before trimming
|
|
45 ```{r eval=TRUE}
|
|
46 ori_html = tags$a(href = 'read_1_fastqc/fastqc_report.html', opt$X_n)
|
|
47 ori_fastqc_data = tags$a(href = 'read_1_fastqc/fastqc_data.txt', 'fastqc_data.txt')
|
|
48 ori_summary = tags$a(href = 'read_1_fastqc/summary.txt', 'summary.txt')
|
|
49 tags$ul(
|
|
50 tags$li(ori_html),
|
|
51 tags$li(ori_fastqc_data),
|
|
52 tags$li(ori_summary)
|
|
53 )
|
|
54 ```
|
|
55
|
|
56 ## After trimming
|
|
57 ```{r eval=TRUE}
|
|
58 ori_html = tags$a(href = 'read_2_fastqc/fastqc_report.html', opt$X_n)
|
|
59 ori_fastqc_data = tags$a(href = 'read_2_fastqc/fastqc_data.txt', 'fastqc_data.txt')
|
|
60 ori_summary = tags$a(href = 'read_2_fastqc/summary.txt', 'summary.txt')
|
|
61 tags$ul(
|
|
62 tags$li(ori_html),
|
|
63 tags$li(ori_fastqc_data),
|
|
64 tags$li(ori_summary)
|
|
65 )
|
|
66 ```
|
|
67
|
|
68
|
|
69 # Fastqc Output Visualization
|
|
70
|
|
71 ## Overview
|
|
72
|
|
73 ```{r eval=TRUE}
|
|
74 read_1_summary = read.csv(paste0(opt$X_d, '/read_1_fastqc/summary.txt'), header = FALSE, sep = '\t')[, 2:1]
|
|
75 read_2_summary = read.csv(paste0(opt$X_d, '/read_2_fastqc/summary.txt'), header = FALSE, sep = '\t')[, 1]
|
|
76 combined_summary = cbind(read_1_summary, read_2_summary)
|
|
77 names(combined_summary) = c('MODULE', paste0(opt$X_n, '(before)'), paste0(opt$X_N, '(after)'))
|
|
78 combined_summary[combined_summary == 'FAIL'] = 'FAIL (X)'
|
|
79 combined_summary[combined_summary == 'WARN'] = 'WARN (!)'
|
|
80 knitr::kable(combined_summary)
|
|
81 ```
|