diff fastqc_report_render.R @ 16:1710b0e874f1 draft

fix file name issue
author mingchen0919
date Sat, 21 Oct 2017 09:25:49 -0400
parents d1d20f341632
children 8c79e5b7cfc0
line wrap: on
line diff
--- a/fastqc_report_render.R	Thu Oct 19 00:11:14 2017 -0400
+++ b/fastqc_report_render.R	Sat Oct 21 09:25:49 2017 -0400
@@ -9,6 +9,7 @@
 library(reshape2)
 library(plotly)
 library(formattable)
+options(stringsAsFactors=FALSE, useFancyQuotes=FALSE)
 
 ##============ Sink warnings and errors to a file ==============
 ## use the sink() function to wrap all code within it.
@@ -39,8 +40,12 @@
   args_list=list()
   ##------- 1. input data ---------------------
   args_list$ECHO = c('echo', 'e', '1', 'character')
-  args_list$READS = c('reads', 'r', '1', 'character')
-  args_list$NAMES = c('names', 'n', '1', 'character')
+  args_list$READS_1 = c('reads_1', 'r', '1', 'character')
+  args_list$NAME_1 = c('name_1', 'n', '1', 'character')
+  args_list$READS_2 = c('reads_2', 'R', '1', 'character')
+  args_list$NAME_2 = c('name_2', 'N', '1', 'character')
+  args_list$CONTAMINANTS = c('contaminants', 'c', '1', 'character')
+  args_list$LIMITS = c('limits', 'l', '1', 'character')
   ##--------2. output report and outputs --------------
   args_list$REPORT_HTML = c('report_html', 'o', '1', 'character')
   args_list$REPORT_DIR = c('report_dir', 'd', '1', 'character')
@@ -66,7 +71,22 @@
       gsub('ECHO', opt$echo, x)
     }) %>%
     (function(x) {
-      gsub('READS', opt$reads, x)
+      gsub('READS_1', opt$reads_1, x)
+    }) %>%
+    (function(x) {
+      gsub('NAME_1', opt$name_1, x)
+    }) %>%
+    (function(x) {
+      gsub('READS_2', opt$reads_2, x)
+    }) %>%
+    (function(x) {
+      gsub('NAME_2', opt$name_1, x)
+    }) %>%
+    (function(x) {
+      gsub('CONTAMINANTS', opt$contaminants, x)
+    }) %>%
+    (function(x) {
+      gsub('LIMITS', opt$limits, x)
     }) %>%
     (function(x) {
       gsub('REPORT_DIR', opt$report_dir, x)