Mercurial > repos > mingchen0919 > elastic_expose_data
diff individuals.Rmd @ 3:5838300fc1aa draft
add expose individuals
author | mingchen0919 |
---|---|
date | Mon, 02 Apr 2018 00:32:04 -0400 |
parents | |
children | 9ff33a3631fa |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/individuals.Rmd Mon Apr 02 00:32:04 2018 -0400 @@ -0,0 +1,53 @@ +--- +title: 'Expose data (paired)' +output: html_document +--- + +<style> +pre code, pre, code { + white-space: pre !important; + overflow-x: scroll !important; + word-break: keep-all !important; + word-wrap: initial !important; +} +</style> + +```{r setup, include=FALSE, warning=FALSE, message=FALSE} +knitr::opts_chunk$set(error = TRUE) +``` + +## User input + +```{r, echo=FALSE, eval=TRUE} +##-------- build script files ----------- + +# build script file: script.sh +df = read.table(paste0(Sys.getenv('REPORT_FILES_PATH'), '/options_and_arguments.txt'), + sep = '|', header = TRUE) + + +knitr::kable(df) +``` + +```{r, echo=FALSE} +# write('', file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/script.sh')) +if (nrow(df) > 0) { + for (i in 1:nrow(df)) { + tool_output_dir = readLines(df[i, 'tool_output_dir'])[1] + full_path = paste0(tool_output_dir, '/', df[i, 'relative_path']) + if (dir.exists(full_path)) { + from_files = list.files(full_path, full.names = TRUE) + to_files = paste0(Sys.getenv('individual_outputs/'), list.files(full_path)) + file.copy(from = from_files, to = to_files) + } + if (file.exists(full_path)) { + file.copy(from = full_path, to = paste0(Sys.getenv('individual_outputs/'), df[i, 'relative_path'])) + } + # command_line = paste0('cp -r ', full_path, ' paired') + # write(command_line, append = TRUE, + # file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/script.sh')) + } +} +``` + +