changeset 1:1592150e38d2 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/metabat2/ commit f239f2bb562330c955c19c328935793d6f1f2aa7
author iuc
date Fri, 29 Jul 2022 12:37:53 +0000
parents d27a4ed006ee
children a4441f35f17b
files jgi_summarize_bam_contig_depths.xml macros.xml
diffstat 2 files changed, 147 insertions(+), 77 deletions(-) [+]
line wrap: on
line diff
--- a/jgi_summarize_bam_contig_depths.xml	Fri Jan 28 12:21:33 2022 +0000
+++ b/jgi_summarize_bam_contig_depths.xml	Fri Jul 29 12:37:53 2022 +0000
@@ -2,81 +2,127 @@
     <description>for MetaBAT2</description>
     <macros>
         <import>macros.xml</import>
+        <xml name="use_reference">
+            <param name="use_reference" type="select" label="Select a reference genome?">
+                <option value="no" selected="true">No</option>
+                <option value="yes">Yes</option>
+            </param>
+        </xml>
+        <xml name="reference_source">
+            <param name="reference_source" type="select" label="Choose the source for the reference genome">
+                <option value="cached" selected="true">locally cached</option>
+                <option value="history">from history</option>
+            </param>
+        </xml>
+        <xml name="referenceFasta">
+            <param argument="--referenceFasta" type="data" format="fasta,fasta.gz" label="Using reference genome" help="Must be the reference used to map the input bam files"/>
+        </xml>
+        <xml name="gcWindow">
+            <param argument="--gcWindow" type="integer" value ="100" label="Sliding window size for GC calculations"/>
+        </xml>
     </macros>
     <expand macro="requirements"/>
     <command detect_errors="exit_code"><![CDATA[
-jgi_summarize_bam_contig_depths 
---outputDepth '$outputDepth'
---percentIdentity $advanced.percentIdentity
-#if str($advanced.output_paired_contigs) == 'yes':
+jgi_summarize_bam_contig_depths
+    --outputDepth '$outputDepth'
+    --percentIdentity $advanced.percentIdentity
+#if $advanced.output_paired_contigs
     --pairedContigs '$outputPairedContigs'
 #end if
-$advanced.noIntraDepthVariance
-$advanced.showDepth
---minMapQual $advanced.minMapQual
---weightMapQual $advanced.weightMapQual
-$advanced.includeEdgeBases
---maxEdgeBases $advanced.maxEdgeBases
-#if str($advanced.use_reference_cond.use_reference) == 'yes':
-    #if str($advanced.use_reference_cond.reference_cond.reference_source) == 'cached'
-        --referenceFasta '$advanced.use_reference_cond.reference_cond.referenceFasta.fields.path'
-    #else:
-        --referenceFasta '$advanced.use_reference_cond.reference_cond.referenceFasta'
+    $advanced.noIntraDepthVariance
+    $advanced.showDepth
+    --minMapQual $advanced.minMapQual
+    --weightMapQual $advanced.weightMapQual
+    $advanced.includeEdgeBases
+    --maxEdgeBases $advanced.maxEdgeBases
+#if str($mode.use_reference_cond.use_reference) == 'yes'
+    #if str($mode.use_reference_cond.reference_cond.reference_source) == 'cached'
+    --referenceFasta '$mode.use_reference_cond.reference_cond.referenceFasta.fields.path'
+    #else
+    --referenceFasta '$mode.use_reference_cond.reference_cond.referenceFasta'
     #end if
     --outputGC '$outputGC'
-    --gcWindow $advanced.use_reference_cond.gcWindow
+    --gcWindow $mode.use_reference_cond.gcWindow
     --outputReadStats '$outputReadStats'
     --outputKmers '$outputKmers'
 #end if
---shredLength $shredding.shredLength
---shredDepth $shredding.shredDepth
---minContigLength $shredding.minContigLength
---minContigDepth $shredding.minContigDepth
-#for bam_input in $bam_inputs:
+    --shredLength $shredding.shredLength
+    --shredDepth $shredding.shredDepth
+    --minContigLength $shredding.minContigLength
+    --minContigDepth $shredding.minContigDepth
+#if $mode.type == 'individual'
+    '$mode.bam_indiv_input'
+#else
+    #for $bam_input in $mode.bam_co_inputs
     '$bam_input'
-#end for
+    #end for
+#end if
     ]]></command>
     <inputs>
