# HG changeset patch # User mingchen0919 # Date 1522680785 14400 # Node ID 23cbb0daf18d8e8fed045acb25cf5eacd96cd22c # Parent 52ecc1cfd205a22e0627a441cbe49313924e21b5 planemo upload commit d1d9c6fc42729b4194adac13d1b71062bf19ad0b-dirty diff -r 52ecc1cfd205 -r 23cbb0daf18d list.Rmd --- a/list.Rmd Mon Apr 02 10:21:30 2018 -0400 +++ b/list.Rmd Mon Apr 02 10:53:05 2018 -0400 @@ -30,25 +30,18 @@ ``` ```{r, echo=FALSE} -# write('', file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/script.sh')) +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 it is a directory path, add '/*' to the end. if (dir.exists(full_path)) { - from_files = list.files(full_path, full.names = TRUE) - to_files = list.files(full_path) - to_files = paste0(list_path, to_files) - file.copy(from = from_files, to = to_files) + full_path = paste0(full_path, '/*') } - if (file.exists(full_path)) { - # to_files = list.files(full_path) - to_file = tail(strsplit(full_path, '/')[[1]], 1) - file.copy(from = full_path, to = paste0(list_path, to_file)) - } - # command_line = paste0('cp -r ', full_path, ' paired') - # write(command_line, append = TRUE, - # file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/script.sh')) + command_line = paste0('cp -r ', full_path, ' list') + write(command_line, append = TRUE, + file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/script.sh')) } } ``` diff -r 52ecc1cfd205 -r 23cbb0daf18d list_render.R --- a/list_render.R Mon Apr 02 10:21:30 2018 -0400 +++ b/list_render.R Mon Apr 02 10:53:05 2018 -0400 @@ -19,8 +19,8 @@ # create three folders within working directory dir.create('list') -job_working_dir = getwd() -list_path = paste0(job_working_dir, '/list/') +# job_working_dir = getwd() +# list_path = paste0(job_working_dir, '/list/') #-----------------render Rmd-------------- # copy R markdown file to working directory and render it within the working directory. @@ -32,7 +32,7 @@ # the solution is to render the rmarkdown to a explicitly specified file and then copy the # file to ${REPORT} system(command = 'cp ${REPORT_FILES_PATH}/report.html ${REPORT}') -# system(command = 'sh ${REPORT_FILES_PATH}/script.sh') +system(command = 'sh ${REPORT_FILES_PATH}/script.sh') #------------------------------------------