changeset 4:a3a7440fc618 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/blob/master/tool_collections/kraken/kraken_report/ commit e8fc7c9dad5f583ad6763ecb9bd8c924832abacd
author iuc
date Mon, 07 Aug 2017 17:29:32 -0400
parents 9ae975c30dde
children 6c09bed3444f
files kraken-mpa-report.xml kraken-report.xml macros.xml test-data/kraken_mpa_report_test1_output.tab tool_dependencies.xml
diffstat 5 files changed, 56 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/kraken-mpa-report.xml	Wed Mar 23 11:01:19 2016 -0400
+++ b/kraken-mpa-report.xml	Mon Aug 07 17:29:32 2017 -0400
@@ -1,35 +1,46 @@
 <?xml version="1.0"?>
-<tool id="kraken-mpa-report" name="Kraken-mpa-report" version="1.2.1">
+<tool id="kraken-mpa-report" name="Kraken-mpa-report" version="@WRAPPER_VERSION@">
     <description>view report of classification for multiple samples</description>
     <macros>
         <import>macros.xml</import>
     </macros>
     <expand macro="requirements" />
-    <expand macro="stdio" />
     <expand macro="version_command" />
-    <command>
-<![CDATA[
+    <command detect_errors="exit_code"><![CDATA[
+    #set $names = []
 
-#for $input_count, $input_classification in enumerate( $classification ):
-    ln -s "${input_classification}" "sample_${input_count}" &&
-#end for
+    #for $input_count, $input_classification in enumerate( $classification ):
+        #set $name_base = str( getattr( $input_classification, 'element_identifier', 'sample' ) ).replace( "/", '-' ).replace( "\t", "-" )
+        #set $name = $name_base
+        #set $i = 1
+        #while $name in $names:
+            #set $name = "%s_%s" % ( $name_base, $i )
+            #set $i = $i + 1
+        #end while
+        #silent $names.append( $name )
+        ln -s '${input_classification}' '${name}' &&
+    #end for
 
-@SET_DATABASE_PATH@ && kraken-mpa-report @INPUT_DATABASE@
+    @SET_DATABASE_PATH@ &&
 
-#for $input_count, $input_classification in enumerate( $classification ):
-    "sample_${input_count}"
-#end for
+    kraken-mpa-report
+        @INPUT_DATABASE@
+        #for $name in $names:
+            "${name}"
+        #end for
 
-${show_zeros}
-${header_line}
+        ${show_zeros}
+        ${header_line}
 
-> "$output_report"
-]]>
-    </command>
+        > '$output_report'
+    ]]></command>
     <inputs>
-        <param format="tabular" label="Kraken output" multiple="True" name="classification" type="data" />
-        <param checked="False" falsevalue="" help="--show-zeros" label="Display taxa even if they lack a read in any sample" name="show_zeros" truevalue="--show-zeros" type="boolean" />
-        <param checked="False" falsevalue="" help="--header-line" label="Display a header line indicating sample IDs" name="header_line" truevalue="--header-line" type="boolean" />
+        <param name="classification" format="tabular" label="Kraken output" multiple="True" type="data" />
+        <param name="show_zeros" argument="--show-zeros" type="boolean" falsevalue=""  truevalue="--show-zeros" checked="False"
+               label="Display taxa even if they lack a read in any sample" />
+        <param name="header_line" argument="--header-line" type="boolean" truevalue="--header-line" falsevalue="" checked="False"
+               label="Display a header line indicating sample IDs"/>
+
         <expand macro="input_database" />
     </inputs>
     <outputs>
@@ -41,7 +52,8 @@
             <param name="show_zeros" value="--show-zeros"/>
             <param name="header_line" value="--header-line"/>
             <param name="kraken_database" value="test_db"/>
-            <output name="output_report" file="kraken_mpa_report_test1_output.tab" ftype="tabular"/>
+
+            <output name="output_report" ftype="tabular" file="kraken_mpa_report_test1_output.tab" />
         </test>
     </tests>
     <help>
@@ -55,17 +67,13 @@
 
 **What is Does**
 
-Kraken-mpa-report summarizes read counts across taxonomic ranks for multiple samples. This is convenient for comparing results across multiple expreriments, conditions, locations, etc. It support sthe following parameters::
-
---show-zeros    Display taxa even if they lack a read in any sample
---header-line   Display a header line indicating sample IDs
-                (sample IDs are the filenames)
+Kraken-mpa-report summarizes read counts across taxonomic ranks for multiple samples. This is convenient for comparing results across multiple experiments, conditions, locations, etc.
 
 -----
 
 **Output**
 
-The output of kraken-mpa-report is tab-delimited, with one line per taxon.
+The output of kraken-mpa-report is a tab-delimited table, with one line per taxon.
 
 ]]>
     </help>