-        <param name="bam_inputs" type="data" format="bam" multiple="true" label="Sorted bam files"/>
+        <conditional name="mode">
+            <param name="type" type="select" label="Mode to process BAM files">
+                <option value="individual">One by one</option>
+                <option value="co">Together</option>
+            </param>
+            <when value="individual">
+                <param name="bam_indiv_input" type="data" format="bam" label="Sorted bam files"/>
+                <conditional name="use_reference_cond">
+                    <expand macro="use_reference"/>
+                    <when value="no"/>
+                    <when value="yes">
+                        <conditional name="reference_cond">
+                            <expand macro="reference_source"/>
+                            <when value="cached">
+                                <param argument="--referenceFasta" type="select" label="Using reference genome">
+                                    <options from_data_table="fasta_indexes">
+                                        <filter type="data_meta" column="1" key="dbkey" ref="bam_indiv_input"/>
+                                        <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected BAM file(s)"/>
+                                    </options>
+                                </param>
+                            </when>
+                            <when value="history">
+                                <expand macro="referenceFasta"/>
+                            </when>
+                        </conditional>
+                        <expand macro="gcWindow"/>
+                   </when>
+                </conditional>
+            </when>
+            <when value="co">
+                <param name="bam_co_inputs" type="data" format="bam" multiple="true" label="Sorted bam files"/>
+                <conditional name="use_reference_cond">
+                    <expand macro="use_reference"/>
+                    <when value="no"/>
+                    <when value="yes">
+                        <conditional name="reference_cond">
+                            <expand macro="reference_source"/>
+                            <when value="cached">
+                                <param argument="--referenceFasta" type="select" label="Using reference genome">
+                                    <options from_data_table="fasta_indexes">
+                                        <filter type="data_meta" column="1" key="dbkey" ref="bam_co_inputs"/>
+                                        <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected BAM file(s)"/>
+                                    </options>
+                                </param>
+                            </when>
+                            <when value="history">
+                                <expand macro="referenceFasta"/>
+                            </when>
+                        </conditional>
+                        <expand macro="gcWindow"/>
+                   </when>
+                </conditional>
+            </when>
+        </conditional>
         <section name="advanced" title="Advanced options">
             <param argument="--percentIdentity" type="integer" value="97" label="Minimum end-to-end percent identity of qualifying reads"/>
-            <param name="output_paired_contigs" type="select" display="radio" label="Output the sparse matrix of contigs which paired reads span?">
-                <option value="no" selected="true">No</option>
-                <option value="yes">Yes</option>
-            </param>
+            <param name="output_paired_contigs" type="boolean" checked="false" label="Output the sparse matrix of contigs which paired reads span?"/>
             <param argument="--noIntraDepthVariance" type="boolean" truevalue="--noIntraDepthVariance" falsevalue="" checked="false" label="Remove variance from mean depth along the contig?"/>
             <param argument="--showDepth" type="boolean" truevalue="--showDepth" falsevalue="" checked="false" label="Output a depth file per bam for each contig base?"/>
             <param argument="--minMapQual" type="integer" value="0" label="Minimum mapping quality necessary to count a read as mapped"/>
             <param argument="--weightMapQual" type="float" value="0.0" label="Weight per-base depth based on the MQ of the read" help="Zero value disables"/>
             <param argument="--includeEdgeBases" type="boolean" truevalue="--includeEdgeBases" falsevalue="" checked="false" label="Include 1-readlength edges when calculating depth and variance?"/>
             <param argument="--maxEdgeBases" type="integer" value="75" label="Maximum length when calculating depth and variance" help="Ignored when including 1-readlength edges when calculating depth and variance"/>
