changeset 8:8ba2174315aa draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/blob/master/tool_collections/kraken/kraken/ commit 87dfa1af2f1dd57ffc7290b66218a127cec6757f
author iuc
date Mon, 14 Jan 2019 16:48:56 -0500
parents 658d47fd33e3
children aec58624706f
files kraken.xml macros.xml test-data/test_database.loc tool-data/kraken_databases.loc.sample
diffstat 4 files changed, 55 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/kraken.xml	Thu Sep 13 09:44:31 2018 -0400
+++ b/kraken.xml	Mon Jan 14 16:48:56 2019 -0500
@@ -116,8 +116,16 @@
             <param name="split_reads" value="false"/>
             <param name="quick" value="no"/>
             <param name="only-classified-output" value="false"/>
-            <param name="kraken_database" value="test_db"/>
-
+            <param name="kraken_database" value="old_style_test_entry"/>
+            <output name="output" file="kraken_test1_output.tab" ftype="tabular"/>
+        </test>
+        <test>
+            <param name="single_paired_selector" value="no"/>
+            <param name="input_sequences" value="kraken_test1.fa" ftype="fasta"/>
+            <param name="split_reads" value="false"/>
+            <param name="quick" value="no"/>
+            <param name="only-classified-output" value="false"/>
+            <param name="kraken_database" value="new_style_test_entry"/>
             <output name="output" file="kraken_test1_output.tab" ftype="tabular"/>
         </test>
     </tests>
--- a/macros.xml	Thu Sep 13 09:44:31 2018 -0400
+++ b/macros.xml	Mon Jan 14 16:48:56 2019 -0500
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <macros>
-    <token name="@WRAPPER_VERSION@">1.2.4</token>
+    <token name="@WRAPPER_VERSION@">1.3.0</token>
     <xml name="requirements">
         <requirements>
             <requirement type="package" version="0.10.6_eaf8fb68">kraken</requirement>
@@ -23,6 +23,10 @@
             <citation type="doi">10.1186/gb-2014-15-3-r46</citation>
         </citations>
     </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>
+    <!-- See the kraken_databases.loc.sample documentation,
+	 this if statement is for backward compatibility as early
+	 versions of the wrapper assumed the UI facing field name
+	 was also part of the directory path -->
+    <token name="@SET_DATABASE_PATH@">if [ -d '${kraken_database.fields.path}/${kraken_database.fields.name}' ]; then export KRAKEN_DEFAULT_DB='${kraken_database.fields.path}/${kraken_database.fields.name}'; else export KRAKEN_DEFAULT_DB='${kraken_database.fields.path}'; fi</token>
+    <token name="@INPUT_DATABASE@">--db "\$KRAKEN_DEFAULT_DB"</token>
 </macros>
--- a/test-data/test_database.loc	Thu Sep 13 09:44:31 2018 -0400
+++ b/test-data/test_database.loc	Mon Jan 14 16:48:56 2019 -0500
@@ -1,1 +1,20 @@
-test_db	test_db	${__HERE__}
\ No newline at end of file
+# Tab separated with three columns:
+# - value (Galaxy records this in the Galaxy DB)
+# - name (Galaxy shows this in the UI)
+# - path (folder name containing the Kraken DB)
+#
+# Modern usage assumes $path is the folder containing
+# the Kraken database of interest:
+#
+new_style_test_entry	"Test Database"	${__HERE__}/test_db
+
+# The kraken wrapper still supports an alternative
+# legacy usage where $path/$name is the folder
+# containing the Kraken database of interest, meaning
+# $name must be both a folder name and human readable
+# description of the DB to show in the Galaxy UI:
+old_style_test_entry	test_db	${__HERE__}
+
+# NOTE: This legacy style should be avoided as other
+# tools also using the kraken_database.loc file may
+# not understand it!
--- a/tool-data/kraken_databases.loc.sample	Thu Sep 13 09:44:31 2018 -0400
+++ b/tool-data/kraken_databases.loc.sample	Mon Jan 14 16:48:56 2019 -0500
@@ -0,0 +1,18 @@
+# Expect three columns, tab separated, as follows:
+# - value (Galaxy records this in the Galaxy DB)
+# - name (Galaxy shows this in the UI)
+# - path (folder name containing the Kraken DB)
+#
+# e.g.
+# plants2018<tab>Plant genomes (2018)<tab>/path/to/krakenDB/plants_2018
+#
+# For backward compatibility the Kraken wrapper also accepts:
+# - value (Galaxy records this in the Galaxy DB)
+# - name (Final part of folder name, Galaxy shows this in the UI)
+# - path (Parent folder name, where $path/$name contains the Kraken DB)
+#
+# e.g.
+# plants2018<tab>plants_2018<tab>/path/to/krakenDB
+#
+# Please avoid this legacy usage, as not all tools using
+# the kraken_databases.loc file will understand it.