diff shovill.xml @ 8:ad80238462c1 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/shovill commit 1e28eb4ffcf3d9168877c291d27e533b96021445
author iuc
date Fri, 16 Sep 2022 14:39:43 +0000
parents 2a9baa0c4316
children ee17a294d3a3
line wrap: on
line diff
--- a/shovill.xml	Thu Feb 03 20:41:04 2022 +0000
+++ b/shovill.xml	Fri Sep 16 14:39:43 2022 +0000
@@ -1,11 +1,12 @@
-<tool id="shovill" name="Shovill" version="@TOOL_VERSION@+galaxy1">
+<tool id="shovill" name="Shovill" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
     <description>Faster SPAdes assembly of Illumina reads</description>
+    <macros>
+        <token name="@TOOL_VERSION@">1.1.0</token>
+        <token name="@VERSION_SUFFIX@">1</token>
+    </macros>
     <xrefs>
         <xref type="bio.tools">shovill</xref>
     </xrefs>
-    <macros>
-        <token name="@TOOL_VERSION@">1.1.0</token>
-    </macros>
     <requirements>
         <requirement type="package" version="@TOOL_VERSION@">shovill</requirement>
     </requirements>
@@ -19,10 +20,10 @@
             #set r2_ext = $library.R2.extension
             #if $r1_ext == 'fastqsanger.gz' or $r1_ext == 'fastqsanger.bz2'
                 cp '$library.R1' fastq_r1.'$r1_ext' &&
-                cp '$library.R2' fastq_r2.'$r2_ext' && 
+                cp '$library.R2' fastq_r2.'$r2_ext' &&
             #else
                 ln -s '$library.R1' fastq_r1.'$r1_ext' &&
-                ln -s '$library.R2' fastq_r2.'$r2_ext' && 
+                ln -s '$library.R2' fastq_r2.'$r2_ext' &&
             #end if
         #else if str($library.lib_type) == "collection"
             #set r1_ext = $library.input1.forward.extension
@@ -42,13 +43,13 @@
 	## (3) Or default to 4 GB if GALAXY_MEMORY_MB is unset
 	GALAXY_MEMORY_GB=\$((\${GALAXY_MEMORY_MB:-4096}/1024)) &&
 	SHOVILL_RAM=\${SHOVILL_RAM:-\${GALAXY_MEMORY_GB}} &&
-        
+
         shovill
             --outdir 'out'
             --cpus \${GALAXY_SLOTS:-1}
             --ram \${SHOVILL_RAM:-4}
-            --R1 fastq_r1.'$r1_ext'
-            --R2 fastq_r2.'$r2_ext'
+            --R1 'fastq_r1.$(r1_ext)'
+            --R2 'fastq_r2.$(r2_ext)'
             $trim
             --namefmt '$adv.namefmt'
             --depth '$adv.depth'
@@ -61,11 +62,14 @@
             #if $adv.opts
                 --opts '$adv.opts'
             #end if
-            $adv.nocorr
             --minlen $adv.minlen
             --mincov $adv.mincov
             --assembler $assembler
-
+            #if $adv.keep_files.nocorr == 'no_correction'
+                --nocorr
+            #else
+                $adv.keep_files.keepfiles
+            #end if
     ]]></command>
     <inputs>
         <conditional name="library">
@@ -82,7 +86,6 @@
             </when>
         </conditional>
         <param name="trim" argument="--trim" type="boolean" truevalue="--trim" falsevalue="" label="Trim reads" help="Use Trimmomatic to remove common adaptors first (default: OFF)" />
-        <param name="log" type="boolean" label="Output log file?" checked="true" help="Return the Shovill log file as part of the output. Default is on" />
         <param name="assembler" argument="--assembler" type="select" label="Assembler to use" help="Which assembler would you like shovill to use, default is Spades">
             <option value="skesa">skesa</option>
             <option value="megahit">megahit</option>
@@ -104,22 +107,34 @@
             <param name="gsize" argument="--gsize" type="text" value="" label="Estimated genome size" help="An estimate of the final genome size, it will autodetect if this is blank. (default: '')" />
             <param name="kmers" argument="--kmers" type="text" value="" label="List of kmer sizes to use" help="List of K-mer sizes to use in SPAdes. Blank is AUTO. default: ''" />
             <param name="opts" argument="--opts" type="text" value="" label="Extra SPAdes options" help="eg. --plasmid --sc ... (default: '')" />
