diff metaspades.xml @ 6:a9b8c9e204ee draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/spades commit 8734db131db6f76697b500b30f18ee7723d61813"
author iuc
date Sun, 23 Jan 2022 21:33:56 +0000
parents 3ca2d2a9068c
children f338e9942b27
line wrap: on
line diff
--- a/metaspades.xml	Thu Sep 16 15:25:29 2021 +0000
+++ b/metaspades.xml	Sun Jan 23 21:33:56 2022 +0000
@@ -1,116 +1,193 @@
-<tool id="metaspades" name="metaSPAdes" version="3.9.0.1">
-    <description>assembler for metagenomics datasets</description>
-    <xrefs>
-        <xref type="bio.tools">metaspades</xref>
-    </xrefs>
-    <requirements>
-        <requirement type="package" version="3.9.0">spades</requirement>
-    </requirements>
-    <stdio>
-        <exit_code range="1:" />
-    </stdio>
-    <command>
-    <![CDATA[
+<tool id="metaspades" name="metaSPAdes" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.01">
+    <description>metagenome assembler</description>    
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements"/>
+    <expand macro="stdio"/>
+    <expand macro="version_command"/>
+    <command detect_errors="exit_code"><![CDATA[
+
+#set $library = 1
 
-    if [ -n "\$GALAXY_MEMORY_MB" ]; then
-        GALAXY_MEMORY_GB=\$(( GALAXY_MEMORY_MB / 1024 ));
-    fi &&
+@PREPROCESS_INPUT_FILES_MAIN@
+#if $additional_reads.selector == 'true'
+    @PREPROCESS_INPUT_FILES_ADDITIONAL@
+#end if
+@PREPROCESS_NANOPORE_PACBIO_FILES@
 
-    ## A real command looks like: spades.py -k 21,33,55,77,99,127 --careful -1 Y.fastq.gz -2 X.fastq.gz -t 24 -o output
-    spades.py -o . --disable-gzip-output --meta $onlyassembler -t \${GALAXY_SLOTS:-16} -m \${GALAXY_MEMORY_GB:-250}
-    #if not $kmer_choice.auto_kmer_choice:
-        -k "$kmer_choice.kmers"
-    #end if
-    ## Sequence files
-    #set num=1
-    #if str( $lib_type ) == "paired_end":
-        #set prefix = 'pe'
+## run
+metaspades.py
+    -o 'output'
+    @RESOURCES@
+    @INPUT_READS_MAIN@
+    #if $additional_reads.selector == 'true'
+        @INPUT_READS_ADDITIONAL@
     #end if
-    --$prefix$num-$orientation
-    #for $file in $files
-        #if $file.file_type.type == "separate"
-            --$prefix$num-1 fastq:$file.file_type.fwd_reads
-            --$prefix$num-2 fastq:$file.file_type.rev_reads
-        #elif $file.file_type.type == "interleaved"
-            --$prefix$num-12 fastq:$file.file_type.interleaved_reads
-        #elif $file.file_type.type == "paired-collection"
-            --$prefix$num-1 fastq:$file.file_type.fastq_collection.forward
-            --$prefix$num-2 fastq:$file.file_type.fastq_collection.reverse
-        #end if
-    #end for
-    ]]>
-    </command>
+    ## reads
+    @NANOPORE_PACBIO@
+    ## parameter
+    @KMER@
+    @PHREDOFFSET@
+    @PIPELINE_OPTIONS@
+    ## postprocessing
+    @STATS@
+    @CORRECTED@
+    ]]></command>
     <inputs>
