diff snippy.xml @ 5:0aa87d97847f draft

"planemo upload commit 13d17dd18915767d3ca5bbd92ce3e5e80a287112"
author iuc
date Fri, 13 Sep 2019 05:45:21 -0400
parents feb7e635c6af
children e32aac2299fb
line wrap: on
line diff
--- a/snippy.xml	Thu Jul 11 09:41:13 2019 -0400
+++ b/snippy.xml	Fri Sep 13 05:45:21 2019 -0400
@@ -1,31 +1,22 @@
-<tool id="snippy" name="snippy" version="@VERSION@+galaxy2">
+<tool id="snippy" name="snippy" version="@VERSION@+galaxy0">
   <description>
       Snippy finds SNPs between a haploid reference genome and your NGS sequence reads.
-  </description>
-  <macros>
-      <import>macros.xml</import>
-  </macros>
-  <expand macro="requirements" />
-  <expand macro="version_command" />
+    </description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements" />
+    <expand macro="version_command" />
 
     <command detect_errors="exit_code"><![CDATA[
 
-        #if $ref.is_of_type("fasta")
-            cp '$ref' 'ref.fna' &&
-        #end if
-        #if $ref.is_of_type("genbank")
-            cp '$ref' 'ref.gbk' &&
-        #end if
+        @REFERENCE_SOURCE_FILE@
+
         snippy
             --outdir 'out'
             --cpus \${GALAXY_SLOTS:-1}
             --ram \$((\${GALAXY_MEMORY_MB:-4096}/1024))
-            #if $ref.is_of_type("fasta")
-                --ref 'ref.fna'
-            #end if
-            #if $ref.is_of_type("genbank")
-                --ref 'ref.gbk'
-            #end if
+            @REFERENCE_COMMAND@
             --mapqual $adv.mapqual
             --mincov $adv.mincov
             --minfrac $adv.minfrac
@@ -69,12 +60,10 @@
         #end if
 
 
-    ]]></command>
+    ]]>    </command>
 
     <inputs>
-
-        <param name="ref" type="data" format="fasta,genbank" label="Reference File (either in fasta or genbank format)" help="Fasta or Genbank file to use as the reference" />
-
+        <expand macro="reference_selector" />
         <conditional name="fastq_input">
             <param name="fastq_input_selector" type="select" label="Single or Paired-end reads" help="Select between paired and single end data">
                 <option value="paired">Paired</option>
@@ -115,7 +104,6 @@
             <option value="outlog" selected="False">A log file with the commands run and their outputs</option>
             <option value="outaln" selected="False">A version of the reference but with - at position with depth=0 and N for 0 to depth to --mincov (does not have variants)</option>
             <option value="outcon" selected="False">A version of the reference genome with all variants instantiated</option>
-            <option value="outdep" selected="False">Output of samtools depth for the .bam file</option>
             <option value="outbam" selected="False">The alignments in BAM format. Note that multi-mapping and unmapped reads are not present.</option>
             <option value="outzip" selected="True">Zipped files needed for input into snippy-core</option>
         </param>
@@ -145,9 +133,6 @@
         <data format="fasta" name="snpconsensus" label="${tool.name} on ${on_string} consensus fasta" from_work_dir="out/snps.consensus.fa">
             <filter>outputs and 'outcon' in outputs</filter>
         </data>
-        <data format="tabular" name="snpsdepth" label="${tool.name} on ${on_string} mapping depth" from_work_dir="out/snps.depth">
-            <filter>outputs and 'outdep' in outputs</filter>
-        </data>
         <data format="bam" name="snpsbam" label="${tool.name} on ${on_string} mapped reads (bam)" from_work_dir="out/snps.bam">
             <filter>outputs and 'outbam' in outputs</filter>
         </data>
@@ -159,8 +144,12 @@
 
     <tests>
 
