diff toolfactory/rgToolFactory2.xml @ 38:a30536c100bf draft

Updated history outputs
author fubar
date Wed, 12 Aug 2020 01:43:46 -0400
parents ce2b1f8ea68d
children 2cd6555baf44
line wrap: on
line diff
--- a/toolfactory/rgToolFactory2.xml	Mon Aug 10 23:25:51 2020 -0400
+++ b/toolfactory/rgToolFactory2.xml	Wed Aug 12 01:43:46 2020 -0400
@@ -1,10 +1,10 @@
-<tool id="rgTF2" name="toolfactory" version="2.00">
+<tool id="rgTF2" name="toolfactory" version="2.00" profile="16.04" >
   <description>Scripts into tools</description>
   <macros>
      <xml name="io">
         <repeat name="history_inputs" title="Add a data file from your history to pass in to the script. Use the '+' button as needed"
              help="USE SMALL SAMPLES because these will be used for the new tool's test. The names will become a history item selector as input for users of the new tool you are making">
-            <param name="input_files" type="data" format="data" label="Select an input file from your history" optional="true" size="120" multiple="false"
+            <param name="input_files" type="data" format="data" label="Select an input file from your history" optional="true" multiple="false"
                help=""/>
             <param name="input_formats" type="select" multiple="true" label="Select the datatype(s) that your tool/script accepts as input"
               help="If your datatype is not listed here, it has to be added in galaxy's datatypes_conf.xml" value="tabular">
@@ -12,7 +12,7 @@
                 <column name="value" index="0"/>
                </options>
             </param>
-            <param name="input_label" type="text" value="" label="This will become the user prompt for the form so please make it informative" size="60" 
+            <param name="input_label" type="text" value="" label="This will become the user prompt for the form so please make it informative"
              help="Note that '~~~' is an internal delimiter so must not appear in this text field - please work around this technical limitation" >
             <sanitizer invalid_char="">
               <valid initial="string.printable"> <remove value='~~~'/> </valid>
@@ -20,33 +20,31 @@
             </sanitizer>
             </param>
             <param name="input_help" type="text" value="parameter_help" label="This will become help text on the form."
-             help="Note that three consecutive ~ cannot be used in this text field - please work around this technical limitation" size="60">
+             help="Note that three consecutive ~ cannot be used in this text field - please work around this technical limitation">
             <sanitizer invalid_char="">
               <valid initial="string.printable"> <remove value='~~~'/> </valid>
               <mapping initial="none"/>
             </sanitizer>
             </param>
-            <param name="input_CL" type="text" size="60" label="Positional: ordinal integer. Argparse: argument name."
-              help="If you will pass positional parameters, enter the integer ordinal for this parameter. If Argparse style, '--' will be prepended or '-' if single character" value="">          
+            <param name="input_CL" type="text" label="Positional: ordinal integer. Argparse: argument name. STDIN if the executable/script expects it"
+              help="If you will pass positional parameters, enter the integer ordinal for this parameter. If Argparse style, '--' will be prepended or '-' if single character" value="">
             </param>
         </repeat>
         <repeat name="history_outputs" title="Add a tool run output file to the user's history from your tool - Use the '+' button to add as many as needed"
              help="The name will become a history item for users of the new tool you are making containing one of it's outputs">
-            <param name="history_name" type="text" label="Name for this output to appear in new history" optional="false" size="120" 
-               help=""/>
+            <param name="history_name" type="text" label="Name for this output to appear in new history" optional="false" help=""/>
             <param name="history_format" type="select" multiple="false" label="Select the datatype for this output"
               help="If your datatype is not listed here, it has to be added in galaxy's datatypes_conf.xml" value="tabular">
                <options from_parameter="tool.app.datatypes_registry.upload_file_formats">
                 <column name="value" index="0"/>
                </options>
             </param>
-            <param name="history_CL" type="text" size="60" label="Positional: ordinal integer. Argparse: argument name expected for this output parameter"
-              help="If positional parameters, enter the integer ordinal expected for this parameter. If Argparse style, '--' will be prepended or '-' if single character" value="">          
-            </param>
+            <param name="history_CL" type="text"  label="Positional: ordinal integer. Argparse: argument name expected for this output parameter. Use STDOUT if '>' required."
+              help="If positional parameters, enter the integer ordinal expected for this parameter. If Argparse style, '--' will be prepended or '-' if single character" value=""/>
         </repeat>
      </xml>
      <xml name="additparam">
