comparison 05_per_base_sequence_content.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 base sequence content
14 # Per base sequence content
15 11
16 ```{r 'Per base sequence content', fig.width=10} 12 ```{r 'Per base sequence content', fig.width=10}
17 ## reads 1 13 ## reads 1
18 pbsc_1 = extract_data_module(paste0(opt$X_d, '/read_1_fastqc/fastqc_data.txt'), 'Per base sequence content') 14 pbsc_1 = extract_data_module(paste0(opt$X_d, '/read_1_fastqc/fastqc_data.txt'), 'Per base sequence content')
19 pbsc_1$id = 1:length(pbsc_1$X.Base) 15 pbsc_1$id = 1:length(pbsc_1$X.Base)
30 melt_pbsc_2$trim = 'after' 26 melt_pbsc_2$trim = 'after'
31 27
32 comb_pbsc = rbind(melt_pbsc_1, melt_pbsc_2) 28 comb_pbsc = rbind(melt_pbsc_1, melt_pbsc_2)
33 comb_pbsc$trim = factor(levels = c('before', 'after'), comb_pbsc$trim) 29 comb_pbsc$trim = factor(levels = c('before', 'after'), comb_pbsc$trim)
34 30
35 p = ggplot(data = comb_pbsc, aes(x = id, y = value, color = variable)) + 31 p = ggplot(data = comb_pbsc) +
36 geom_line() + 32 geom_line(mapping = aes(x = id, y = value, color = variable)) +
37 facet_grid(. ~ trim) + 33 facet_grid(. ~ trim) +
38 xlim(min(comb_pbsc$id), max(comb_pbsc$id)) + 34 xlim(min(comb_pbsc$id), max(comb_pbsc$id)) +
39 ylim(0, 100) + 35 ylim(0, 100) +
40 xlab('Position in read (bp)') + 36 xlab('Position in read (bp)') +
41 ylab('') 37 ylab('') +
38 scale_color_discrete(name = '') +
39 theme_classic()
42 ggplotly(p) 40 ggplotly(p)
43 ``` 41 ```