comparison elastic_tool_render.R @ 1:16e0f4b7a286 draft

planemo upload commit d255df0b70677f4d5e5f2f8e240ce0b69f40d69d
author mingchen0919
date Mon, 26 Mar 2018 18:40:39 -0400
parents a163532ab267
children
comparison
equal deleted inserted replaced
0:a163532ab267 1:16e0f4b7a286
13 13
14 #------------------------------------------------ 14 #------------------------------------------------
15 options_and_arguments = read.table(paste0(Sys.getenv('REPORT_FILES_PATH'), '/options_and_arguments.txt'), 15 options_and_arguments = read.table(paste0(Sys.getenv('REPORT_FILES_PATH'), '/options_and_arguments.txt'),
16 sep = '|', header = TRUE) 16 sep = '|', header = TRUE)
17 17
18 18 #------------------------------------------------
19 # create three folders within working directory
20 dir.create('list')
21 dir.create('paired')
22 dir.create('list_paired')
23 print(Sys.getenv('JOB_WORKING_DIR'))
19 #-----------------render Rmd-------------- 24 #-----------------render Rmd--------------
20 render(paste0(Sys.getenv('TOOL_INSTALL_DIR'), '/elastic_tool.Rmd'), 25 # copy R markdown file to working directory and render it within the working directory.
26 render(paste0(Sys.getenv('TOOL_INSTALL_DIR'), '/elastic_tool.Rmd'),
21 output_file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/report.html')) 27 output_file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/report.html'))
22 28
23 # for some unknow reason, directly using REPORT as the input value for output_file parameter 29 # for some unknow reason, directly using REPORT as the input value for output_file parameter
24 # in the render function can cause empty report file when the tool runs in batch mode. 30 # in the render function can cause empty report file when the tool runs in batch mode.
25 # the solution is to render the rmarkdown to a explicitly specified file and then copy the 31 # the solution is to render the rmarkdown to a explicitly specified file and then copy the
26 # file to ${REPORT} 32 # file to ${REPORT}
27 system(command = 'cp ${REPORT_FILES_PATH}/report.html ${REPORT}') 33 system(command = 'cp ${REPORT_FILES_PATH}/report.html ${REPORT}')
34 system(command = 'sh ${REPORT_FILES_PATH}/script.sh')
28 #------------------------------------------ 35 #------------------------------------------
29 36
30 37
31 ##--------end of code rendering .Rmd templates---------------- 38 ##--------end of code rendering .Rmd templates----------------
32 sink() 39 sink()