Mercurial > repos > mingchen0919 > rmarkdown_collection_builder
annotate collection_paired_render.R @ 53:0d86b36606d3 draft
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 88ca36a41aa577ba888cee39cf81b176bf7e68db-dirty
| author | mingchen0919 | 
|---|---|
| date | Tue, 26 Sep 2017 15:19:50 -0400 | 
| parents | 2556fed6c3c7 | 
| children | 
| rev | line source | 
|---|---|
| 
51
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
1 ##======= Handle arguments from command line ======== | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
2 # setup R error handline to go to stderr | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
3 options(show.error.messages=FALSE, | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
4 error=function(){ | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
5 cat(geterrmessage(), file=stderr()) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
6 quit("no", 1, F) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
7 }) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
8 | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
9 # we need that to not crash galaxy with an UTF8 error on German LC settings. | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
10 loc = Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
11 | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
12 # suppress warning | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
13 options(warn = -1) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
14 | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
15 options(stringsAsFactors=FALSE, useFancyQuotes=FALSE) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
16 args = commandArgs(trailingOnly=TRUE) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
17 | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
18 suppressPackageStartupMessages({ | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
19 library(getopt) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
20 library(tools) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
21 }) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
22 | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
23 # column 1: the long flag name | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
24 # column 2: the short flag alias. A SINGLE character string | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
25 # column 3: argument mask | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
26 # 0: no argument | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
27 # 1: argument required | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
28 # 2: argument is optional | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
29 # column 4: date type to which the flag's argument shall be cast. | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
30 # possible values: logical, integer, double, complex, character. | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
31 ##------- 1. input data --------------------- | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
32 spec_list=list() | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
33 spec_list$FORWARD_INPUT = c('forward_input', 'L', '1', 'character') | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
34 spec_list$REVERSE_INPUT = c('reverse_input', 'R', '1', 'character') | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
35 spec_list$ECHO = c('echo', 'e', '1', 'character') | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
36 spec_list$FORMAT = c('format', 'f', '1', 'character') | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
37 ##--------2. output report and outputs -------------- | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
38 spec_list$OUTPUT_HTML = c('paired_collection_html', 'r', '1', 'character') | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
39 spec_list$OUTPUT_DIR = c('paired_collection_dir', 'd', '1', 'character') | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
40 ##--------3. Rmd templates in the tool directory ---------- | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
41 spec_list$PAIRED_COLLECTION_RMD = c('paired_collection_rmd', 't', '1', 'character') | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
42 | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
43 spec = t(as.data.frame(spec_list)) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
44 opt = getopt(spec) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
45 ##====== End of arguments handling ========== | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
46 | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
47 #------ Load libraries --------- | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
48 library(rmarkdown) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
49 library(htmltools) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
50 library(dplyr) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
51 | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
52 #----- 1. create the report directory ------------------------ | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
53 system(paste0('mkdir -p ', opt$paired_collection_dir)) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
54 | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
55 #----- 2. generate Rmd files with Rmd templates -------------- | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
56 # a. templates without placeholder variables: | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
57 # copy templates from tool directory to the working directory. | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
58 # b. templates with placeholder variables: | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
59 # substitute variables with user input values and place them in the working directory. | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
60 | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
61 #----- 01 paired_collection.Rmd ----------------------- | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
62 readLines(opt$paired_collection_rmd) %>% | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
63 (function(x) { | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
64 gsub('ECHO', opt$echo, x) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
65 }) %>% | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
66 (function(x) { | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
67 gsub('FORMAT', opt$format, x) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
68 }) %>% | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
69 (function(x) { | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
70 gsub('FORWARD_INPUT', opt$forward_input, x) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
71 }) %>% | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
72 (function(x) { | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
73 gsub('REVERSE_INPUT', opt$reverse_input, x) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
74 }) %>% | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
75 (function(x) { | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
76 gsub('OUTPUT_DIR', opt$paired_collection_dir, x) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
77 }) %>% | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
78 (function(x) { | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
79 fileConn = file('paired_collection.Rmd') | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
80 writeLines(x, con=fileConn) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
81 close(fileConn) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
82 }) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
83 | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
84 #------ 3. render all Rmd files -------- | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
85 render('paired_collection.Rmd', output_file = opt$paired_collection_html) | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
86 | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
87 | 
| 
 
2556fed6c3c7
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit b33359f9f0ca5bb3227050b4b586a9969c7e20ad-dirty
 
mingchen0919 
parents:  
diff
changeset
 | 
88 #-------4. manipulate outputs ----------------------------- | 
