comparison 10_adapter_content.Rmd @ 11:507eec497730 draft

update fastqc site
author mingchen0919
date Tue, 07 Nov 2017 16:52:24 -0500
parents
children
comparison
equal deleted inserted replaced
10:600c39b11913 11:507eec497730
1 ---
2 title: 'Adapter Content'
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 ### Adapter Content
19
20 ```{r 'Adapter Content', fig.width=10}
21 ## reads 1
22 ac_1 = extract_data_module('REPORT_DIR/reads_1_fastqc_data.txt', 'Adapter Content')
23 ac_1$id = 1:length(ac_1$X.Position)
24
25 melt_ac_1 = melt(ac_1, id=c('X.Position', 'id'))
26 melt_ac_1$trim = 'before'
27
28 ## reads 2
29 ac_2 = extract_data_module('REPORT_DIR/reads_2_fastqc_data.txt', 'Adapter Content')
30 ac_2$id = 1:length(ac_2$X.Position)
31
32 melt_ac_2 = melt(ac_2, id=c('X.Position', 'id'))
33 melt_ac_2$trim = 'after'
34
35 comb_ac = rbind(melt_ac_1, melt_ac_2)
36 comb_ac$trim = factor(levels = c('before', 'after'), comb_ac$trim)
37
38 p = ggplot(data = comb_ac, aes(x = id, y = value, color = variable)) +
39 geom_line() +
40 facet_grid(. ~ trim) +
41 xlim(min(comb_ac$id), max(comb_ac$id)) +
42 ylim(0, 1) +
43 xlab('Position in read (bp)') +
44 ylab('')
45 ggplotly(p)
46 ```