comparison 04_per_sequence_quality_score.Rmd @ 2:c64267b9f754 draft default tip

planemo upload commit 841d8b22bf9f1aaed6bfe8344b60617f45b275b2-dirty
author mingchen0919
date Sun, 30 Dec 2018 12:48:14 -0500
parents b7c115edd970
children
comparison
equal deleted inserted replaced
1:92e3de11b9f8 2:c64267b9f754
1 --- 1 ---
2 output: html_document 2 output: html_document
3 --- 3 ---
4 4
5 ```{r setup, include=FALSE, warning=FALSE, message=FALSE} 5 ```{r setup, include=FALSE, warning=FALSE, message=FALSE}
6 knitr::opts_chunk$set( 6 knitr::opts_knit$set(progress = FALSE)
7 echo = as.logical(opt$X_e), 7 knitr::opts_chunk$set(error = TRUE, echo = FALSE)
8 error = TRUE,
9 eval = TRUE
10 )
11 ``` 8 ```
12 9
13 10 ### Per sequence quality score
14 # Per sequence quality score
15 11
16 ```{r 'Per sequence quality score', fig.width=10} 12 ```{r 'Per sequence quality score', fig.width=10}
17 ## reads 1 13 ## reads 1
18 psqs_1 = extract_data_module(paste0(opt$X_d, '/read_1_fastqc/fastqc_data.txt'), 'Per sequence quality scores') 14 psqs_1 = extract_data_module(paste0(opt$X_d, '/read_1_fastqc/fastqc_data.txt'), 'Per sequence quality scores')
19 psqs_1$trim = 'before' 15 psqs_1$trim = 'before'
23 psqs_2$trim = 'after' 19 psqs_2$trim = 'after'
24 20
25 comb_psqs = rbind(psqs_1, psqs_2) 21 comb_psqs = rbind(psqs_1, psqs_2)
26 comb_psqs$trim = factor(levels = c('before', 'after'), comb_psqs$trim) 22 comb_psqs$trim = factor(levels = c('before', 'after'), comb_psqs$trim)
27 23
28 p = ggplot(data = comb_psqs, aes(x = X.Quality, y = Count)) + 24 p = ggplot(data = comb_psqs) +
29 geom_line(color = 'red') + 25 geom_line(mapping = aes(x = X.Quality, y = Count), color = 'red') +
30 facet_grid(. ~ trim) + 26 facet_grid(. ~ trim) +
31 xlim(min(comb_psqs$X.Quality), max(comb_psqs$X.Quality)) + 27 scale_x_continuous(name = 'Mean Sequence Qaulity (Phred Score)',
32 xlab('Mean Sequence Qaulity (Phred Score)') + 28 limits = c(min(comb_psqs$X.Quality), max(comb_psqs$X.Quality))) +
33 ylab('') 29 scale_y_continuous(name = '') +
34 ggplotly(p) 30 theme(panel.background = element_rect(fill = NA),
31 axis.line = element_line(),
32 panel.grid.major.y = element_line(color = 'blue', size = 0.1))
33 p
35 ``` 34 ```
35