diff 02_per_base_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
line wrap: on
line diff
--- a/02_per_base_sequence_quality.Rmd	Tue Feb 27 10:40:20 2018 -0500
+++ b/02_per_base_sequence_quality.Rmd	Sun Dec 30 12:48:14 2018 -0500
@@ -3,28 +3,11 @@
 ---
 
 ```{r setup, include=FALSE, warning=FALSE, message=FALSE}
-knitr::opts_chunk$set(
-  echo = as.logical(opt$X_e),
-  error = TRUE,
-  eval = TRUE
-)
+knitr::opts_knit$set(progress = FALSE)
+knitr::opts_chunk$set(error = TRUE, echo = FALSE)
 ```
 
-
-```{r 'function definition', echo=FALSE}
-# Define a function to extract outputs for each module from fastqc output
-extract_data_module = function(fastqc_data, module_name, header = TRUE, comment.char = "") {
-  f = readLines(fastqc_data)
-  start_line = grep(module_name, f)
-  end_module_lines = grep('END_MODULE', f)
-  end_line = end_module_lines[which(end_module_lines > start_line)[1]]
-  module_data = f[(start_line+1):(end_line-1)]
-  writeLines(module_data, '/tmp/temp.txt')
-  read.csv('/tmp/temp.txt', sep = '\t', header = header, comment.char = comment.char)
-}
-```
-
-# Per base sequence quality
+### Per base sequence quality
 
 ```{r 'per base sequence quality', fig.width=10}
 ## reads 1
@@ -50,13 +33,14 @@
                              fill = "yellow"),
                stat = 'identity') +
   geom_line(mapping = aes(x = id, y = Mean, color = "red")) +
-  scale_x_continuous(breaks = pbsq_2$id, labels = pbsq_2$X.Base) +
+  scale_x_continuous(name = 'Position in read (bp)', breaks = pbsq_2$id, labels = pbsq_2$X.Base) +
+  scale_y_continuous(limits = c(0, max(comb_pbsq$Upper.Quartile) + 5)) +
   scale_fill_identity() +
   scale_color_identity() + 
-  ylim(0, max(comb_pbsq$Upper.Quartile) + 5) +
-  xlab('Position in read (bp)') +
   facet_grid(. ~ trim) +
-  theme(axis.text.x = element_text(angle=45))
+  theme(axis.text.x = element_text(size = 5),
+        panel.background = element_rect(fill = NA),
+        panel.grid.major.y = element_line(color = 'blue', size = 0.1))
 p
+```
 
-```