Mercurial > repos > mingchen0919 > aurora_fastqc_site
comparison 09_sequence_duplication_levels.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 |
14 # Sequence Duplication Levels | 11 ### Sequence Duplication Levels |
15 | 12 |
16 ```{r 'Sequence Duplication Levels', fig.width=10} | 13 ```{r 'Sequence Duplication Levels', fig.width=10} |
17 ## reads 1 | 14 ## reads 1 |
18 sdl_1 = extract_data_module(paste0(opt$X_d, '/read_1_fastqc/fastqc_data.txt'), 'Sequence Duplication Levels', header = FALSE, comment.char = '#') | 15 sdl_1 = extract_data_module(paste0(opt$X_d, '/read_1_fastqc/fastqc_data.txt'), 'Sequence Duplication Levels', header = FALSE, comment.char = '#') |
19 names(sdl_1) = c('Duplication_Level', 'Percentage_of_deduplicated', 'Percentage_of_total') | 16 names(sdl_1) = c('Duplication_Level', 'Percentage_of_deduplicated', 'Percentage_of_total') |
32 melt_sdl_2$trim = 'after' | 29 melt_sdl_2$trim = 'after' |
33 | 30 |
34 comb_sdl = rbind(melt_sdl_1, melt_sdl_2) | 31 comb_sdl = rbind(melt_sdl_1, melt_sdl_2) |
35 comb_sdl$trim = factor(levels = c('before', 'after'), comb_sdl$trim) | 32 comb_sdl$trim = factor(levels = c('before', 'after'), comb_sdl$trim) |
36 | 33 |
37 p = ggplot(data = comb_sdl, aes(x = id, y = value, color = variable)) + | 34 p = ggplot(data = comb_sdl) + |
38 geom_line() + | 35 geom_line(mapping = aes(x = id, y = value, color = variable)) + |
39 scale_x_continuous(breaks = sdl_2$id, labels = sdl_2$Duplication_Level) + | 36 scale_x_continuous(breaks = sdl_2$id, labels = sdl_2$Duplication_Level) + |
40 facet_grid(. ~ trim) + | 37 facet_grid(. ~ trim) + |
41 xlab('Sequence Duplication Level') + | 38 xlab('Sequence Duplication Level') + |
42 ylab('') + | 39 ylab('') + |
43 theme(axis.text.x = element_text(angle=45)) | 40 scale_color_discrete(name = '') + |
44 ggplotly(p) | 41 theme(axis.text.x = element_text(size = 5), |
42 panel.background = element_rect(fill = NA), | |
43 axis.line = element_line()) | |
44 p | |
45 ``` | 45 ``` |