-        <param name="edit_params" type="select" display="radio" label="Add any additional parameters to the generated tool form so they are user editable?" 
+        <param name="edit_params" type="select" display="radio" label="Add any additional parameters to the generated tool form so they are user editable?"
              help="If no (default), users will NOT be able to alter any additional parameters. If yes, these will appear on the tool form as text fields with no validation or sanitizing">
             <option value="yes">Yes, allow user to edit all additional parameters on the generated tool form</option>
             <option value="no" selected="true">No - use the fixed values for all additional parameters - no user editing</option>
@@ -54,10 +52,10 @@
 
         <repeat name="additional_parameters" title="Pass additional parameters to the script"
              help="See examples below to see how these can be parsed by scripts in the various languages">
-          <param name="param_name" type="text" value="parameter_name" label="Choose the name for this parameter" size="60">
+          <param name="param_name" type="text" value="parameter_name" label="Choose the name for this parameter">
             <sanitizer invalid_char="">
               <valid initial="string.letters,string.digits"/>
-              <mapping initial="none"/> 
+              <mapping initial="none"/>
             </sanitizer>
           </param>
           <param name="param_type" type="select" label="Select the type for this parameter">
@@ -65,14 +63,14 @@
             <option value="integer">integer</option>
             <option value="float">float</option>
           </param>
-          <param name="param_value" type="text" value="" label="Enter this parameter's default value" size="60"
+          <param name="param_value" type="text" value="" label="Enter this parameter's default value"
             help="Note that '~~~' is an internal delimiter must not appear in this text field - please work around this technical limitation" >
             <sanitizer invalid_char="">
               <valid initial="string.printable"> <remove value='~~~'/> </valid>
               <mapping initial="none"/>
             </sanitizer>
           </param>
-          <param name="param_label" type="text" value="parameter_label" label="Enter this parameter's label for the form" size="60" 
+          <param name="param_label" type="text" value="parameter_label" label="Enter this parameter's label for the form"
              help="Note that '~~~' is an internal delimiter so must not appear in this text field - please work around this technical limitation" >
             <sanitizer invalid_char="">
               <valid initial="string.printable"> <remove value='~~~'/> </valid>
@@ -80,23 +78,25 @@
             </sanitizer>
           </param>
           <param name="param_help" type="text" value="parameter_help" label="Help for this parameter"
-             help="Note that three consecutive ~ cannot be used in this text field - please work around this technical limitation" size="60">
+             help="Note that three consecutive ~ cannot be used in this text field - please work around this technical limitation" >
             <sanitizer invalid_char="">
               <valid initial="string.printable"> <remove value='~~~'/> </valid>
               <mapping initial="none"/>
             </sanitizer>
           </param>
-          <param name="param_CL" type="text" size="60" label="Positional order (must be integer > 1) or Argument name to be prefixed with '--' or '-' if single letter"
-              help="Using positional parameters, enter the integer ordinal for this parameter on the command line. Using Argparse style, '--' will be prepended on the CL" value="">           
-          </param>
+          <param name="param_CL" type="text" label="Positional ordinal or argparse argument name"
+              help="Using positional parameters, enter the integer ordinal for this parameter on the command line. Using Argparse style, '--' will be prepended on the CL" value="" />
+          <param name="param_CLprefixed" type="text" label="Override the generated default argparse name prefix if not empty - eg ----foo if needed"
+              help="Some targets like Planemo expect an unadorned action like 'test' before --galaxy_root and so on. " value="" />
+
         </repeat>
      </xml>
      <xml name="builtin_dynpar">
-          <param name="interpreter_version" type="text" value="" 
+          <param name="interpreter_version" type="text" value=""
           label="Specific interpreter version to match dependency (Conda) repositories - e.g. for python '3.8.5' Latest if empty"/>
             <param name="exe_package_version" type="text" value=""
               label="Executable package version to match dependency (Conda) repositories - e.g. for bwa='0.7.17'. Latest if empty"/>
