|
3
|
1 ---
|
|
|
2 title: 'Expose data (paired)'
|
|
|
3 output: html_document
|
|
|
4 ---
|
|
|
5
|
|
|
6 <style>
|
|
|
7 pre code, pre, code {
|
|
|
8 white-space: pre !important;
|
|
|
9 overflow-x: scroll !important;
|
|
|
10 word-break: keep-all !important;
|
|
|
11 word-wrap: initial !important;
|
|
|
12 }
|
|
|
13 </style>
|
|
|
14
|
|
|
15 ```{r setup, include=FALSE, warning=FALSE, message=FALSE}
|
|
|
16 knitr::opts_chunk$set(error = TRUE)
|
|
|
17 ```
|
|
|
18
|
|
|
19 ## User input
|
|
|
20
|
|
|
21 ```{r, echo=FALSE, eval=TRUE}
|
|
|
22 ##-------- build script files -----------
|
|
|
23
|
|
|
24 # build script file: script.sh
|
|
|
25 df = read.table(paste0(Sys.getenv('REPORT_FILES_PATH'), '/options_and_arguments.txt'),
|
|
|
26 sep = '|', header = TRUE)
|
|
|
27
|
|
|
28
|
|
|
29 knitr::kable(df)
|
|
|
30 ```
|
|
|
31
|
|
|
32 ```{r, echo=FALSE}
|
|
|
33 # write('', file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/script.sh'))
|
|
|
34 if (nrow(df) > 0) {
|
|
|
35 for (i in 1:nrow(df)) {
|
|
|
36 tool_output_dir = readLines(df[i, 'tool_output_dir'])[1]
|
|
|
37 full_path = paste0(tool_output_dir, '/', df[i, 'relative_path'])
|
|
|
38 if (dir.exists(full_path)) {
|
|
|
39 from_files = list.files(full_path, full.names = TRUE)
|
|
|
40 to_files = paste0(Sys.getenv('individual_outputs/'), list.files(full_path))
|
|
|
41 file.copy(from = from_files, to = to_files)
|
|
|
42 }
|
|
|
43 if (file.exists(full_path)) {
|
|
|
44 file.copy(from = full_path, to = paste0(Sys.getenv('individual_outputs/'), df[i, 'relative_path']))
|
|
|
45 }
|
|
|
46 # command_line = paste0('cp -r ', full_path, ' paired')
|
|
|
47 # write(command_line, append = TRUE,
|
|
|
48 # file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/script.sh'))
|
|
|
49 }
|
|
|
50 }
|
|
|
51 ```
|
|
|
52
|
|
|
53
|