-        <param name="onlyassembler" type="boolean" truevalue="--only-assembler" falsevalue="" checked="False" label="Run only assembly? (without read error correction)" />
-        <conditional name="kmer_choice">
-            <param name="auto_kmer_choice" type="boolean" checked="False" truevalue="true" falsevalue="false" label="Automatically choose k-mer values" help="k-mer choices can be chosen by SPAdes instead of being entered manually" />
-            <when value="false">
-                <param name="kmers" type="text" label="K-mers to use, separated by commas" value="21,33,55" help="Comma-separated list of k-mer sizes to be used (all values must be odd, less than 128, listed in ascending order, and smaller than the read length). The default value is 21,33,55." />
-            </when>
-            <when value="true" />
-        </conditional>
-        <param name="lib_type" type="select" label="Library type">
-            <option value="paired_end">Paired-end</option>
-        </param>
-        <param label="Orientation" name="orientation" type="select">
-            <option selected="true" value="fr"><![CDATA[-> <- (fr)]]></option>
-            <option value="rf"><![CDATA[<- -> (rf)]]></option>
-            <option value="ff"><![CDATA[-> -> (ff)]]></option>
-        </param>
-        <repeat name="files" title="Files" min="1">
-            <conditional name="file_type">
-                <param name="type" type="select" label="Select file format">
-                    <option value="separate">Separate input files</option>
-                    <option value="interleaved">Interleaved files</option>
-                    <option value="paired-collection">Paired List Collection</option>
-                </param>
-                <when value="separate">
-                    <param name="fwd_reads" type="data" format="fastq,fastq.gz" label="Forward reads" help="FASTQ format" />
-                    <param name="rev_reads" type="data" format="fastq,fastq.gz" label="Reverse reads" help="FASTQ format" />
-                </when>
-                <when value="interleaved">
-                    <param name="interleaved_reads" type="data" format="fastq,fastq.gz" label="Interleaved paired reads" help="FASTQ format" />
-                </when>
-                <when value="paired-collection">
-                    <param name="fastq_collection" type="data_collection" label="Paired-end reads collection" format="fastq,fastq.gz" collection_type="paired" help="FASTQ format" />
-                </when>
-            </conditional>
-        </repeat>
+        <expand macro="input_files_paired" format="fastq,fastq.gz,fastqsanger.gz" label="FASTQ file(s)"/>
+        <expand macro="input_additional_files_paired" format="fastq,fastq.gz,fastqsanger.gz" label="FASTQ file(s)"/>
+        <section name="arf" title="Additional read files">
+            <expand macro="nanopore_pacbio"/>
+        </section>
+        <section name="arf" title="Additional read files">
+            <expand macro="nanopore_pacbio"/>
+        </section>
+        <expand macro="kmer"/>
+        <expand macro="phred"/>
+        <expand macro="pipeline_options">
+            <option value="--iontorrent">Iontorrent: required when assembling IonTorrent data (--iontorrent)</option>
+        </expand>
+        <expand macro="optional_output"/>
     </inputs>
     <outputs>
-        <data name="out_contigs" format="fasta" from_work_dir="contigs.fasta" label="SPAdes contigs (fasta)" />
-        <data name="out_scaffolds" format="fasta" from_work_dir="scaffolds.fasta" label="SPAdes scaffolds (fasta)" />
-        <data name="out_fastg" format="txt" from_work_dir="assembly_graph.fastg" label="SPAdes assembly graph (fastg)" />
-        <data name="out_log" format="txt" from_work_dir="spades.log" label="SPAdes log" />
+        <expand macro="out_ag"/>
+        <expand macro="out_ags"/>
+        <expand macro="out_cn"/>
+        <expand macro="out_cp"/>
+        <expand macro="out_cr"/>
+        <expand macro="out_cs"/>
+        <expand macro="out_l"/>
+        <expand macro="out_sc"/>
+        <expand macro="out_sp"/>
+        <expand macro="out_ss"/>
     </outputs>
     <tests>
-        <test>
-            <param name="sc" value="false" />
-            <param name="careful" value="false" />
-            <param name="kmers" value="33,55" />
-            <param name="lib_type" value="paired_end" />
-            <param name="fwd_reads" value="ecoli_1K_1.fq" ftype="fastq" />
-            <param name="rev_reads" value="ecoli_1K_2.fq" ftype="fastq" />
-            <output name="out_contigs" file="reference_1K.fa" ftype="fasta" compare="re_match" lines_diff="1" />
+        <!-- #1 single, interlaced, fastq.gz, default parameters -->
+        <test expect_num_outputs="4">
+            <conditional name="singlePaired">
+                <param name="sPaired" value="paired_interlaced"/>
+                <param name="input1" value="ecoli_1K.fastq.gz"/>
+            </conditional>
+            <output name="out_ag">
+                <assert_contents>
+                    <has_n_lines n="36"/>
+                    <has_text_matching expression=">EDGE_5_length_1000_cov_140.620106'"/>
+                </assert_contents>
+            </output>
+            <output name="out_ags">
+                <assert_contents>
+                    <has_n_lines n="2"/>
+                    <has_text_matching expression="S.+"/>
+                </assert_contents>
+            </output>
+            <output name="out_cn">
+                <assert_contents>
+                    <has_n_lines n="18"/>
+                    <has_text_matching expression=">NODE\_1\_length\_1000\_cov\_.+"/>
+                </assert_contents>
+            </output>
+            <output name="out_sc">
+                <assert_contents>
+                    <has_n_lines n="18"/>
+                    <has_text_matching expression=">NODE\_1\_length\_1000.+"/>
+                </assert_contents>
+            </output>
         </test>
