view scriptrunner.xml @ 10:ed7cf3f35799 draft

planemo upload for repository https://github.com/mvdbeek/docker_scriptrunner/ commit d8d8e8e063698813c9eb646e0df7d93118fd0520
author mvdbeek
date Sat, 09 Jul 2016 07:12:40 -0400
parents b6211faea403
children 8571d1c719ee
line wrap: on
line source

<tool id="docker_scriptrunner" name="Docker Scriptrunner" version="0.1.6">
  <description>Makes scripts into tools using Docker</description>
  <macros>
    <import>macros.xml</import>
  </macros>
   <requirements>
      <requirement type="package" version="0.4.0">docker-py</requirement>
  </requirements>
  <command>
    python "$__tool_directory__/scriptrunner.py"
    --script_path "$runme"
    --interpreter "$interpreter"
    --user_email "$__user_email__"
    #if $generate_simple_output.make_TAB=="yes":
       --output_tab "$tab_file"
    #end if
    #if $make_HTML.value=="yes":
      --output_dir "$html_file.files_path" --output_html "$html_file" --make_HTML "yes"
    #else:
       --output_dir "."
    #end if
    #if $additional_parameters != 'None':
      #for i in $additional_parameters:
	--additional_parameters
        "$i.param_name, $i.param_value"
      #end for
    #end if
    #if $input_files != 'None':
       --input_tab 
	#for i in $input_files:
	  $i.input
	#end for
        #for i in $input_files:
          --input_format
          #if str($i.in_format) == "None":
            "Any"
          #else 
            "$i.in_format"
          #end if
        #end for
    #end if
    --docker_image "$docker_image" 
  </command>
<configfiles>
  <configfile name="runme">$dynScript</configfile>
</configfiles>
  <inputs>
    <repeat name="input_files" title="Select input files">
      <param name="input"  type="data"  label="Select an input file from your history" optional="true" size="120"
         help="Most scripts will need an input - your script MUST be ready for whatever format you choose"/>
      <param name="in_format" type="select" optional="true" multiple="true" label="Optional: Select the allowed input datatype(s) for your tool/script">
        <options from_parameter="tool.app.datatypes_registry.upload_file_formats">
          <column name="value" index="0"/>
        </options>
    </param>
    </repeat>
    <repeat name="additional_parameters" title="Set additional parameters">
      <param name="param_name" type="text" value="parameter_name" label="Choose a parameter name" size="20">
        <sanitizer invalid_char="">
          <valid initial="string.letters,string.digits"><add value="@_."/></valid>>
        </sanitizer>
      </param>
     <param name="param_value" type="text" value="parameter_value" label="Enter a parameter value" size="50">
       <sanitizer>
         <valid initial="string.printable">
         </valid>
         <mapping initial="none"/>
       </sanitizer>
     </param>
    </repeat> 
    <param name="make_HTML" type="select" label="Create an HTML report with links to all output files and thumbnail links to PDF images" size="60"
         help="Recommended for presenting complex outputs in an accessible manner. Turn off for simple tools so they just create one output">
        <option value="yes">Yes, arrange all outputs produced by my script as an HTML output</option>
        <option value="" selected="true">No, no HTML output file thanks</option>
    </param>
    <conditional name="generate_simple_output">
      <param name="make_TAB" type="select" label="Create a new history output alongside the HTML file specified above" 
           help="This is useful if your script creates a single new tabular file you want to appear in the history after the tool executes">
          <option value="yes" selected="true">My script writes to a new history output</option>
          <option value="">I do not want a new history output file</option>
      </param>
      <when value="yes">
        <param name="out_format" type="select" label="Select the datatype that your tool/script produces" help="If your datatype is not listed here, it has to be added in galaxy's datatypes_conf.xml">
          <options from_parameter="tool.app.datatypes_registry.upload_file_formats">
            <column name="value" index="0"/>
          </options>
        </param>
      </when>
      <when value="">
      </when>
    </conditional>
    <param name="interpreter" type="select" label="Select the interpreter for your code">
        <option value="Rscript" selected="true">Rscript</option>
        <option value="python">python</option>
        <option value="perl">perl</option>
        <option value="sh">sh</option>
    </param>   
    <param help="The script you are pasting will be run in this image. Make sure it contains the necessary tools" label="Select a docker image" name="docker_image" type="select">
        <options from_data_table="docker_scriptrunner_images"/>
    </param>
    <param name="dynScript" label="Copy and paste the script to be executed here" type="text" value="" area="True" size="8x120"  
      help="Script must deal with two command line parameters: Path to input tabular file path (or 'None' if none selected) and path to output tabular history file (or 'None').">
      <sanitizer>
         <valid initial="string.printable">
         </valid>
         <mapping initial="none"/>
      </sanitizer>
     </param>
  </inputs>
  <outputs>
    <data format_source="input" name="tab_file">
      <filter>generate_simple_output['make_TAB'] == "yes"</filter>
        <actions>
          <action type="format">
                <option type="from_param" name="generate_simple_output.out_format" />
          </action>
        </actions>
    </data>
    <data format="html" name="html_file" >
        <filter>make_HTML == "yes"</filter>
    </data>
 </outputs>
<expand macro="help_macro" />
<expand macro="test_data_macro" />
</tool>