-          <param name="dynScript" label="Cut and paste the script to be executed here" type="text" value="Script goes here" area="True"  
+          <param name="dynScript" label="Cut and paste the script to be executed here" type="text" value="Script goes here" area="True"
               help="If there are parameters, either positional or argparse style, the script must parse and use them appropriately">
               <sanitizer>
                  <valid initial="string.printable">
@@ -108,9 +108,9 @@
     <xml name="dynpar">
           <param name="interpreter_version" type="text" value=""
           label="Specific interpreter version to match dependency (Conda) repositories - e.g. for python '3.8.5' Latest if empty"/>
-            <param name="exe_package_version" type="text" value="" 
+            <param name="exe_package_version" type="text" value=""
               label="Executable package version to match dependency (Conda) repositories - e.g. for bwa='0.7.17'. Latest if empty"/>
-          <param name="dynScript" label="Cut and paste the script to be executed here" type="text" value="Script goes here" area="True" 
+          <param name="dynScript" label="Cut and paste the script to be executed here" type="text" value="Script goes here" area="True"
               help="If there are parameters, either positional or argparse style, the script must parse and use them appropriately">
               <sanitizer>
                  <valid initial="string.printable">
@@ -130,15 +130,15 @@
 #if not $dev_env and ( $__user_email__ not in $__admin_users__ ):
 $__tool_directory__/rgToolFactory2.py --bad_user $__user_email__
  #else:
-$__tool_directory__/rgToolFactory2.py 
+$__tool_directory__/rgToolFactory2.py
 --runmode "$interexe.interpreter"
    #if str($interexe.interpreter)=="Executable" or str($interexe.interpreter)=="system":
---exe_package="$interexe.exe_package" 
-    #if str($interexe.exe_package_version) != 'None' :  
---exe_package_version="$interexe.exe_package_version" 
+--exe_package="$interexe.exe_package"
+    #if str($interexe.exe_package_version) != 'None' :
+--exe_package_version="$interexe.exe_package_version"
     #end if
    #else:
---interpreter_name="$interexe.interpreter" --script_path "$runme" 
+--interpreter_name="$interexe.interpreter" --script_path "$runme"
      #if str($interexe.interpreter_version) != 'None':
 --interpreter_version="$interexe.interpreter_version"
      #end if
@@ -153,10 +153,10 @@
    #end if
    #if $ppass.parampass != '0':
      #if str($ppass.edit_params) == "yes":
---edit_additional_parameters  
+--edit_additional_parameters
      #end if
      #for apar in $ppass.additional_parameters:
---additional_parameters="$apar.param_name~~~$apar.param_value~~~$apar.param_label~~~$apar.param_help~~~$apar.param_type~~~$apar.param_CL"
+--additional_parameters="$apar.param_name~~~$apar.param_value~~~$apar.param_label~~~$apar.param_help~~~$apar.param_type~~~$apar.param_CL~~~$apar.param_CLprefixed"
      #end for
    #end if
 
@@ -168,7 +168,7 @@
      #for $otab in $ppass.history_outputs:
 --output_files "$otab.history_name~~~$otab.history_format~~~$otab.history_CL"
      #end for
- #end if 
+ #end if
 ]]></command>
  <configfiles>
   <configfile name="runme">
@@ -202,14 +202,14 @@
   </configfiles>
   <inputs>
 
-   <param name="tool_name" type="text" value="tool1"   label="New tool ID and title for outputs" size="60"
+   <param name="tool_name" type="text" value="tool1"   label="New tool ID and title for outputs"
          help="This will become the toolshed repository name so choose thoughtfully to avoid namespace clashes with other tool writers. lower case, digits and underscores only">
         <sanitizer invalid_char="">
             <valid initial="string.letters,string.digits">
                 <add value="_"/>
             </valid>
         </sanitizer>
-    </param>    
+    </param>
     <conditional name="interexe">
         <param name="interpreter" type="select" label="For binaries, choose 'Executable'. Otherwise choose the interpreter for your code"
         help = "If executable, the supplied package will become a requirement so must match the tool dependency resolver package name - conda is the default.">
@@ -223,11 +223,11 @@
             <option value="specialtestcaseinterpreterpython" >for testing only - do not use me please</option>
         </param>
         <when value="Executable">