-        <test>
-            <param name="sc" value="false" />
-            <param name="careful" value="false" />
-            <param name="kmers" value="33,55" />
-            <param name="lib_type" value="paired_end" />
-            <param name="fwd_reads" value="ecoli_1K_1.fq.gz" ftype="fastq.gz" />
-            <param name="rev_reads" value="ecoli_1K_2.fq.gz" ftype="fastq.gz" />
-            <output name="out_contigs" file="reference_1K.fa" ftype="fasta" compare="re_match" lines_diff="1" />
+        <!-- #2 single, separate, fastq, default parameters -->
+        <test expect_num_outputs="4">
+            <conditional name="singlePaired">
+                <param name="sPaired" value="paired"/>
+                <param name="input1" value="ecoli_1K_1.fastq.gz"/>
+                <param name="input2" value="ecoli_1K_2.fastq.gz"/>
+            </conditional>
+            <output name="out_ag">
+                <assert_contents>
+                    <has_n_lines n="36"/>
+                    <has_text_matching expression=">EDGE_5_length_1000_cov_140.620106'"/>
+                </assert_contents>
+            </output>
+            <output name="out_ags">
+                <assert_contents>
+                    <has_n_lines n="2"/>
+                    <has_text_matching expression="S.+"/>
+                </assert_contents>
+            </output>
+            <output name="out_cn">
+                <assert_contents>
+                    <has_n_lines n="18"/>
+                    <has_text_matching expression=">NODE\_1\_length\_1000\_cov\_.+"/>
+                </assert_contents>
+            </output>
+            <output name="out_sc">
+                <assert_contents>
+                    <has_n_lines n="18"/>
+                    <has_text_matching expression=">NODE\_1\_length\_1000.+"/>
+                </assert_contents>
+            </output>
         </test>
+        <!-- #3 only corrected reads are created as an output -->
+        <test expect_num_outputs="2">
+            <conditional name="singlePaired">
+                <param name="sPaired" value="paired_interlaced"/>
+                <param name="input1" value="ecoli_1K.fastq.gz"/>
+            </conditional>
+            <param name="optional_output" value="cr,l"/>
+            <output_collection name="out_cr" type="list" count="3">
+                <element name="ecoli_1K.fastq.gz_1.00.0_0.cor">
+                    <assert_contents>
+                        <has_size value="130317" delta="1000"/>
+                    </assert_contents>
+                </element>
+                <element name="ecoli_1K.fastq.gz_2.00.0_0.cor">
+                    <assert_contents>
+                        <has_size value="130317" delta="1000"/>
+                    </assert_contents>
+                </element>
+                <element name="ecoli_1K.fastq.gz__unpaired.00.0_0.cor">
+                    <assert_contents>
+                        <has_size value="20" delta="5"/>
+                    </assert_contents>
+                </element>
+            </output_collection>
+            <output name="out_l">
+                <assert_contents>
+                    <has_text_matching expression="Thank you for using SPAdes!"/>
+                </assert_contents>
+            </output>
+        </test>       
     </tests>
-    <help>
-<![CDATA[
+    <help><![CDATA[
+.. class:: infomark
+
 **What it does**
 
-SPAdes – St. Petersburg genome assembler – is intended for both standard isolates and single-cell MDA bacteria assemblies. See http://bioinf.spbau.ru/en/spades for more details on SPAdes.
-]]>
-    </help>
-    <citations>
-        <citation type="doi">10.1089/cmb.2012.0021</citation>
-    </citations>
+@HELP_WID@
+
+metaSPAdes is a subtool for assembling metagenomic data sets.
+
+**Input**
+
+@HELP_IN@
+
+**Output**
+
+@HELP_OUT_AG@
+@HELP_OUT_AGS@
+@HELP_OUT_C@
+@HELP_OUT_CP@
+@HELP_OUT_CR@
+@HELP_OUT_CS@
+@HELP_OUT_L@
+@HELP_OUT_S@
+@HELP_OUT_SP@
+@HELP_OUT_SS@
+
+**References**
+
+More information can be found on `github <https://github.com/ablab/spades>`_ and on the `project website <http://cab.spbu.ru/software/meta-spades>`_.
+    ]]></help>
+    <expand macro="citations">
+        <citation type="doi">10.1101/gr.213959.116</citation>
+    </expand>
 </tool>