11
|
1 ---
|
|
2 title: 'Per base sequence quality'
|
|
3 output:
|
|
4 html_document:
|
|
5 number_sections: true
|
|
6 toc: true
|
|
7 theme: cosmo
|
|
8 highlight: tango
|
|
9 ---
|
|
10
|
|
11 ```{r setup, include=FALSE, warning=FALSE, message=FALSE}
|
|
12 knitr::opts_chunk$set(
|
|
13 echo = ECHO,
|
|
14 error = TRUE
|
|
15 )
|
|
16 ```
|
|
17
|
|
18 ### Per base sequence quality
|
|
19
|
|
20 ```{r 'per base sequence quality', fig.width=10}
|
|
21 ## reads 1
|
|
22 pbsq_1 = extract_data_module('REPORT_DIR/reads_1_fastqc_data.txt', 'Per base sequence quality')
|
|
23 pbsq_1$id = 1:length(pbsq_1$X.Base)
|
12
|
24 pbsq_1$trim = 'before'
|
11
|
25
|
|
26 ## reads 2
|
|
27 pbsq_2 = extract_data_module('REPORT_DIR/reads_2_fastqc_data.txt', 'Per base sequence quality')
|
|
28 pbsq_2$id = 1:length(pbsq_2$X.Base)
|
12
|
29 pbsq_2$trim = 'after'
|
11
|
30
|
12
|
31 comb_pbsq = rbind(pbsq_1, pbsq_2)
|
11
|
32 comb_pbsq$trim = factor(levels = c('before', 'after'), comb_pbsq$trim)
|
|
33
|
|
34 p = ggplot(data = comb_pbsq) +
|
12
|
35 geom_boxplot(mapping = aes(x = id,
|
|
36 lower = Lower.Quartile,
|
|
37 upper = Upper.Quartile,
|
|
38 middle = Median,
|
|
39 ymin = X10th.Percentile,
|
|
40 ymax = X90th.Percentile,
|
|
41 fill = "yellow"),
|
|
42 stat = 'identity') +
|
|
43 geom_line(mapping = aes(x = id, y = Mean, color = "red")) +
|
|
44 scale_x_continuous(breaks = pbsq_2$id, labels = pbsq_2$X.Base) +
|
|
45 scale_fill_identity() +
|
|
46 scale_color_identity() +
|
|
47 ylim(0, max(comb_pbsq$Upper.Quartile) + 5) +
|
14
|
48 xlab('Position in read (bp)') +
|
12
|
49 facet_grid(. ~ trim) +
|
11
|
50 theme(axis.text.x = element_text(angle=45))
|
12
|
51 p
|
11
|
52
|
|
53 ``` |