Mercurial > repos > mingchen0919 > elastic_expose_data
comparison list_paired.Rmd @ 6:52ecc1cfd205 draft
planemo upload commit 979e0f1c28c74ca7df02ef20c2208e9677bc820a-dirty
author | mingchen0919 |
---|---|
date | Mon, 02 Apr 2018 10:21:30 -0400 |
parents | 4f9f1e76f7e6 |
children |
comparison
equal
deleted
inserted
replaced
5:4f9f1e76f7e6 | 6:52ecc1cfd205 |
---|---|
28 | 28 |
29 knitr::kable(df) | 29 knitr::kable(df) |
30 ``` | 30 ``` |
31 | 31 |
32 ```{r, echo=FALSE} | 32 ```{r, echo=FALSE} |
33 # write('', file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/script.sh')) | 33 write('', file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/script.sh')) |
34 if (nrow(df) > 0) { | 34 if (nrow(df) > 0) { |
35 for (i in 1:nrow(df)) { | 35 for (i in 1:nrow(df)) { |
36 tool_output_dir = readLines(df[i, 'tool_output_dir'])[1] | 36 tool_output_dir = readLines(df[i, 'tool_output_dir'])[1] |
37 full_path = paste0(tool_output_dir, '/', df[i, 'relative_path']) | 37 full_path = paste0(tool_output_dir, '/', df[i, 'relative_path']) |
38 # if it is a directory path, add '/*' to the end. | |
38 if (dir.exists(full_path)) { | 39 if (dir.exists(full_path)) { |
39 from_files = list.files(full_path, full.names = TRUE) | 40 full_path = paste0(full_path, '/*') |
40 to_files = list.files(full_path) | |
41 to_files = paste0(list_paired_path, to_files) | |
42 file.copy(from = from_files, to = to_files) | |
43 } | 41 } |
44 if (file.exists(full_path)) { | 42 command_line = paste0('cp -r ', full_path, ' list_paired') |
45 # to_files = list.files(full_path) | 43 write(command_line, append = TRUE, |
46 to_file = tail(strsplit(full_path, '/')[[1]], 1) | 44 file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/script.sh')) |
47 file.copy(from = full_path, to = paste0(list_paired_path, to_file)) | |
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 } | 45 } |
53 } | 46 } |
54 ``` | 47 ``` |
55 | 48 |
56 | 49 |