comparison 05_per_base_sequence_content.Rmd @ 0:b7c115edd970 draft

planemo upload
author mingchen0919
date Tue, 27 Feb 2018 10:37:12 -0500
parents
children c64267b9f754
comparison
equal deleted inserted replaced
-1:000000000000 0:b7c115edd970
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
14 # Per base sequence content
15
16 ```{r 'Per base sequence content', fig.width=10}
17 ## reads 1
18 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)
20
21 melt_pbsc_1 = melt(pbsc_1, id=c('X.Base', 'id'))
22 melt_pbsc_1$trim = 'before'
23
24
25 ## reads 2
26 pbsc_2 = extract_data_module(paste0(opt$X_d, '/read_2_fastqc/fastqc_data.txt'), 'Per base sequence content')
27 pbsc_2$id = 1:length(pbsc_2$X.Base)
28
29 melt_pbsc_2 = melt(pbsc_2, id=c('X.Base', 'id'))
30 melt_pbsc_2$trim = 'after'
31
32 comb_pbsc = rbind(melt_pbsc_1, melt_pbsc_2)
33 comb_pbsc$trim = factor(levels = c('before', 'after'), comb_pbsc$trim)
34
35 p = ggplot(data = comb_pbsc, aes(x = id, y = value, color = variable)) +
36 geom_line() +
37 facet_grid(. ~ trim) +
38 xlim(min(comb_pbsc$id), max(comb_pbsc$id)) +
39 ylim(0, 100) +
40 xlab('Position in read (bp)') +
41 ylab('')
42 ggplotly(p)
43 ```