diff fastqc_report.Rmd @ 15:d1d20f341632 draft

fastqc_report v2.0.0
author mingchen0919
date Thu, 19 Oct 2017 00:11:14 -0400
parents 2efa46ce2c4c
children 1710b0e874f1
line wrap: on
line diff
--- a/fastqc_report.Rmd	Wed Oct 18 22:06:39 2017 -0400
+++ b/fastqc_report.Rmd	Thu Oct 19 00:11:14 2017 -0400
@@ -1,5 +1,5 @@
 ---
-title: 'HTML report title'
+title: 'Short reads evaluation with [FastQC](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/)'
 output:
     html_document:
       number_sections: true
@@ -35,18 +35,47 @@
 done
 ```
 
-* Create links to original HTML reports
+## Evaluation results
 
 ```{r 'html report links'}
-html_report_list = list()
-html_files = list.files('REPORT_DIR', pattern = '.*html')
-for (i in html_files) {
-  html_report_list[[i]] = tags$li(tags$a(href=i, i))
-}
-tags$ul(html_report_list)
+html_file = list.files('REPORT_DIR', pattern = '.*html')
+tags$ul(tags$a(href=html_file, paste0('HTML report', opt$name)))
+```
+
+
+```{r 'extract fastqc_data.txt and summary.txt'}
+# list all zip files
+zip_file = list.files(path = 'REPORT_DIR', pattern = '.zip')
+unzip(paste0('REPORT_DIR/', zip_file), exdir = 'REPORT_DIR')
+
+unzip_directory = paste0(tail(strsplit(opt$reads, '/')[[1]], 1), '_fastqc/')
+fastqc_data_txt_path = paste0('REPORT_DIR/', unzip_directory, 'fastqc_data.txt')
+summary_txt_path = paste0('REPORT_DIR/', unzip_directory, 'summary.txt')
 ```
 
-# Fastqc output summary
+
+```{r 'summary.txt'}
+tags$ul(tags$a(href=paste0(unzip_directory, 'summary.txt'), 'summary.txt'))
+```
+
+
+```{r 'fastqc_data.txt'}
+tags$ul(tags$a(href=paste0(unzip_directory, 'fastqc_data.txt'), 'fastqc_data.txt'))
+```
+
+
+# Fastqc output visualization
+
+## Overview
+
+```{r}
+# read.table(fastqc_data_txt_path)
+summary_txt = read.csv(summary_txt_path, header = FALSE, sep = '\t')[, 2:1]
+names(summary_txt) = c('MODULE', 'PASS/FAIL')
+knitr::kable(summary_txt)
+```
+
+## Summary by module {.tabset}
 
 * Define a function to extract outputs for each module from fastqc output
 
@@ -62,7 +91,21 @@
 }
 ```
 
-## 
+### Per base sequence quality
+
+```{r}
+pbsq = extract_data_module(fastqc_data_txt_path, 'Per base sequence quality')
+knitr::kable(pbsq)
+```
+
+### Per tile sequence quality
+
+```{r}
+ptsq = extract_data_module(fastqc_data_txt_path, 'Per tile sequence quality')
+knitr::kable(ptsq)
+```
+
+
 
 # Session Info