0
|
1 ---
|
|
2 output: html_document
|
|
3 ---
|
|
4
|
|
5 ```{r setup, include=FALSE, warning=FALSE, message=FALSE}
|
|
6 knitr::opts_chunk$set(
|
|
7 echo = as.logical(opt$X_e),
|
|
8 error = TRUE,
|
|
9 eval = TRUE
|
|
10 )
|
|
11 ```
|
|
12
|
|
13 # Per tile sequence quality
|
|
14
|
|
15 ```{r 'per tile sequence quality', fig.width=10}
|
|
16 ## check if 'per tile sequence quality' module exits or not
|
|
17 check_ptsq = grep('Per tile sequence quality', readLines(paste0(opt$X_d, '/read_1_fastqc/fastqc_data.txt')))
|
|
18 if (length(check_ptsq) > 0) {
|
|
19 ## reads 1
|
|
20 ptsq_1 = extract_data_module(paste0(opt$X_d, '/read_1_fastqc/fastqc_data.txt'), 'Per tile sequence quality')
|
|
21 ptsq_1$trim = 'before'
|
|
22
|
|
23 ## reads 2
|
|
24 ptsq_2 = extract_data_module(paste0(opt$X_d, '/read_2_fastqc/fastqc_data.txt'), 'Per tile sequence quality')
|
|
25 ptsq_2$trim = 'after'
|
|
26
|
|
27 comb_ptsq = rbind(ptsq_1, ptsq_2)
|
|
28 comb_ptsq$trim = factor(levels = c('before', 'after'), comb_ptsq$trim)
|
|
29 comb_ptsq$Base = factor(levels = unique(comb_ptsq$Base), comb_ptsq$Base)
|
|
30
|
|
31 # convert integers to charaters
|
|
32 comb_ptsq$Tile = as.character(comb_ptsq$X.Tile)
|
|
33
|
|
34 p = ggplot(data = comb_ptsq, aes(x = Base, y = Tile, fill = Mean)) +
|
|
35 geom_raster() +
|
|
36 facet_grid(. ~ trim) +
|
|
37 xlab('Position in read (bp)') +
|
|
38 ylab('') +
|
|
39 theme(axis.text.x = element_text(angle=45))
|
|
40 ggplotly(p)
|
|
41 } else {
|
|
42 print('No "per tile sequence quality" data')
|
|
43 }
|
|
44 ``` |