-            <conditional name="use_reference_cond">
-                <param name="use_reference" type="select" label="Select a reference genome?">
-                    <option value="no" selected="true">No</option>
-                    <option value="yes">Yes</option>
-                </param>
-                <when value="no"/>
-                <when value="yes">
-                    <conditional name="reference_cond">
-                        <param name="reference_source" type="select" label="Choose the source for the reference genome">
-                            <option value="cached" selected="true">locally cached</option>
-                            <option value="history">from history</option>
-                        </param>
-                        <when value="cached">
-                            <param argument="--referenceFasta" type="select" label="Using reference genome">
-                                <options from_data_table="fasta_indexes">
-                                    <filter type="data_meta" column="1" key="dbkey" ref="bam_inputs"/>
-                                    <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected BAM file(s)"/>
-                                </options>
-                            </param>
-                        </when>
-                        <when value="history">
-                            <param argument="--referenceFasta" type="data" format="fasta,fasta.gz" label="Using reference genome" help="Must be the reference used to map the input bam files"/>
-                        </when>
-                    </conditional>
-                    <param argument="--gcWindow" type="integer" value ="100" label="Sliding window size for GC calculations"/>
-               </when>
-            </conditional>
+
         </section>
         <section name="shredding" title="Options to control shredding contigs that are under-represented by the reads">
             <param argument="--shredLength" type="integer" value="16000" label="Maximum length of the shreds"/>
@@ -86,38 +132,53 @@
         </section>
     </inputs>
     <outputs>
-        <data name="outputDepth" format="tabular" label="${tool.name} on ${on_string} (depth matrix)"/>
-        <data name="outputPairedContigs" format="fasta" label="${tool.name} on ${on_string} (paired contigs)">
-            <filter>advanced["output_paired_contigs"] == "yes"</filter>
+        <data name="outputDepth" format="tabular" label="${tool.name} on ${on_string}: Depth matrix"/>
+        <data name="outputPairedContigs" format="fasta" label="${tool.name} on ${on_string}: Paired contigs">
+            <filter>advanced["output_paired_contigs"]</filter>
         </data>
-        <data name="outputGC" format="tabular" label="${tool.name} on ${on_string} (gc coverage histogram)">
-            <filter>advanced["use_reference_cond"]["use_reference"] == "yes"</filter>
+        <data name="outputGC" format="tabular" label="${tool.name} on ${on_string}: GC coverage histogram">
+            <filter>mode["use_reference_cond"]["use_reference"]  == 'yes'</filter>
         </data>
-        <data name="outputReadStats" format="tabular" label="${tool.name} on ${on_string} (read statistics)">
-            <filter>advanced["use_reference_cond"]["use_reference"] == "yes"</filter>
+        <data name="outputReadStats" format="tabular" label="${tool.name} on ${on_string}: Read statistics">
+            <filter>mode["use_reference_cond"]["use_reference"]  == 'yes'</filter>
         </data>
-        <data name="outputKmers" format="tabular" label="${tool.name} on ${on_string} (perfect kmer counts)">
-            <filter>advanced["use_reference_cond"]["use_reference"] == "yes"</filter>
+        <data name="outputKmers" format="tabular" label="${tool.name} on ${on_string}: Perfect kmer counts">
+            <filter>mode["use_reference_cond"]["use_reference"]  == 'yes'</filter>
         </data>
     </outputs>
     <tests>
         <!-- Single input, default settings -->
         <test expect_num_outputs="1">
-            <param name="bam_inputs" value="input1.bam" ftype="bam"/>
+            <conditional name="mode">
+                <param name="type" value="individual"/>
+                <param name="bam_indiv_input" value="input1.bam" ftype="bam"/>
+            </conditional>
             <output name="outputDepth" file="jgi_output1.tabular" ftype="tabular" compare="contains"/>
         </test>
         <!-- Multiple inputs, default settings -->
         <test expect_num_outputs="1">