--- a/kraken-report.xml	Wed Mar 23 11:01:19 2016 -0400
+++ b/kraken-report.xml	Mon Aug 07 17:29:32 2017 -0400
@@ -1,22 +1,22 @@
-<tool id="kraken-report" name="Kraken-report" version="1.2.1">
-    <description>
-        view a sample report of your classification
-    </description>
-    
+<tool id="kraken-report" name="Kraken-report" version="@WRAPPER_VERSION@">
+    <description>view sample report of a classification</description>
+
     <macros>
         <import>macros.xml</import>
     </macros>
     <expand macro="requirements" />
-    <expand macro="stdio" />
     <expand macro="version_command" />
-    <command>
-        <![CDATA[
+    <command detect_errors="exit_code"><![CDATA[
         @SET_DATABASE_PATH@ &&
-        kraken-report @INPUT_DATABASE@ "${kraken_output}" > "$output_report"
-        ]]>
-    </command>
+
+        kraken-report
+            @INPUT_DATABASE@
+            '${kraken_output}'
+            > '$output_report'
+    ]]></command>
     <inputs>
-        <param format="tabular" label="Kraken output" name="kraken_output" type="data" help="Select taxonomy classification produced by kraken"/>
+        <param name="kraken_output" type="data" format="tabular" label="Kraken output" help="Select taxonomy classification produced by kraken"/>
+
         <expand macro="input_database" />
     </inputs>
     <outputs>
@@ -26,12 +26,11 @@
         <test>
             <param name="kraken_output" value="kraken_report_test1.tab" ftype="tabular"/>
             <param name="kraken_database" value="test_db"/>
-            <output name="output_report" file="kraken_report_test1_output.tab" ftype="tabular"/>
+            <output name="output_report" ftype="tabular" file="kraken_report_test1_output.tab"/>
         </test>
     </tests>
 
-    <help>
-<![CDATA[
+    <help><![CDATA[
 
 .. class:: warningmark
 
@@ -52,7 +51,6 @@
 
 The scientific names are indented using spaces, according to the tree
 structure specified by the taxonomy.
-    ]]>
-    </help>
+    ]]></help>
     <expand macro="citations" />
 </tool>
--- a/macros.xml	Wed Mar 23 11:01:19 2016 -0400
+++ b/macros.xml	Mon Aug 07 17:29:32 2017 -0400
@@ -1,23 +1,20 @@
 <?xml version="1.0"?>
 <macros>
+    <token name="@WRAPPER_VERSION@">1.2.3</token>
     <xml name="requirements">
         <requirements>
             <requirement type="package" version="0.10.6_eaf8fb68">kraken</requirement>
-            <requirement type="package" version="0.10.6-eaf8fb68">kraken</requirement>
         </requirements>
     </xml>
-    <xml name="stdio">
-        <stdio>
-            <exit_code description="Tool exception" level="fatal" range="1:" />
-        </stdio>
-    </xml>
     <xml name="version_command">
-        <version_command>export LC_ALL=C &amp;&amp; kraken --version</version_command>
+        <version_command><![CDATA[
+            export LC_ALL=C && kraken --version
+        ]]></version_command>
     </xml>
     <xml name="input_database">
         <param label="Select a Kraken database" name="kraken_database" type="select">
             <options from_data_table="kraken_databases">
-                <validator message="No databases are available built-in" type="no_options" />
+                <validator message="No Kraken database is available" type="no_options" />
             </options>
         </param>
     </xml>
@@ -28,4 +25,4 @@
     </xml>
     <token name="@INPUT_DATABASE@">--db ${kraken_database.fields.name}</token>
     <token name="@SET_DATABASE_PATH@">export KRAKEN_DB_PATH="${kraken_database.fields.path}"</token>
-</macros>
\ No newline at end of file
+</macros>
--- a/test-data/kraken_mpa_report_test1_output.tab	Wed Mar 23 11:01:19 2016 -0400
+++ b/test-data/kraken_mpa_report_test1_output.tab	Mon Aug 07 17:29:32 2017 -0400
@@ -1,4 +1,4 @@
-#Sample ID	sample_0	sample_1
+#Sample ID	kraken_mpa_report_input1.tab	kraken_mpa_report_input2.tab
 d__Bacteria	4	4
 d__Bacteria|p__Proteobacteria	4	4
 d__Bacteria|p__Proteobacteria|c__Gammaproteobacteria	4	4
--- a/tool_dependencies.xml	Wed Mar 23 11:01:19 2016 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-<?xml version="1.0"?>
-<tool_dependency>
-  <package name="kraken" version="0.10.6-eaf8fb68">
-      <repository changeset_revision="0743afe4dcb8" name="package_kraken_0_10_6_eaf8fb68" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
-    </package>
-</tool_dependency>