changeset 19:ffeb852407d6 draft default tip

"planemo upload for repository https://github.com/dfornika/galaxytools/tree/master/data_managers/data_manager_build_kraken2_database/ commit 6f21145d4103d33c227f52dc55a7d3dcf52f4f5d-dirty"
author dfornika
date Wed, 23 Oct 2019 14:21:07 -0400
parents f005b6efd096
children
files data_manager/kraken2_build_database.py data_manager/kraken2_build_database.xml data_manager_conf.xml
diffstat 3 files changed, 32 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/kraken2_build_database.py	Fri May 24 13:39:08 2019 -0400
+++ b/data_manager/kraken2_build_database.py	Wed Oct 23 14:21:07 2019 -0400
@@ -83,13 +83,14 @@
 
     subprocess.check_call(['kraken2-build'] + args, cwd=target_directory)
 
-    args = [
-        '--threads', str(kraken2_args["threads"]),
-        '--clean',
-        '--db', database_path
-    ]
+    if kraken2_args["clean"]:
+        args = [
+            '--threads', str(kraken2_args["threads"]),
+            '--clean',
+            '--db', database_path
+        ]
 
-    subprocess.check_call(['kraken2-build'] + args, cwd=target_directory)
+        subprocess.check_call(['kraken2-build'] + args, cwd=target_directory)
 
     data_table_entry = {
         'data_tables': {
@@ -195,13 +196,14 @@
 
     subprocess.check_call(['kraken2-build'] + args, cwd=target_directory)
 
-    args = [
-        '--threads', str(kraken2_args["threads"]),
-        '--clean',
-        '--db', database_path
-    ]
+    if kraken2_args["clean"]:
+        args = [
+            '--threads', str(kraken2_args["threads"]),
+            '--clean',
+            '--db', database_path
+        ]
 
-    subprocess.check_call(['kraken2-build'] + args, cwd=target_directory)
+        subprocess.check_call(['kraken2-build'] + args, cwd=target_directory)
 
     data_table_entry = {
         'data_tables': {
@@ -250,13 +252,14 @@
 
     subprocess.check_call(['kraken2-build'] + args, cwd=target_directory)
 
-    args = [
-        '--threads', str(kraken2_args["threads"]),
-        '--clean',
-        '--db', custom_database_name
-    ]
+    if kraken2_args["clean"]:
+        args = [
+            '--threads', str(kraken2_args["threads"]),
+            '--clean',
+            '--db', custom_database_name
+        ]
 
-    subprocess.check_call(['kraken2-build'] + args, cwd=target_directory)
+        subprocess.check_call(['kraken2-build'] + args, cwd=target_directory)
 
     data_table_entry = {
         'data_tables': {
@@ -286,6 +289,7 @@
     parser.add_argument('--custom-fasta', dest='custom_fasta', help='fasta file for custom database (only applies to --database-type custom)')
     parser.add_argument('--custom-database-name', dest='custom_database_name', help='Name for custom database (only applies to --database-type custom)')
     parser.add_argument('--skip-maps', dest='skip_maps', action='store_true', help='')
+    parser.add_argument('--clean', dest='clean', action='store_true', help='Clean up extra files')
     args = parser.parse_args()
 
     data_manager_input = json.loads(open(args.data_manager_json).read())
@@ -308,6 +312,7 @@
             "minimizer_len": args.minimizer_len,
             "minimizer_spaces": args.minimizer_spaces,
             "threads": args.threads,
+            "clean": args.clean,
         }
         data_manager_output = kraken2_build_standard(
             kraken2_args,
@@ -325,6 +330,7 @@
             "minimizer_len": args.minimizer_len,
             "minimizer_spaces": args.minimizer_spaces,
             "threads": args.threads,
+            "clean": args.clean,
         }
         data_manager_output = kraken2_build_special(
             kraken2_args,
@@ -338,6 +344,7 @@
             "minimizer_len": args.minimizer_len,
             "minimizer_spaces": args.minimizer_spaces,
             "threads": args.threads,
+            "clean": args.clean,
         }
         data_manager_output = kraken2_build_custom(
             kraken2_args,
--- a/data_manager/kraken2_build_database.xml	Fri May 24 13:39:08 2019 -0400
+++ b/data_manager/kraken2_build_database.xml	Wed Oct 23 14:21:07 2019 -0400
@@ -1,10 +1,11 @@
 <?xml version="1.0"?>
-<tool id="kraken2_build_database" name="Kraken2" tool_type="manage_data" version="2.0.8_beta">
+<tool id="kraken2_build_database" name="Kraken2" tool_type="manage_data" version="2.0.8_beta_galaxy1">
     <macros>
         <xml name="common_params">
             <param name="kmer_len" type="integer" value="35" label="K-mer length in BP" />
             <param name="minimizer_len" type="integer" value="31" label="Minimizer length" />
             <param name="minimizer_spaces" type="integer" value="6" label="Minimizer spaces" />
+            <param name="clean" type="boolean" truevalue="--clean" falsevalue="" checked="true" label="Clean up extra files" />
         </xml>
     </macros>
     <description>database builder</description>
@@ -24,12 +25,14 @@
             --kmer-len ${database_type.kmer_len}
             --minimizer-len ${database_type.minimizer_len}
             --minimizer-spaces ${database_type.minimizer_spaces}
+            ${database_type.clean}
           #else if $database_type.database_type == "special"
             --threads \${GALAXY_SLOTS:-1}
             --special-database-type ${database_type.special_database_type}
             --kmer-len ${database_type.kmer_len}
             --minimizer-len ${database_type.minimizer_len}
             --minimizer-spaces ${database_type.minimizer_spaces}
+            ${database_type.clean}
           #else if $database_type.database_type == "custom"
             --threads \${GALAXY_SLOTS:-1}
             ${database_type.skip_maps}
@@ -38,6 +41,7 @@
             --kmer-len ${database_type.kmer_len}
             --minimizer-len ${database_type.minimizer_len}
             --minimizer-spaces ${database_type.minimizer_spaces}
+            ${database_type.clean}
           #end if
     ]]>
     </command>
@@ -54,7 +58,7 @@
             </when>
             <when value="minikraken">
                 <param name="minikraken2_version" type="select" multiple="false" label="Select MiniKraken2 database version to download">
-	                <option value="v2">Version 2</option>
+                    <option value="v2">Version 2</option>
                     <option value="v1">Version 1</option>
                 </param>
             </when>
@@ -72,7 +76,6 @@
                 <param name="skip_maps" type="boolean" truevalue="--skip-maps" falsevalue="" label="Skip downloading accession number to taxid maps during taxonomy download." /> 
                 <expand macro="common_params" />
             </when>
-            
         </conditional>
     </inputs>
     <outputs>
--- a/data_manager_conf.xml	Fri May 24 13:39:08 2019 -0400
+++ b/data_manager_conf.xml	Wed Oct 23 14:21:07 2019 -0400
@@ -1,5 +1,5 @@
 <data_managers>
-    <data_manager tool_file="data_manager/kraken2_build_database.xml" id="kraken2_build_database" version="2.0.8_beta">
+    <data_manager tool_file="data_manager/kraken2_build_database.xml" id="kraken2_build_database" version="2.0.8_beta_galaxy1">
         <data_table name="kraken2_databases">
             <output>
                 <column name="value"/>