Mercurial > repos > mingchen0919 > aurora_fastqc_site
comparison 10_adapter_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 # Adapter Content | |
14 | |
15 ```{r 'Adapter Content', fig.width=10} | |
16 ## reads 1 | |
17 ac_1 = extract_data_module(paste0(opt$X_d, '/read_1_fastqc/fastqc_data.txt'), 'Adapter Content') | |
18 ac_1$id = 1:length(ac_1$X.Position) | |
19 | |
20 melt_ac_1 = melt(ac_1, id=c('X.Position', 'id')) | |
21 melt_ac_1$trim = 'before' | |
22 | |
23 ## reads 2 | |
24 ac_2 = extract_data_module(paste0(opt$X_d, '/read_2_fastqc/fastqc_data.txt'), 'Adapter Content') | |
25 ac_2$id = 1:length(ac_2$X.Position) | |
26 | |
27 melt_ac_2 = melt(ac_2, id=c('X.Position', 'id')) | |
28 melt_ac_2$trim = 'after' | |
29 | |
30 comb_ac = rbind(melt_ac_1, melt_ac_2) | |
31 comb_ac$trim = factor(levels = c('before', 'after'), comb_ac$trim) | |
32 | |
33 p = ggplot(data = comb_ac, aes(x = id, y = value, color = variable)) + | |
34 geom_line() + | |
35 facet_grid(. ~ trim) + | |
36 xlim(min(comb_ac$id), max(comb_ac$id)) + | |
37 ylim(0, 1) + | |
38 xlab('Position in read (bp)') + | |
39 ylab('') | |
40 ggplotly(p) | |
41 ``` |