changeset 2:2a8bc1d26d06 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/metawrapmg commit 26fe7d23c5c3981c9b737109e5db799cc5d23932
author iuc
date Thu, 11 Apr 2024 21:56:14 +0000
parents e3a64a1d2a6e
children
files macros.xml metawrapmg_binning.xml
diffstat 2 files changed, 74 insertions(+), 73 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Mon Jan 30 22:30:51 2023 +0000
+++ b/macros.xml	Thu Apr 11 21:56:14 2024 +0000
@@ -1,6 +1,6 @@
 <macros>
     <token name="@TOOL_VERSION@">1.3.0</token>
-    <token name="@VERSION_SUFFIX@">0</token>
+    <token name="@VERSION_SUFFIX@">1</token>
     <token name="@PROFILE@">22.05</token>
     <xml name="requirements">
         <requirements>
--- a/metawrapmg_binning.xml	Mon Jan 30 22:30:51 2023 +0000
+++ b/metawrapmg_binning.xml	Thu Apr 11 21:56:14 2024 +0000
@@ -6,100 +6,97 @@
     <expand macro="xrefs"/>
     <expand macro="requirements"/>
     <command detect_errors="exit_code"><![CDATA[
-            ## set memory usage
-            if [ -n "\$GALAXY_MEMORY_MB" ] ; then
-                GALAXY_MEMORY_GB=\$((GALAXY_MEMORY_MB / 1024)) ;
-            fi ;
+        ## set memory usage
+        if [ -n "\${GALAXY_MEMORY_MB}" ] ; then
+            export GALAXY_MEMORY_GB="\$((GALAXY_MEMORY_MB / 1024))" ;
+        fi ;
 
-            ##################
-            ## SET UP FILES ##
-            ##################
-
-            ## should always be FASTA
-            #set mg_fn = 'metagenome.' + str($metagenome.ext)
-            ln -s '$metagenome' $mg_fn
-            &&
+        ##################
+        ## SET UP FILES ##
+        ##################
 
-            ## Only FASTQ. Separate files for each sample. Metawrap checks for
-            ## files named _1.fastq and _2.fastq.
-            #set input1_fn = 'reads_1.fastq'
-            ln -s '$input_1' $input1_fn
-            &&
+        ## only plain FASTA and FASTQ
+        ln -s '$metagenome' metagenome.fasta
+        &&
+        ## Metawrap checks for files named _1.fastq and _2.fastq.
+        ln -s '$input_1' reads_1.fastq
+        &&
+        ln -s '$input_2' reads_2.fastq
+        &&
 
-            #set input2_fn = 'reads_2.fastq'
-            ln -s '$input_2' $input2_fn
-            &&
-
-            #####################
-            ## INITIAL BINNING ##
-            #####################
+        #####################
+        ## INITIAL BINNING ##
+        #####################
 
-            metawrap binning 
-            --metabat2 --maxbin2 --concoct 
-            -a '$mg_fn'
-            -m \${GALAXY_MEMORY_GB:-16}
-            -o INITIAL_BINNING
-            -t \${GALAXY_SLOTS:-4}
-            '$input1_fn'
-            '$input2_fn'
-            &&
+        metawrap binning 
+        --metabat2 --maxbin2 --concoct 
+        -a metagenome.fasta
+        -m "\${GALAXY_MEMORY_GB:-16}"
+        -o INITIAL_BINNING
+        -t "\${GALAXY_SLOTS:-4}"
+        reads_1.fastq
+        reads_2.fastq
+        &&
 
-            ## Check which binning programs produced bins            
-            bin_dirs=(INITIAL_BINNING/concoct_bins INITIAL_BINNING/maxbin2_bins INITIAL_BINNING/metabat2_bins) &&
-            switches=('-A' '-B' '-C') &&
+        ## Check which binning programs produced bins            
+        bin_dirs=(INITIAL_BINNING/concoct_bins INITIAL_BINNING/maxbin2_bins INITIAL_BINNING/metabat2_bins) &&
+        switches=('-A' '-B' '-C') &&
 
-            i=0 &&
-            bin_string="" &&
+        i=0 &&
+        bin_string="" &&
 
-            for dir in "\${bin_dirs[@]}" ; do
-                if find "\${dir}" -mindepth 1 -maxdepth 1 | read; then
-                    bin_string="\${bin_string} \${switches[\$i]} \${dir}" ;
-                    i+=1 ;
-                fi
-            done &&
+        for dir in "\${bin_dirs[@]}" ; do
+            if [ "\$(find "\$dir" -mindepth 1 -maxdepth 1 -exec echo found \;)" ]; then
+                bin_string+=" \${switches[\$i]} \$dir" ;
+                ((i++)) ;
+            fi
+        done &&
 
-            ####################
-            ## BIN REFINEMENT ##
-            ####################
+        ####################
+        ## BIN REFINEMENT ##
+        ####################
 
-            ## The checkm database is included in the conda package.
-            ## Requires metawrap-mg_1.3.0--hdfd78af_1 or later. See
-            ## https://github.com/bioconda/bioconda-recipes/pull/38299.
+        ## The checkm database is in the conda package, see
+        ## https://github.com/bioconda/bioconda-recipes/pull/38299.
 
-            metawrap bin_refinement
-            -t \${GALAXY_SLOTS:-4}
-            -m \${GALAXY_MEMORY_GB:-16}
-            -c $binning.c
-            -x $binning.x
-            -o BIN_REFINEMENT
-            ## Only run bin_refinement on bins with contigs
-            \${bin_string}
+        metawrap bin_refinement
+        -t "\${GALAXY_SLOTS:-4}"
+        -m "\${GALAXY_MEMORY_GB:-16}"
+        '$hidden_quick'
+        -c '${binning.c}'
+        -x '${binning.x}'
+        -o BIN_REFINEMENT
+        ## Only run bin_refinement on bins with contigs
+        "\${bin_string}"
     ]]></command>
     <inputs>
