changeset 5:6f0294046f41 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken_database/ commit 8652f36a3a3838dca989426961561e81432acf4f
author iuc
date Tue, 04 Apr 2017 17:49:05 -0400
parents 1de1817a8a57
children 4e6e90f31ffe
files data_manager/kraken_database_builder.xml data_manager/make_json.py tool_dependencies.xml
diffstat 3 files changed, 22 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/kraken_database_builder.xml	Tue Jun 14 15:52:00 2016 -0400
+++ b/data_manager/kraken_database_builder.xml	Tue Apr 04 17:49:05 2017 -0400
@@ -1,49 +1,47 @@
 <?xml version="1.0"?>
-<tool id="kraken_database_builder" name="Kraken" tool_type="manage_data" version="1.0.1">
+<tool id="kraken_database_builder" name="Kraken" tool_type="manage_data" version="1.0.2">
     <description>database builder</description>
     <requirements>
         <requirement type="package" version="0.10.6-eaf8fb68">kraken</requirement>
-        <requirement type="package" version="1.1.11">jellyfish</requirement>
-        <requirement type="set_environment">KRAKEN_SCRIPT_PATH</requirement>
     </requirements>
-    <stdio>
-        <exit_code description="Error" level="fatal" range="1:" />
-    </stdio>
     <version_command>kraken -version | awk '{print $NF}'</version_command>
-    <command>
+    <command detect_errors="exit_code">
     <![CDATA[
         #set $library_list = str($libraries).split(',')
         mkdir kraken-database && cd kraken-database &&
-        kraken-build --threads \${GALAXY_SLOTS:-1} --download-taxonomy --db "${database_name}" &&
+        kraken-build --threads \${GALAXY_SLOTS:-1} --download-taxonomy --db '${database_name}' &&
         #for $library in $library_list:
             #if str($library) != 'None':
-                kraken-build --threads \${GALAXY_SLOTS:-1} --download-library $library --db "${database_name}"  &&
+                kraken-build --threads \${GALAXY_SLOTS:-1} --download-library $library --db '${database_name}' &&
             #end if
         #end for
         #for $fasta in $input_fasta:
             #if str($fasta) != 'None':
-                kraken-build --threads \${GALAXY_SLOTS:-1} --db "${database_name}" --add-to-library "$fasta"  &&
+                kraken-build --threads \${GALAXY_SLOTS:-1} --db '${database_name}' --add-to-library '$fasta' &&
             #end if
         #end for
-        kraken-build --threads \${GALAXY_SLOTS:-1} --db "${database_name}" --build --kmer-len ${kmer_len} --minimizer-len ${minimizer_len}  &&
-        cd .. && python \$KRAKEN_SCRIPT_PATH/data_manager/make_json.py --db "${database_name}" --out "${out_file}"
+        kraken-build --threads \${GALAXY_SLOTS:-1} --db '${database_name}' --build --kmer-len ${kmer_len} --minimizer-len ${minimizer_len} &&
+        cd .. &&
+        python '$__tool_directory__/make_json.py' --db '${database_name}' --out '${out_file}'
     ]]>
     </command>
     <inputs>
-        <param label="Name for this database" name="database_name" type="text" />
-        <param label="Select partial library to download" multiple="True" name="libraries" type="select">
+        <param name="database_name" type="text" label="Name for this database" />
+        <param name="libraries" type="select" multiple="true" label="Select partial library to download">
             <option value="bacteria">Bacteria</option>
             <option value="plasmids">Plasmids</option>
             <option value="viruses">Viruses</option>
             <option value="human">Human</option>
         </param>
-        <param format="fasta" label="Select history item" multiple="True" name="input_fasta" optional="True" type="data" />
-        <param label="K-mer length in BP" name="kmer_len" type="integer" value="31" />
-        <param label="Minimizer length" name="minimizer_len" type="integer" value="15" />
+        <param name="input_fasta" type="data" format="fasta" multiple="True" optional="true" label="Select history item" />
+        <param name="kmer_len" type="integer" value="31" label="K-mer length in BP" />
+        <param name="minimizer_len" type="integer" value="15" label="Minimizer length" />
     </inputs>
     <outputs>
-        <data format="data_manager_json" name="out_file" />
+        <data name="out_file" format="data_manager_json" />
     </outputs>
+    <help>
+    </help>
     <citations>
         <citation type="doi">10.1186/gb-2014-15-3-r46</citation>
     </citations>
--- a/data_manager/make_json.py	Tue Jun 14 15:52:00 2016 -0400
+++ b/data_manager/make_json.py	Tue Apr 04 17:49:05 2017 -0400
@@ -1,13 +1,8 @@
+import argparse
 import json
-import argparse
 import os
 import shutil
 
-parser = argparse.ArgumentParser(description='Create data manager json.')
-parser.add_argument('--db', dest='database', action='store', help='Database name')
-parser.add_argument('--out', dest='output', action='store', help='JSON filename')
-
-args = parser.parse_args()
 
 def main(args):
     data_manager_entry = {}
@@ -23,6 +18,10 @@
         shutil.move(os.path.join(output_path, filename), target_directory)
     file(args.output, 'w').write(json.dumps(data_manager_json))
 
+
 if __name__ == '__main__':
+    parser = argparse.ArgumentParser(description='Create data manager json.')
+    parser.add_argument('--db', dest='database', action='store', help='Database name')
+    parser.add_argument('--out', dest='output', action='store', help='JSON filename')
+    args = parser.parse_args()
     main(args)
-
--- a/tool_dependencies.xml	Tue Jun 14 15:52:00 2016 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<tool_dependency>
-    <set_environment version="1.0">
-        <environment_variable action="set_to" name="KRAKEN_SCRIPT_PATH">$REPOSITORY_INSTALL_DIR</environment_variable>
-    </set_environment>
-    <package name="kraken" version="0.10.6-eaf8fb68">
-        <repository changeset_revision="6dc210626044" name="package_kraken_0_10_6_eaf8fb68" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" />
-    </package>
-    <package name="jellyfish" version="1.1.11">
-        <repository changeset_revision="9529f5e46f4e" name="package_jellyfish_1_1_11" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" />
-    </package>
-</tool_dependency>