-            <param name="nocorr" argument="--nocorr" type="boolean" truevalue="--nocorr" falsevalue="" checked="True" label="Disable post-assembly correction" help="Disable post assembly correction with pilon (default: ON)" />
+            <conditional name="keep_files">
+                <param name="nocorr" argument="--nocorr" type="select" label="Disable post-assembly correction" help="Disable post assembly correction with pilon (default: ON)">
+                    <option value="no_correction" selected="true">No corrections</option>
+                    <option value="yes_correction">Post assembly corrections</option>
+                </param>
+                <when value="no_correction"/>
+                <when value="yes_correction">
+                    <param name="keepfiles" argument="--keepfiles" type="boolean" truevalue="--keepfiles"  checked="False" falsevalue=""  label="Keep bam files" help="Keep bam files only if post-assembly correction is enable"/>
+                </when>
+            </conditional>
             <param name="minlen" argument="--minlen" type="integer" value="0" label="Minimum contig length" help="Minimum length of contig to be output. 0 is AUTO (default: 0)" />
             <param name="mincov" argument="--mincov" type="integer" value="2" label="Minimum contig coverage" help="Minimum coverage to call part of a contig. 0 is AUTO (default: 2)" />
         </section>
+        <param name="log" type="boolean" label="Output log file?" checked="true" help="Return the Shovill log file as part of the output. Default is on" />
+
     </inputs>
-
     <outputs>
         <data name="shovill_std_log" format="txt" label="${tool.name} on ${on_string} Log file" from_work_dir="out/shovill.log" >
-            <filter>log</filter>
+            <filter>log == True</filter>
         </data>
-        <data format="fasta" name="contigs" label="${tool.name} on ${on_string}: Contigs" from_work_dir="out/contigs.fa"/>
-        <data format="txt" name="contigs_graph" label="${tool.name} on ${on_string}: Contig Graph" from_work_dir="out/contigs.gfa"/>
+        <data name="contigs" format="fasta" label="${tool.name} on ${on_string}: Contigs" from_work_dir="out/contigs.fa"/>
+        <data name="contigs_graph" format="txt"  label="${tool.name} on ${on_string}: Contig Graph" from_work_dir="out/contigs.gfa"/>
+        <data name="bamfiles" format="unsorted.bam" from_work_dir="out/shovill.bam" label="Bam file for ${tool.name} on ${on_string}">
+          <filter> adv['keep_files']['nocorr'] == 'yes_correction' and adv['keep_files']['keepfiles'] == True </filter>
+        </data>
     </outputs>
-
     <tests>
-        <test> <!-- Test 1: Basic test -->
+        <test expect_num_outputs="3"> <!-- Test 1: Basic test -->
             <param name="lib_type" value="paired" />
             <param name="R1" value="mutant_R1.fastq" ftype="fastqsanger" />
             <param name="R2" value="mutant_R2.fastq" ftype="fastqsanger" />
@@ -134,10 +149,10 @@
                     <has_text text="[lighter] Processed 820 reads"/>
                     <has_text text="[FLASH] FLASH v1.2.11 complete!"/>
                     <has_text text="[spades] ======= SPAdes pipeline finished."/>
-                </assert_contents>
-            </output>
+                  </assert_contents>
+                </output>
         </test>
-        <test> <!-- Test 2: Auto everything + trim + different name format test -->
+        <test expect_num_outputs="3"> <!-- Test 2: Auto everything + trim + different name format test -->
             <param name="lib_type" value="paired" />
             <param name="R1" value="mutant_R1.fastq" ftype="fastqsanger" />
             <param name="R2" value="mutant_R2.fastq" ftype="fastqsanger" />
@@ -146,7 +161,9 @@
                 <param name="depth" value="0"/>
                 <param name="minlen" value="0"/>
                 <param name="mincov" value="0"/>
-                <param name="nocorr" value="false"/>
+                <conditional name="keep_files">
+                    <param name="nocorr" value="yes_correction"/>
+                </conditional>
                 <param name="namefmt" value="contig%03d"/>
             </section>
             <output name="contigs" ftype="fasta">
@@ -166,7 +183,7 @@
                 </assert_contents>
             </output>
         </test>
-        <test> <!-- Test 3: Alternate assembler #1: Megahit -->
+        <test expect_num_outputs="3"> <!-- Test 3: Alternate assembler #1: Megahit -->
             <param name="lib_type" value="paired" />
             <param name="R1" value="mutant_R1.fastq" ftype="fastqsanger" />
             <param name="R2" value="mutant_R2.fastq" ftype="fastqsanger" />
@@ -174,7 +191,7 @@
             <output name="contigs" ftype="fasta">
                 <assert_contents>
                     <has_text text="&gt;contig00001"/>
-                </assert_contents>
+                  </assert_contents>
             </output>
             <output name="shovill_std_log" ftype="txt" >
                 <assert_contents>
@@ -185,7 +202,7 @@
                 </assert_contents>
             </output>
         </test>
-        <test> <!-- Test 4: Alternate assembler #2: Skesa -->
+        <test expect_num_outputs="3"> <!-- Test 4: Alternate assembler #2: Skesa -->
             <param name="lib_type" value="paired" />
             <param name="R1" value="mutant_R1.fastq" ftype="fastqsanger" />
             <param name="R2" value="mutant_R2.fastq" ftype="fastqsanger" />
@@ -204,7 +221,7 @@
                 </assert_contents>
             </output>
         </test>