-            <param name="bam_inputs" value="input1.bam,input1.bam" ftype="bam"/>
+            <conditional name="mode">
+                <param name="type" value="co"/>
+                <param name="bam_co_inputs" value="input1.bam,input1.bam" ftype="bam"/>
+            </conditional>
             <output name="outputDepth" file="jgi_output2.tabular" ftype="tabular" compare="contains"/>
         </test>
         <!-- Single input, output paired contigs, reference from history -->
         <test expect_num_outputs="5">
-            <param name="bam_inputs" value="input2.bam" ftype="bam" dbkey="89"/>
-            <param name="output_paired_contigs" value="yes"/>
-            <param name="use_reference" value="yes"/>
-            <param name="reference_source" value="history"/>
-            <param name="referenceFasta" value="NC_002945v4.fasta" ftype="fasta"/>
+            <conditional name="mode">
+                <param name="type" value="individual"/>
+                <param name="bam_indiv_input" value="input2.bam" ftype="bam" dbkey="89"/>
+                <conditional name="use_reference_cond">
+                    <param name="use_reference" value="yes"/>
+                    <conditional name="reference_cond">
+                        <param name="reference_source" value="history"/>
+                        <param name="referenceFasta" value="NC_002945v4.fasta" ftype="fasta"/>
+                    </conditional>
+                </conditional>
+            </conditional>
+            <section name="advanced">
+                <param name="output_paired_contigs" value="true"/>
+            </section>
             <output name="outputDepth" file="jgi_output_depth1.tabular" ftype="tabular" compare="contains"/>
             <output name="outputPairedContigs" file="jgi_output_paired_contigs1.fasta" ftype="fasta"/>
             <output name="outputGC" file="jgi_output_gc1.tabular" ftype="tabular"/>
@@ -126,10 +187,19 @@
         </test>
         <!-- Single input, output paired contigs, cached reference -->
         <test expect_num_outputs="5">
-            <param name="bam_inputs" value="input2.bam" ftype="bam" dbkey="89"/>
-            <param name="output_paired_contigs" value="yes"/>
-            <param name="use_reference" value="yes"/>
-            <param name="reference_source" value="cached"/>
+            <conditional name="mode">
+                <param name="type" value="individual"/>
+                <param name="bam_indiv_input" value="input2.bam" ftype="bam" dbkey="89"/>
+                <conditional name="use_reference_cond">
+                    <param name="use_reference" value="yes"/>
+                    <conditional name="reference_cond">
+                        <param name="reference_source" value="cached"/>
+                    </conditional>
+                </conditional>
+            </conditional>
+            <section name="advanced">
+                <param name="output_paired_contigs" value="true"/>
+            </section>
             <output name="outputDepth" file="jgi_output_depth1.tabular" ftype="tabular" compare="contains"/>
             <output name="outputPairedContigs" file="jgi_output_paired_contigs1.fasta" ftype="fasta"/>
             <output name="outputGC" file="jgi_output_gc1.tabular" ftype="tabular"/>
@@ -137,7 +207,7 @@
             <output name="outputKmers" file="jgi_output_kmers1.tabular" ftype="tabular"/>
         </test>
     </tests>
-    <help>
+    <help><![CDATA[
 **What it does**
 
 Calculates coverage depth for each sequence in one or more selected BAM files, producing a tabular file (for each input)
@@ -172,7 +242,7 @@
 
  * **Select a reference genome** - optionally select the reference genome that was used to map the input bam file(s) and 3 additional outputs will be produced; gc coverage histogram, read statistics and perfect kmer counts.
 
-    </help>
+ ]]></help>
     <expand macro="citations"/>
 </tool>
 
--- a/macros.xml	Fri Jan 28 12:21:33 2022 +0000
+++ b/macros.xml	Fri Jul 29 12:37:53 2022 +0000
@@ -1,6 +1,6 @@
 <macros>
     <token name="@TOOL_VERSION@">2.15</token>
-    <token name="@VERSION_SUFFIX@">0</token>
+    <token name="@VERSION_SUFFIX@">1</token>
     <token name="@PROFILE@">21.01</token>
     <xml name="requirements">
         <requirements>