changeset 4:9ff33a3631fa draft

planemo upload commit 979e0f1c28c74ca7df02ef20c2208e9677bc820a-dirty
author mingchen0919
date Mon, 02 Apr 2018 08:32:59 -0400
parents 5838300fc1aa
children 4f9f1e76f7e6
files elastic_expose_individuals.xml elastic_expose_to_list_collection.xml elastic_expose_to_list_paired_collection.xml individuals.Rmd individuals_render.R
diffstat 5 files changed, 17 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/elastic_expose_individuals.xml	Mon Apr 02 00:32:04 2018 -0400
+++ b/elastic_expose_individuals.xml	Mon Apr 02 08:32:59 2018 -0400
@@ -51,7 +51,7 @@
 
 
         ############ run render R script to render R markdowns
-        Rscript '${__tool_directory__}/paired_render.R'
+        Rscript '${__tool_directory__}/individuals_render.R'
 
         ]]></command>
   <inputs>
@@ -61,11 +61,10 @@
     </repeat>
   </inputs>
   <outputs>
-    <data format="html" name="report" label="${tool.name} report"/>
-    <data format="txt" name="tool_log" label="${tool.name} log"/>
-    <data name="individual_outputs">
+    <data format="html" name="report" label="${tool.name} report ${on_string}">
       <discover_datasets pattern="__designation_and_ext__" directory="individual_outputs" visible="true"/>
     </data>
+    <data format="txt" name="tool_log" label="${tool.name} log ${on_string}"/>
   </outputs>
   <citations>
     <expand macro="citations"/>
--- a/elastic_expose_to_list_collection.xml	Mon Apr 02 00:32:04 2018 -0400
+++ b/elastic_expose_to_list_collection.xml	Mon Apr 02 08:32:59 2018 -0400
@@ -61,8 +61,8 @@
     </repeat>
   </inputs>
   <outputs>
-    <data format="html" name="report" label="${tool.name} report"/>
-    <data format="txt" name="tool_log" label="${tool.name} log"/>
+    <data format="html" name="report" label="${tool.name} report ${on_string}"/>
+    <data format="txt" name="tool_log" label="${tool.name} log ${on_string}"/>
     <collection type="list" name="list_collection">
       <discover_datasets pattern="__name_and_ext__" directory="list" />
     </collection>
--- a/elastic_expose_to_list_paired_collection.xml	Mon Apr 02 00:32:04 2018 -0400
+++ b/elastic_expose_to_list_paired_collection.xml	Mon Apr 02 08:32:59 2018 -0400
@@ -61,8 +61,8 @@
     </repeat>
   </inputs>
   <outputs>
-    <data format="html" name="report" label="${tool.name} report"/>
-    <data format="txt" name="tool_log" label="${tool.name} log"/>
+    <data format="html" name="report" label="${tool.name} report ${on_string}"/>
+    <data format="txt" name="tool_log" label="${tool.name} log ${on_string}"/>
     <collection type="list:paired" name="list_paired_collection">
       <discover_datasets pattern="(?P&lt;identifier_0&gt;[^_]+)_(?P&lt;identifier_1&gt;[^_]+)\.(?P&lt;ext&gt;[^\._]+)?" directory="list_paired"/>
     </collection>
--- a/individuals.Rmd	Mon Apr 02 00:32:04 2018 -0400
+++ b/individuals.Rmd	Mon Apr 02 08:32:59 2018 -0400
@@ -37,11 +37,15 @@
     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))
+      to_files = list.files(full_path)
+      to_files = paste0(individual_outputs_path, to_files)
       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']))
+      # to_files = list.files(full_path)
+      to_file = tail(strsplit(full_path, '/')[[1]], 1)
+      print(to_file)
+      file.copy(from = full_path, to = paste0(individual_outputs_path, to_file))
     }
     # command_line = paste0('cp -r ', full_path, ' paired')
     # write(command_line, append = TRUE, 
--- a/individuals_render.R	Mon Apr 02 00:32:04 2018 -0400
+++ b/individuals_render.R	Mon Apr 02 08:32:59 2018 -0400
@@ -19,9 +19,12 @@
 # create three folders within working directory
 dir.create('individual_outputs')
 
+job_working_dir = getwd()
+individual_outputs_path = paste0(job_working_dir, '/individual_outputs/')
+
 #-----------------render Rmd--------------
 # copy R markdown file to working directory and render it within the working directory.
-render(paste0(Sys.getenv('TOOL_INSTALL_DIR'), '/paired.Rmd'),
+render(paste0(Sys.getenv('TOOL_INSTALL_DIR'), '/individuals.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