-        <test> <!-- test 0 - fasta ref no snps -->
-            <param name="ref" value="reference.fasta" ftype="fasta" />
+        <test>            <!-- test 0 - fasta ref no snps -->
+            <!-- <param name="ref" value="reference.fasta" ftype="fasta" /> -->
+            <conditional name="reference_source">
+                <param name="reference_source_selector" value="history"/>
+                <param name="ref_file" value="reference.fasta" ftype="fasta"/>
+            </conditional>
             <param name="fastq_input_selector" value="paired" />
             <param name="fastq_input1" ftype="fastqsanger" value="a_1.fastq" />
             <param name="fastq_input2" ftype="fastqsanger" value="a_2.fastq" />
@@ -171,8 +160,11 @@
             <output name="snpgff" ftype="gff3" file="a_fna_ref_mincov_2_minqual_60.snps.gff" />
         </test>
 
-        <test> <!-- test 1 - fasta ref one snp -->
-            <param name="ref" value="reference.fasta" ftype="fasta" />
+        <test>            <!-- test 1 - fasta ref one snp -->
+            <conditional name="reference_source">
+                <param name="reference_source_selector" value="history"/>
+                <param name="ref_file" value="reference.fasta" ftype="fasta"/>
+            </conditional>
             <param name="fastq_input_selector" value="paired" />
             <param name="fastq_input1" ftype="fastqsanger" value="b_1.fastq" />
             <param name="fastq_input2" ftype="fastqsanger" value="b_2.fastq" />
@@ -183,8 +175,11 @@
             <output name="snpgff" ftype="gff3" file="b_fna_ref_mincov_2_minqual_60.snps.gff" />
         </test>
 
-        <test> <!-- test 2 - fasta ref one snp paired_collection -->
-            <param name="ref" value="reference.fasta" ftype="fasta" />
+        <test>            <!-- test 2 - fasta ref one snp paired_collection -->
+            <conditional name="reference_source">
+                <param name="reference_source_selector" value="history"/>
+                <param name="ref_file" value="reference.fasta" ftype="fasta"/>
+            </conditional>
             <param name="fastq_input_selector" value="paired_collection" />
             <param name="fastq_input">
                 <collection type="paired">
@@ -199,8 +194,25 @@
             <output name="snpgff" ftype="gff3" file="b_fna_ref_mincov_2_minqual_60.snps.gff" />
         </test>
 
-        <test> <!-- test 3 - fasta ref one snp single -->
-            <param name="ref" value="reference.fasta" ftype="fasta" />
+        <test>            <!-- test 3 - fasta ref one snp single -->
+            <conditional name="reference_source">
+                <param name="reference_source_selector" value="history"/>
+                <param name="ref_file" value="reference.fasta" ftype="fasta"/>
+            </conditional>
+            <param name="fastq_input_selector" value="single" />
+            <param name="fastq_input_single" value="b_2.fastq" ftype="fastqsanger" />
+            <param name="mincov" value="2" />
+            <param name="minqual" value="60" />
+            <param name="outputs" value="outgff,outsum" />
+            <output name="snpsum" ftype="tabular" file="b_fna_ref_mincov_2_minqual_60.snps.txt" lines_diff="6" />
+            <output name="snpgff" ftype="gff3" file="b_2_fna_ref_mincov_2_minqual_60.snps.gff" />
+        </test>
+
+        <test>            <!-- test 4 - reference source as cached -->
+            <conditional name="reference_source">
+                <param name="reference_source_selector" value="cached"/>
+                <param name="ref_file" value="test_id"/>
+            </conditional>
             <param name="fastq_input_selector" value="single" />
             <param name="fastq_input_single" value="b_2.fastq" ftype="fastqsanger" />
             <param name="mincov" value="2" />
@@ -247,7 +259,7 @@
 
     For a much more in depth description of snippy and how it works, see https://github.com/tseemann/snippy
 
-    ]]></help>
-  <expand macro="citations"/>
+    ]]>    </help>
+    <expand macro="citations"/>
 
 </tool>