changeset 3:e8405163fb4e draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mykrobe commit 2b9fb5d1f0ffb7ecd51561d3e325813c4f8e7f3e"
author iuc
date Tue, 10 Aug 2021 11:29:58 +0000
parents cedd631dc124
children a2e3ad69ee23
files macro.xml mykrobe_predict.xml test-data/reads.fastq.gz
diffstat 3 files changed, 54 insertions(+), 62 deletions(-) [+]
line wrap: on
line diff
--- a/macro.xml	Thu Jan 02 12:03:50 2020 -0500
+++ b/macro.xml	Tue Aug 10 11:29:58 2021 +0000
@@ -1,40 +1,14 @@
 <?xml version="1.1"?>
 <macros>
+  <token name="@TOOL_VERSION@">0.10.0</token>
   <xml name="requirements">
     <requirements>
-      <requirement type="package" version="0.7.0">mykrobe</requirement>
+      <requirement type="package" version="@TOOL_VERSION@">mykrobe</requirement>
     </requirements>    
   </xml>
   <token name="@select_inputs@">
     <![CDATA[
          #set $name='sample'
-         #set $type='fastq'
-         ## Adding sample name, indicate specie and inputs fastq(s) files
-          #if $data_type.type == "paired":
-
-            ln -s '$data_type.fastq_input1' sample_1.fastq &&
-            ln -s '$data_type.fastq_input2' sample_2.fastq &&
-
-
-        #elif $data_type.type == "collection":
-            #set $name=str($data_type.fastq_input1.name)
-            ln -s '$data_type.fastq_input1.forward' '$data_type.fastq_input1.name'_1.fastq &&
-            ln -s '$data_type.fastq_input1.reverse' '$data_type.fastq_input1.name'_2.fastq &&
-
-        #elif $data_type.type == "single":
-
-
-            #if $data_type.fastq_input1.is_of_type('fastqsanger') or $data_type.fastq_input1.is_of_type('fastq'):
-              ln -s '$data_type.fastq_input1' sample.fastq &&
-
-            #end if
-
-            #if $data_type.fastq_input1.is_of_type('bam'):
-              ln -s '$data_type.fastq_input1' sample.bam &&
-              #set $type='bam'
-            #end if
-
-        #end if
     ]]>
   </token>
 
@@ -97,14 +71,14 @@
         <option value="collection">Collection Paired-end Data</option>
       </param>
       <when value="single">
-        <param name="fastq_input1" type="data" format="fastqsanger, fastq,fasta,bam" label="Single end read file(s)"/>
+        <param name="seq1" type="data" format="fastqsanger,fastqsanger.gz,fastq,fastq.gz,fasta,fasta.gz,bam" label="Single end read file(s)"/>
       </when>
       <when value="paired">
-        <param name="fastq_input1" type="data" format="fastqsanger, fastq" label="Forward paired-end read file"/>
-        <param name="fastq_input2" type="data" format="fastqsanger, fastq" label="Reverse paired-end read file"/>
+        <param name="seq1" type="data" format="fastqsanger,fastqsanger.gz,fastq,fastq.gz" label="Forward paired-end read file"/>
+        <param name="seq2" type="data" format="fastqsanger,fastqsanger.gz,fastq,fastq.gz" label="Reverse paired-end read file"/>
       </when>
       <when value="collection">
-        <param name="fastq_input1" type="data_collection" label="Paired-end reads collection" optional="false" format="fastqsanger, fastq" collection_type="paired" />
+        <param name="collection1" type="data_collection" label="Paired-end reads collection" optional="false" format="fastqsanger,fastqsanger.gz,fastq,fastq.gz" collection_type="paired" />
       </when>
     </conditional>
   </xml>
--- a/mykrobe_predict.xml	Thu Jan 02 12:03:50 2020 -0500
+++ b/mykrobe_predict.xml	Tue Aug 10 11:29:58 2021 +0000
@@ -1,4 +1,4 @@
-<tool id="mykrobe_predict" name="mkyrobe predict" version="0.7.0">
+<tool id="mykrobe_predict" name="mkyrobe predict" version="@TOOL_VERSION@">
   <description>Antibiotic resistance predictions</description>
   <macros>
     <import>macro.xml</import>
@@ -9,19 +9,9 @@
         @select_inputs@
 
         mykrobe predict 
