diff 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
line wrap: on
line diff
--- a/elastic_tool_render.R	Mon Mar 26 13:25:53 2018 -0400
+++ b/elastic_tool_render.R	Mon Mar 26 18:40:39 2018 -0400
@@ -15,9 +15,15 @@
 options_and_arguments = read.table(paste0(Sys.getenv('REPORT_FILES_PATH'), '/options_and_arguments.txt'), 
                                    sep = '|', header = TRUE)
 
-
+#------------------------------------------------
+# create three folders within working directory
+dir.create('list')
+dir.create('paired')
+dir.create('list_paired')
+print(Sys.getenv('JOB_WORKING_DIR'))
 #-----------------render Rmd--------------
-render(paste0(Sys.getenv('TOOL_INSTALL_DIR'), '/elastic_tool.Rmd'),
+# copy R markdown file to working directory and render it within the working directory.
+render(paste0(Sys.getenv('TOOL_INSTALL_DIR'), '/elastic_tool.Rmd'), 
        output_file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/report.html'))
 
 # for some unknow reason, directly using REPORT as the input value for output_file parameter
@@ -25,6 +31,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')
 #------------------------------------------