Mercurial > repos > mingchen0919 > elastic_expose_data
annotate individuals.Rmd @ 7:23cbb0daf18d draft default tip
planemo upload commit d1d9c6fc42729b4194adac13d1b71062bf19ad0b-dirty
author | mingchen0919 |
---|---|
date | Mon, 02 Apr 2018 10:53:05 -0400 |
parents | 4f9f1e76f7e6 |
children |
rev | line source |
---|---|
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) | |
4
9ff33a3631fa
planemo upload commit 979e0f1c28c74ca7df02ef20c2208e9677bc820a-dirty
mingchen0919
parents:
3
diff
changeset
|
40 to_files = list.files(full_path) |
9ff33a3631fa
planemo upload commit 979e0f1c28c74ca7df02ef20c2208e9677bc820a-dirty
mingchen0919
parents:
3
diff
changeset
|
41 to_files = paste0(individual_outputs_path, to_files) |
3 | 42 file.copy(from = from_files, to = to_files) |
43 } | |
44 if (file.exists(full_path)) { | |
4
9ff33a3631fa
planemo upload commit 979e0f1c28c74ca7df02ef20c2208e9677bc820a-dirty
mingchen0919
parents:
3
diff
changeset
|
45 # to_files = list.files(full_path) |
9ff33a3631fa
planemo upload commit 979e0f1c28c74ca7df02ef20c2208e9677bc820a-dirty
mingchen0919
parents:
3
diff
changeset
|
46 to_file = tail(strsplit(full_path, '/')[[1]], 1) |
9ff33a3631fa
planemo upload commit 979e0f1c28c74ca7df02ef20c2208e9677bc820a-dirty
mingchen0919
parents:
3
diff
changeset
|
47 file.copy(from = full_path, to = paste0(individual_outputs_path, to_file)) |
3 | 48 } |
49 # command_line = paste0('cp -r ', full_path, ' paired') | |
50 # write(command_line, append = TRUE, | |
51 # file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/script.sh')) | |
52 } | |
53 } | |
54 ``` | |
55 | |
56 |