annotate 01_evaluation_overview.Rmd @ 0:f74fdae99053 draft

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