Mercurial > repos > mingchen0919 > aurora_fastqc_site
comparison 03_per_tile_sequence_quality.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 # Per tile sequence quality | 10 ### Per tile sequence quality |
| 14 | 11 |
| 15 ```{r 'per tile sequence quality', fig.width=10} | 12 ```{r 'per tile sequence quality', fig.width=10} |
| 16 ## check if 'per tile sequence quality' module exits or not | 13 ## check if 'per tile sequence quality' module exits or not |
| 17 check_ptsq = grep('Per tile sequence quality', readLines(paste0(opt$X_d, '/read_1_fastqc/fastqc_data.txt'))) | 14 check_ptsq = grep('Per tile sequence quality', readLines(paste0(opt$X_d, '/read_1_fastqc/fastqc_data.txt'))) |
| 18 if (length(check_ptsq) > 0) { | 15 if (length(check_ptsq) > 0) { |
| 27 comb_ptsq = rbind(ptsq_1, ptsq_2) | 24 comb_ptsq = rbind(ptsq_1, ptsq_2) |
| 28 comb_ptsq$trim = factor(levels = c('before', 'after'), comb_ptsq$trim) | 25 comb_ptsq$trim = factor(levels = c('before', 'after'), comb_ptsq$trim) |
| 29 comb_ptsq$Base = factor(levels = unique(comb_ptsq$Base), comb_ptsq$Base) | 26 comb_ptsq$Base = factor(levels = unique(comb_ptsq$Base), comb_ptsq$Base) |
| 30 | 27 |
| 31 # convert integers to charaters | 28 # convert integers to charaters |
| 32 comb_ptsq$Tile = as.character(comb_ptsq$X.Tile) | 29 # comb_ptsq$Tile = as.character(comb_ptsq$X.Tile) |
| 33 | 30 |
| 34 p = ggplot(data = comb_ptsq, aes(x = Base, y = Tile, fill = Mean)) + | 31 p = ggplot(data = comb_ptsq) + |
| 35 geom_raster() + | 32 geom_raster(mapping = aes(x = Base, y = X.Tile, fill = Mean)) + |
| 36 facet_grid(. ~ trim) + | 33 facet_grid(. ~ trim) + |
| 37 xlab('Position in read (bp)') + | 34 scale_x_discrete(name = "Position in read (bp)") + |
| 38 ylab('') + | 35 scale_y_continuous(name = "") + |
| 39 theme(axis.text.x = element_text(angle=45)) | 36 scale_fill_gradient(low = "blue", high = "red") + |
| 37 theme(axis.text.x = element_text(size = 5, angle = 90), | |
| 38 axis.text.y = element_text(size = 5), | |
| 39 panel.background = element_rect(fill = NA)) | |
| 40 ggplotly(p) | 40 ggplotly(p) |
| 41 } else { | 41 } else { |
| 42 print('No "per tile sequence quality" data') | 42 print('No "per tile sequence quality" data') |
| 43 } | 43 } |
| 44 ``` | 44 ``` |