-        <test> <!-- Test 5: Alternate assembler #3: Velvet -->
+        <test expect_num_outputs="3"> <!-- Test 5: Alternate assembler #3: Velvet -->
             <param name="lib_type" value="paired" />
             <param name="R1" value="mutant_R1.fastq" ftype="fastqsanger" />
             <param name="R2" value="mutant_R2.fastq" ftype="fastqsanger" />
@@ -223,7 +240,7 @@
                 </assert_contents>
             </output>
         </test>
-        <test> <!-- Test 6: Gzipped input with trimming -->
+        <test expect_num_outputs="3"> <!-- Test 6: Gzipped input with trimming -->
             <param name="lib_type" value="paired" />
             <param name="R1" value="mutant_R1.fastq.gz" ftype="fastqsanger.gz" />
             <param name="R2" value="mutant_R2.fastq.gz" ftype="fastqsanger.gz" />
@@ -242,29 +259,53 @@
                 </assert_contents>
             </output>
         </test>
+        <test expect_num_outputs="4"> <!-- Test 7: Add keepfiles option -->
+            <param name="lib_type" value="paired" />
+            <param name="R1" value="mutant_R1.fastq.gz" ftype="fastqsanger.gz" />
+            <param name="R2" value="mutant_R2.fastq.gz" ftype="fastqsanger.gz" />
+            <param name="trim" value="true" />
+            <section name="adv">
+                <conditional name="keep_files">
+                    <param name="nocorr" value="yes_correction" />
+                    <param name="keepfiles" value="True" />
+                </conditional>
+                <param name="log" value="true"/>
+            </section>
+            <output name="contigs" ftype="fasta">
+                <assert_contents>
+                    <has_text text="&gt;contig00001"/>
+                </assert_contents>
+            </output>
+            <output name="bamfiles" ftype="unsorted.bam">
+                <assert_contents>
+                    <has_size value="36359" delta="1000" />
+                </assert_contents>
+            </output>
+        </test>
     </tests>
     <help><![CDATA[
-Synopsis:
-  Faster de novo assembly pipeline for Illumina paired end reads based around Spades
+      Synopsis:
+      Faster de novo assembly pipeline for Illumina paired end reads based around Spades
 
-Details and options:
-    - Takes paired end Illumina fastq reads
-    - Trim reads:   Use Trimmomatic to remove common adaptors first (default: OFF)
-    - Output log file:  If set to "Yes", tool will return Shovill's log file as part of the output
-    - Assembler:    Which assembler should shovill use from: Skesa, Megahit, Velvet or Spades. Spades is the default.
+      Details and options:
+      - Takes paired end Illumina fastq reads
+      - Trim reads:   Use Trimmomatic to remove common adaptors first (default: OFF)
+      - Output log file:  If set to "Yes", tool will return Shovill's log file as part of the output
+      - Assembler:    Which assembler should shovill use from: Skesa, Megahit, Velvet or Spades. Spades is the default.
 
-Advanced options:
-    - Name format:          Format of output contig FASTA IDs in 'printf' style (default: 'contig%05d')
-    - Depth:                Sub-sample the reads to this depth. Disable with *Depth: 0* (default: 100)
-    - Estimated genomesize: An estimate of the final genome size, it will autodetect if this is blank. (default: '')
-    - List of kmers to use: List of K-mer sizes to use in SPAdes. Blank is AUTO. (default: '')
-    - Extra SPAdes options: Extra SPAdes options eg. --plasmid --sc ... (default: '')
-    - Disable post-assembly correction: Disable post assembly correction with pilon (default: ON)
-    - Minimum contig length:    Minimum length of contig to be output. 0 is AUTO (default: 0)
-    - Minimum contig coverage:  Minimum coverage to call part of a contig. 0 is AUTO (default: 2)
-    - Spades result to correct: Spades result to correct: before_rr, contigs or scaffolds (default: 'contigs')
+      Advanced options:
+      - Name format:          Format of output contig FASTA IDs in 'printf' style (default: 'contig%05d')
+      - Depth:                Sub-sample the reads to this depth. Disable with *Depth: 0* (default: 100)
+      - Estimated genomesize: An estimate of the final genome size, it will autodetect if this is blank. (default: '')
+      - List of kmers to use: List of K-mer sizes to use in SPAdes. Blank is AUTO. (default: '')
+      - Extra SPAdes options: Extra SPAdes options eg. --plasmid --sc ... (default: '')
+      - Disable post-assembly correction: Disable post assembly correction with pilon (default: ON)
+      - Keep the bam files : Enable to keep mapped files from bwa in the post assembly correction (default: OFF)
+      - Minimum contig length:    Minimum length of contig to be output. 0 is AUTO (default: 0)
+      - Minimum contig coverage:  Minimum coverage to call part of a contig. 0 is AUTO (default: 2)
+      - Spades result to correct: Spades result to correct: before_rr, contigs or scaffolds (default: 'contigs')
 
-Documentation can be found at Torsten Seemann `site <https://github.com/tseemann/shovill>`_.
+    Documentation can be found at Torsten Seemann `site <https://github.com/tseemann/shovill>`_.
     ]]></help>
     <citations>
         <citation type="bibtex">