-        '${name}'
-        ${select_species.species}
-
-        #if $select_species.panel == 'custom':
-          #if $adv.custom_probe:
-            --custom_probe_set_path '${adv.custom_probe}'
-          #end if
-          #if $adv.custom_variant_to_resistance:
-            --custom_variant_to_resistance_json '${adv.custom_variant_to_resistance}'
-          #end if
-        #elif $select_species.panel:
-          --panel '${select_species.panel}'
-        #end if
+        --sample '${name}'
+        --species ${select_species.species}
+        --panel '${select_species.panel}'
 
         #if $conf_percent_cutoff:
           --conf_percent_cutoff '${conf_percent_cutoff}'
@@ -36,12 +26,14 @@
         -q
         -t "\${GALAXY_SLOTS:-1}"
 
-        -1
-        #if $type == 'fastq':
-          *.fastq
-        #else
-          *.bam
-        #end if
+        --seq
+        #if $data_type.type == "single":
+          $data_type.seq1
+        #elif $data_type.type == "paired":
+	  $data_type.seq1 $data_type.seq2
+        #elif $data_type.type == "collection":
+          $data_type.collection1.forward $data_type.collection1.reverse
+	#end if
 
         --format '${format}'
 
@@ -54,25 +46,27 @@
       <param name="species" type="select" label="Specify Species for AMR">
         <option value="tb">Mycobacterium tuberculosis (tb)</option>
         <option value="staph">Staphylococcus aureus (staph)</option>
+        <option value="sonnei">Shigella sonnei (sonnei)</option>
       </param>
       <when value="staph">
-        <param name="panel" type="select" optional="true" label="Select panel for Staph only">
-          <option value="custom">Custom</option>
+        <param name="panel" type="select" label="Select panel for Staph only">
+          <option value="20170217">20170217</option>
         </param>
       </when>
       <when value="tb">
-        <param name="panel" type="select" label="Select panel for TB only">
+	<param name="panel" type="select" label="Select panel for TB only">
+          <option value="202010">202010</option>
           <option value="201901">201901</option>
           <option value="bradley-2015">Bradely 2015</option>
-          <option value="walker-2015">Walker 2015</option>
-          <option value="custom">Custom</option>
+        </param>
+      </when>
+      <when value="sonnei">
+        <param name="panel" type="select" label="Select panel for sonnei only">
+          <option value="20210201">20210201</option>
+          <option value="20201012">20201012</option>
         </param>
       </when>
     </conditional>
-    <section name="adv" title="Custom Panel" expanded="false">
-      <param name="custom_probe" type="data" format="fasta" label="Custom Probe" optional="True" help="Don't include filtered genotypes"/>
-      <param name="custom_variant_to_resistance" type="data" format="json" label="Custom Variant to Resistance" optional="True" help="JSON file with key,value pairs of variant names and induced drug resistance."/>
-    </section>
     <param argument="--min_depth" optional="True" type="integer" min="0" label="Minimum depth"  help=""/>
     <param argument="--conf_percent_cutoff" optional="True" type="integer" label="Confidence percent cutoff" help="Number between 0 and 100. Determines --min_variant_conf, by simulating variants and choosing the cutoff that would keep x% of the variants. Default is 90 if --ont, otherwise --min_variant_conf is used as the cutoff">
       <validator type="in_range" min="0" max="100" message="Confidence percent cutoff should be between 0 and 100" />
@@ -93,7 +87,7 @@
   <tests>
     <test>
       <param name="type" value="single"/>
-      <param name="fastq_input1" value="reads.fastq"/>
+      <param name="seq1" ftype="fastq" value="reads.fastq"/>
       <param name="species" value="tb"/>
       <param name="panel" value="bradley-2015"/>
       <param name="format" value="json"/>
@@ -103,6 +97,30 @@
         </assert_contents>
       </output>
     </test>
+    <test>
+      <param name="type" value="single"/>
+      <param name="seq1" ftype="fastq" value="reads.fastq"/>
+      <param name="species" value="sonnei"/>
+      <param name="panel" value="20201012"/>
+      <param name="format" value="json"/>
+      <output name="output">
+        <assert_contents>
+          <has_text_matching expression="susceptibility"/>
+        </assert_contents>
+      </output>
+    </test>
+    <test>
+      <param name="type" value="single"/>
+      <param name="seq1" ftype="fastq.gz" value="reads.fastq.gz"/>
+      <param name="species" value="sonnei"/>
+      <param name="panel" value="20201012"/>
+      <param name="format" value="json"/>
+      <output name="output">
+        <assert_contents>
+          <has_text_matching expression="susceptibility"/>
+        </assert_contents>
+      </output>
+    </test>
   </tests>
   <help>
     @ATTRIBUTION@
Binary file test-data/reads.fastq.gz has changed