-        <param name="metagenome" format="fasta" type="data" label="Metagenome" help="Metagenome co-assembly for binning" />
-        <param name="input_1" format="fastqsanger" type="data" label="Read 1" help="Original reads that were used for the assembly: read 1." />
-        <param name="input_2" format="fastqsanger" type="data" label="Read 2" help="Original reads that were used for the assembly: read 2." />
+        <param name="metagenome" format="fasta" type="data" label="Metagenome" help="Metagenome co-assembly for binning"/>
+        <param name="input_1" format="fastqsanger" type="data" label="Read 1" help="Original reads that were used for the assembly: read 1."/>
+        <param name="input_2" format="fastqsanger" type="data" label="Read 2" help="Original reads that were used for the assembly: read 2."/>
         <section name="binning" title="Binning parameters" expanded="false">
-            <param argument='-c' type="integer" value="70" min="50" max="100" label="Percent completion" help="Minimum % completion of bins" />
-            <param argument='-x' type="integer" value="10" min="0" max="100" label="Percent contamination" help="Maximum % contamination of bins that is acceptable" />
+            <param argument="-c" type="integer" value="70" min="50" max="100" label="Percent completion" help="Minimum % completion of bins"/>
+            <param argument="-x" type="integer" value="10" min="0" max="100" label="Percent contamination" help="Maximum % contamination of bins that is acceptable"/>
         </section>
+        <!-- the pplacer component requires 40 GB per thread. Skip pplacer for
+         testing by setting this to "quick" -->
+        <param name="hidden_quick" type="hidden" value=""/>
     </inputs>
     <outputs>
         <!-- contigs binned into fasta files -->
         <collection name="metawrap_bins" type="list" label="MetaWRAP on ${on_string}: bins">
-            <discover_datasets pattern="metawrap_\d+_\d+_bins/(?P&lt;designation&gt;.+)\.fa" format="fasta" directory="BIN_REFINEMENT" recurse="true" match_relative_path="true" visible="false" />
+            <discover_datasets pattern="metawrap_\d+_\d+_bins/(?P&lt;designation&gt;.+)\.fa" format="fasta" directory="BIN_REFINEMENT" recurse="true" match_relative_path="true"/>
         </collection>
         <!-- summary figures -->
         <collection name="metawrap_figures" type="list" label="MetaWRAP on ${on_string}: summary figures">
-            <discover_datasets pattern="__designation_and_ext__" directory="BIN_REFINEMENT/figures" visible="false" />
+            <discover_datasets pattern="__designation_and_ext__" directory="BIN_REFINEMENT/figures"/>
         </collection>
         <!-- statistics on binning -->
         <collection name="metawrap_stats" type="list" label="MetaWRAP on ${on_string}: stat files">
-            <discover_datasets pattern="(?P&lt;designation&gt;.+)\.stats" format="tabular" directory="BIN_REFINEMENT" visible="false" />
+            <discover_datasets pattern="(?P&lt;designation&gt;.+)\.stats" format="tabular" directory="BIN_REFINEMENT"/>
         </collection>
         <!-- which contig went into which bin -->
         <collection name="metawrap_contigs" type="list" label="MetaWRAP on ${on_string}: contig assignments">
-            <discover_datasets pattern="(?P&lt;designation&gt;.+)\.contigs" format="tabular" directory="BIN_REFINEMENT" visible="false" />
+            <discover_datasets pattern="(?P&lt;designation&gt;.+)\.contigs" format="tabular" directory="BIN_REFINEMENT"/>
         </collection>
     </outputs>
     <tests>
@@ -110,10 +107,14 @@
             <param name="input_2" value="mapped_reads.r2.fastq.gz"/>
             <param name="c" value="60"/>
             <param name="x" value="15"/>
-            <!-- this is the main output, but it's too large to test -->
-            <!-- <output_collection name="metawrap_bins" type="list">
-                <element name="bin.1" file="test02.fa" ftype="fasta"/>
-            </output_collection> -->
+            <param name="hidden_quick" value="--quick"/>
+            <output_collection name="metawrap_bins" type="list">
+                <element name="bin.1" ftype="fasta">
+                    <assert_contents>
+                        <has_text text="NODE_2_length_"/>
+                    </assert_contents>
+                </element>
+            </output_collection>
             <output_collection name="metawrap_stats" type="list">
                 <element name="metawrap_60_15_bins" file="test02.stats" ftype="tabular"/>
             </output_collection>
@@ -122,7 +123,7 @@
             </output_collection>
         </test>
     </tests>
-        <help><![CDATA[
+    <help><![CDATA[
 MetaWRAP
 --------