view elastic_expose_to_list_collection.xml @ 4:9ff33a3631fa draft

planemo upload commit 979e0f1c28c74ca7df02ef20c2208e9677bc820a-dirty
author mingchen0919
date Mon, 02 Apr 2018 08:32:59 -0400
parents 5838300fc1aa
children
line wrap: on
line source

<?xml version="1.0" encoding="UTF-8"?>
<tool id="elastic_expose_to_list_collection" name="expose data (list)" version="1.0.1">
  <macros>
    <import>elastic_tool_wrappers_macros.xml</import>
  </macros>
  <description/>
  <requirements>
    <expand macro="rmarkdown_requirements"/>
  </requirements>
  <expand macro="stdio"/>
  <command><![CDATA[

        ############ first, create a directory to store all files
        mkdir -p $report.files_path &&


        ############ save the tool installation directory to an environment variable
        export TOOL_INSTALL_DIR='${__tool_directory__}' &&


        #########################
        ##
        ## save user input option/argument pairs into a file
        ##
        #########################

        ## first line will be the header
        echo 'tool_output_dir|relative_path' > '$report.files_path/options_and_arguments.txt' &&



        ####################################################
        ## loop through repeats to get option/argument pairs
        ####################################################


        ############ option_argument_path_relative_to_a_tool
        #for i in $option_argument_path_relative_to_a_tool_repeat:
             #set $item = str($i.a_tool_output_dir) + "|" + str($i.value)
             echo '$item' >> '$report.files_path/options_and_arguments.txt' &&
        #end for


        ############ output_set
        ## '$report'
        ## '$report.files_path'
        #######################
        export REPORT='$report' &&
        export TOOL_LOG='$tool_log' &&
        export REPORT_FILES_PATH='$report.files_path' &&


        ############ run render R script to render R markdowns
        Rscript '${__tool_directory__}/list_render.R'

        ]]></command>
  <inputs>
    <repeat name="option_argument_path_relative_to_a_tool_repeat" title="INPUT DATA PATH: relative to a tool output directory" min="0" default="0">
      <param name="a_tool_output_dir" type="data" optional="false" multiple="false" label="a tool output directory"/>
      <param type="text" name="value" optional="true" label="relative path"/>
    </repeat>
  </inputs>
  <outputs>
    <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>
  </outputs>
  <citations>
    <expand macro="citations"/>
  </citations>
</tool>