-            <param name="exe_package" type="text" value="" label="Executable package name in dependency (Conda) repositories - e.g. 'bwa'" size="60" optional="false"/>
-            <param name="exe_package_version" type="text" value="" label="Executable package version to match dependency (Conda) repositories - e.g. for bwa='0.7.17'. Latest if empty" size="60"/>
+            <param name="exe_package" type="text" value="" label="Executable package name in dependency (Conda) repositories - e.g. 'bwa'" optional="false"/>
+            <param name="exe_package_version" type="text" value="" label="Executable package version to match dependency (Conda) repositories - e.g. for bwa='0.7.17'. Latest if empty" />
         </when>
         <when value="system">
-            <param name="exe_package" type="text" value="" label="System executable to run" size="60" optional="false"/>
+            <param name="exe_package" type="text" value="" label="System executable to run"  optional="false"/>
             <param name="exe_package_version" type="text" value=""
               label="Executable package version to match dependency (Conda) repositories - e.g. for bwa='0.7.17'. Latest if empty"/>
         </when>
@@ -253,9 +253,9 @@
     <conditional name = "ppass">
 
         <param name="parampass"  type="select" display="radio" label="Command line parameter passing method to use">
-            <option value="argparse" selected="true">Argparse style: on CL in the form of --inputbam="foo.bam" if label below is "inputbam"</option>
-            <option value="positional">Positional: on CL in the order defined on this screen -> "... foo.bam bar.idx zot.xls"</option>
-            <option value="0">No parameters needed because tool reads selected history file from STDIN and writes to STDOUT for history"</option>
+            <option value="argparse" selected="true">Argparse style: passed in the form of '--[clname] [value]'</option>
+            <option value="positional">Positional: Passed in the order of positional ordinals '...foo.bam bar.idx zot.xls'</option>
+            <option value="0">No parameters needed because tool reads selected input file from STDIN and writes STDOUT with new history output"</option>
         </param>
         <when value = "argparse">
             <expand macro="io" />
@@ -268,22 +268,21 @@
         <when value = "0">
              <expand macro="io"/>
         </when>
-    </conditional>    
+    </conditional>
     <conditional name="makeMode">
-        <param name="make_Tool" type="select" display="radio" label="Generate new tool as  a tar.gz file ready to upload to a toolshed repository" 
-          help="Generate a toolshed archive - upload to a toolshed from where it can be auto-installed via the Galaxy admin functions" 
-          size="60">
+        <param name="make_Tool" type="select" display="radio" label="Generate new tool as  a tar.gz file ready to upload to a toolshed repository"
+          help="Generate a toolshed archive - upload to a toolshed from where it can be auto-installed via the Galaxy admin functions" >
         <option value="yes">Generate a Galaxy ToolShed compatible toolshed.gz</option>
         <option value="" selected="true">No. Just run the script please</option>
         </param>
         <when value = "yes">
             <param name="tool_version" label="Tool Version - bump this to warn users trying to redo old analyses" type="text" value="0.01"
             help="If you change your script and regenerate the 'same' tool, you should inform Galaxy (and users) by changing (bumping is traditional) this number"/>
-            <param name="tool_desc" label="Tool Description" type="text" value="" size="40" 
+            <param name="tool_desc" label="Tool Description" type="text" value=""
              help="Supply a brief tool description for the Galaxy tool menu entry (optional - appears after the tool name)" />
-            <param name="help_text" label="Tool form documentation and help text for users" type="text" area="true" 
-             size="8x120" value="**What it Does**" 
-             help="Supply the brief user documentation to appear on the new tool form as reStructured text - http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html" >           
+            <param name="help_text" label="Tool form documentation and help text for users" type="text" area="true"
+            value="**What it Does**"
+             help="Supply the brief user documentation to appear on the new tool form as reStructured text - http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html" >
                 <sanitizer>
                     <valid initial="string.printable">
                     </valid>
@@ -297,11 +296,11 @@
                         <option value="bibtex">BibTeX</option>
                     </param>
                     <when value="doi">
