annotate fastq_dump_pe_render.R @ 11:d4a9c31d0046 draft

planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
author mingchen0919
date Wed, 27 Sep 2017 16:43:52 -0400
parents 7ec600e7dba7
children 66bc1016ec2a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
1 ##======= Handle arguments from command line ========
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
2 # setup R error handline to go to stderr
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
3 options(show.error.messages=FALSE,
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
4 error=function(){
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
5 cat(geterrmessage(), file=stderr())
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
6 quit("no", 1, F)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
7 })
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
8
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
9 # we need that to not crash galaxy with an UTF8 error on German LC settings.
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
10 loc = Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
11
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
12 # suppress warning
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
13 options(warn = -1)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
14
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
15 options(stringsAsFactors=FALSE, useFancyQuotes=FALSE)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
16 args = commandArgs(trailingOnly=TRUE)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
17
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
18 suppressPackageStartupMessages({
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
19 library(getopt)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
20 library(tools)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
21 })
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
22
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
23 #/////////////////////// SINK WARNINGS AND ERRORS TO A FILE FOR DEBUGGING ///////////
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
24 zz = file('warnings_and_errors.txt')
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
25 sink(zz)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
26 sink(zz, type = 'message')
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
27
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
28 # column 1: the long flag name
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
29 # column 2: the short flag alias. A SINGLE character string
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
30 # column 3: argument mask
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
31 # 0: no argument
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
32 # 1: argument required
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
33 # 2: argument is optional
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
34 # column 4: date type to which the flag's argument shall be cast.
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
35 # possible values: logical, integer, double, complex, character.
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
36 ##------- 1. input data ---------------------
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
37 spec_list=list()
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
38 spec_list$SRA_ACCESSION = c('sra_accession', 'i', '1', 'character')
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
39 spec_list$FORMAT = c('format', 'f', '1', 'character')
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
40 spec_list$ECHO = c('echo', 'e', '1', 'character')
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
41 spec_list$SPLIT_FILES = c('split_files', 'p', '1', 'character')
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
42 ##--------2. output report and outputs --------------
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
43 spec_list$REPORT_HTML = c('report_html', 'r', '1', 'character')
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
44 spec_list$OUTPUT_DIR = c('output_dir', 'd', '1', 'character')
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
45 spec_list$SINK_OUTPUT = c('sink_output', 's', '1', 'character')
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
46 ##--------3. Rmd templates in the tool directory ----------
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
47 spec_list$FASTQ_DUMP_SE_RMD = c('fastq_dump_pe_rmd', 't', '1', 'character')
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
48
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
49 spec = t(as.data.frame(spec_list))
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
50 opt = getopt(spec)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
51
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
52 #------ Load libraries ---------
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
53 library(rmarkdown)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
54 library(htmltools)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
55 library(dplyr)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
56
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
57 #----- 1. create the report directory ------------------------
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
58 system(paste0('mkdir -p ', opt$output_dir))
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
59
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
60 #----- 2. generate Rmd files with Rmd templates --------------
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
61 # a. templates without placeholder variables:
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
62 # copy templates from tool directory to the working directory.
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
63 # b. templates with placeholder variables:
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
64 # substitute variables with user input values and place them in the working directory.
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
65
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
66 #----- 01 fastq_dump_pe.Rmd -----------------------
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
67 readLines(opt$fastq_dump_pe_rmd) %>%
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
68 (function(x) {
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
69 gsub('SRA_ACCESSION', opt$sra_accession, x)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
70 }) %>%
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
71 (function(x) {
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
72 gsub('FORMAT', opt$format, x)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
73 }) %>%
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
74 (function(x) {
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
75 gsub('ECHO', opt$echo, x)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
76 }) %>%
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
77 (function(x) {
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
78 gsub('SPLIT_FILES', opt$split_files, x)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
79 }) %>%
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
80 (function(x) {
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
81 gsub('OUTPUT_DIR', opt$output_dir, x)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
82 }) %>%
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
83 (function(x) {
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
84 fileConn = file('fastq_dump_pe.Rmd')
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
85 writeLines(x, con=fileConn)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
86 close(fileConn)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
87 })
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
88
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
89 #------ 3. render all Rmd files --------
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
90 render('fastq_dump_pe.Rmd', output_file = opt$report_html)
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
91
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
92
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
93 #-------4. manipulate outputs -----------------------------
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
94
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
95
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
96
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
97
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
98
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
99 sink()
d4a9c31d0046 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_fastq_dump commit affb362adeb095389646b0c51738d24c2de3838d-dirty
mingchen0919
parents: 0
diff changeset
100 #/////////// END OF SINK OUTPUT ///////////////////////////