-                        <param name="doi" label="DOI" type="text" value="" 
+                        <param name="doi" label="DOI" type="text" value=""
                         help="Supply a DOI (e.g. doi: 10.1111/j.1740-9713.2007.00258.x) that should be cited when this tool is used in published research." />
                     </when>
                     <when value="bibtex">
-                        <param name="bibtex" label="BibTex" type="text" area="true" size="8x120"
+                        <param name="bibtex" label="BibTex" type="text" area="true"
                             help="Supply a BibTex entry that should be cited when this tool is used in published research." value="" >
                             <sanitizer>
                                 <valid initial="string.printable">
@@ -315,15 +314,19 @@
         </when>
         <when value = "">
         </when>
-    </conditional> 
+    </conditional>
   </inputs>
   <outputs>
-    <collection name="ToolFactory_Outputs" type="list" label="Toolfactory ${tool_name} test run outputs" >
-       <discover_datasets pattern="__name__" directory="tfout/test-data" format="txt"/>
-    </collection>
-    <data format="tgz" name="new_tool" label="${tool_name}_toolshed.tgz">
+
+    <data format="tgz" name="new_tool" label="${tool_name}_toolshed.tgz" >
         <filter>makeMode['make_Tool'] == "yes"</filter>
     </data>
+
+  <collection name="TF_run_report" type="list" label="${tool_name} outputs">
+      <discover_datasets pattern="__name__" directory="TF_run_report_tempdir" format="txt"/>
+  </collection>
+
+
   </outputs>
 <tests>
 <test>
@@ -342,27 +345,25 @@
     <param name="history_name" value="output2_sample" />
     <param name="history_format" value="txt" />
     <param name="history_CL" value="2" />
-    <param name="dynScript" value="import sys; inp = sys.argv[1]; outp = sys.argv[2]; inlist = open(inp,'r').readlines(); o = open(outp,'w'); rs = [''.join(list(reversed(x.rstrip()))) for x in inlist]; o.write('\n'.join(rs)); o.close()"/> 
-    <output_collection name="ToolFactory_Outputs" type="list">
-        <element name="output2_sample_sample" file="output2_sample" ftype="txt" compare="diff" lines_diff = "10" />
-    </output_collection>
+    <param name="dynScript" value="import sys; inp = sys.argv[1]; outp = sys.argv[2]; inlist = open(inp,'r').readlines(); o = open(outp,'w'); rs = [''.join(list(reversed(x.rstrip()))) for x in inlist]; o.write('\n'.join(rs)); o.close()"/>
     <output name="new_tool" file="toolfactory_pyrevpos_tgz_sample" compare="sim_size" delta="6000" />
+    <!-- <output name="output" file="output2_sample" ftype="txt" compare="diff" lines_diff = "10" /> -->
 </test>
 </tests>
 <help>
 
 .. class:: warningmark
 
-**Details and attribution** 
+**Details and attribution**
 (see GTF_)
 
-**Local Admins ONLY** 
+**Local Admins ONLY**
 Only users whose IDs found in the local admin_user configuration setting in universe_wsgi.ini can run this tool.
 
-**If you find a bug** 
+**If you find a bug**
 Please raise an issue, or even better, submit a pull request fixing it, on the github repository GTF_
 
-**What it does** 
+**What it does**
 This tool optionally generates normal workflow compatible first class Galaxy tools
 
 Generated tools can run existing binary packages that become requirements, existing scripts, or new scripts pasted into this tool form.
@@ -382,7 +383,7 @@
 
 .. class:: warningmark
 
-**Note to system administrators** 
+**Note to system administrators**
 This tool offers *NO* built in protection against malicious scripts. It should only be installed on private/personnal Galaxy instances.
 Admin_users will have the power to do anything they want as the Galaxy user if you install this tool.
 
@@ -412,7 +413,7 @@
     o.close()
 
 With argparse style parameters:
-    
+
 ::
 
     # reverse order of text by row
@@ -433,7 +434,7 @@
       o.write(''.join(rs))
       o.write('\n')
     o.close()
-     
+
 
 Paper_ :
 
@@ -441,7 +442,7 @@
 Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team
 Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573
 
-**Licensing** 
+**Licensing**
 
 Copyright Ross Lazarus (ross period lazarus at gmail period com) May 2012
 All rights reserved.