view macros.xml @ 9:e731ea24e48d draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/spades commit b7b09cff3ddcdf26f27aabfcf41a8ce0a3985d87"
author iuc
date Wed, 09 Feb 2022 18:58:03 +0000
parents 7c55feb65057
children eb7a370f6588
line wrap: on
line source

<macros>
    <token name="@TOOL_VERSION@">3.15.3</token>
    <token name="@VERSION_SUFFIX@">2</token>
    <xml name="requirements">
        <requirements>
            <requirement type="package" version="@TOOL_VERSION@">spades</requirement>
            <requirement type="package" version="3.0">zip</requirement>
            <yield/>
        </requirements>
    </xml>
    <xml name="stdio">
        <stdio>
            <exit_code range="1:"/>
            <regex match="Cannot allocate memory"
               source="stdout"
               level="fatal_oom"
               description="Out of memory error occurred"/>
            <regex match="The reads contain too many k-mers to fit into available memory"
               source="stdout"
               level="fatal_oom"
               description="Out of memory error occurred"/>
        </stdio>
    </xml>
    <xml name="version_command">
        <version_command><![CDATA[spades.py --version 2>&1 | awk -F 'v' '{print $2}']]></version_command>
    </xml>
    <token name="@INTYPES@">
        
    </token>
    <xml name="citations">
        <citations>
            <citation type="doi">10.1093/bioinformatics/btv688</citation>
            <citation type="doi">10.1093/bioinformatics/btu266</citation>
            <citation type="doi">10.1093/bioinformatics/btv337</citation>
            <yield/>
          </citations>
    </xml>
    <xml name="operation_mode" token_help="">
        <param name="operation_mode" type="select" label="Operation mode" help="@HELP@">
            <option value="">Assembly and error correction</option>
            <option value="--only-assembler">Only assembler (--only-assembler)</option>
            <option value="--only-error-correction">Only error correction (--only-error-correction)</option>
        </param>
    </xml>
    

<!-- PREPARE INPUT FILES-->

<token name="@PREPROCESS_INPUT_FILES_MAIN@"><![CDATA[
#if $singlePaired.sPaired == "single" or $singlePaired.sPaired == "paired_interlaced"
    mkdir -p reads1 &&
    #set file_paths1 = []
    #for $input_file in $singlePaired.input1
        #set $ext = $input_file.ext.replace('fastqsanger', 'fastq')
        #set $fname = $input_file.element_identifier.replace(" ","_") + '.' + $ext
        #set $file_path = 'reads1/' + $fname
        ln -s '$input_file' '$file_path' &&
        $file_paths1.append($file_path)
    #end for
#else if $singlePaired.sPaired == "paired"
    mkdir -p paired_reads1 &&
    #set fw_reads1 = []
    #for $input_file in $singlePaired.input1
        #set $ext = $input_file.ext.replace('fastqsanger', 'fastq')
        #set $fname = $input_file.element_identifier.replace(" ","_") + '.' + $ext
        #set $file_path = 'paired_reads1/' + str($fname)
        ln -s '$input_file' '$file_path' &&
        $fw_reads1.append($file_path)
    #end for
    #set rv_reads1 = []
    #for $input_file in $singlePaired.input2
        #set $ext = $input_file.ext.replace('fastqsanger', 'fastq')
        #set $fname = $input_file.element_identifier.replace(" ","_") + '.' + $ext
        #set $file_path = 'paired_reads1/' + str($fname)
        ln -s '$input_file' '$file_path' &&
        $rv_reads1.append($file_path)
    #end for
    #silent $fw_reads1.sort()
    #silent $rv_reads1.sort()
#else
    mkdir -p paired_reads1 &&
    #set fw_reads1 = []
    #set rv_reads1 = []
    #for $i, $input_file in enumerate($singlePaired.input)
        #set $ext = $input_file.forward.ext.replace('fastqsanger', 'fastq')
        #set $file_path = 'paired_reads1/fw' + str($i) + '.' + $ext
        ln -s '$input_file.forward' '$file_path' &&
        $fw_reads1.append($file_path)
        #set $file_path = 'paired_reads1/rv' + str($i) + '.' + $ext
        ln -s '$input_file.reverse' '$file_path' &&
        $rv_reads1.append($file_path)
    #end for
#end if
]]></token>

<token name="@PREPROCESS_INPUT_FILES_ADDITIONAL@"><![CDATA[
#if $additional_reads.singlePaired.sPaired == "single" or $additional_reads.singlePaired.sPaired == "paired_interlaced"
    mkdir -p reads2 &&
    #set file_paths2 = []
    #for $input_file in $additional_reads.singlePaired.input1
        #set $ext = $input_file.ext.replace('fastqsanger', 'fastq')
        #set $fname = $input_file.element_identifier.replace(" ","_") + '.' + $ext
        #set $file_path = 'reads2/' + $fname
        ln -s '$input_file' '$file_path' &&
        $file_paths2.append($file_path)
    #end for
#else if $additional_reads.singlePaired.sPaired == "paired"
    mkdir -p paired_reads2 &&
    #set fw_reads2 = []
    #for $input_file in $additional_reads.singlePaired.input1
        #set $ext = $input_file.ext.replace('fastqsanger', 'fastq')
        #set $fname = $input_file.element_identifier.replace(" ","_") + '.' + $ext
        #set $file_path = 'paired_reads2/' + str($fname)
        ln -s '$input_file' '$file_path' &&
        $fw_reads2.append($file_path)
    #end for
    #set rv_reads2 = []
    #for $input_file in $additional_reads.singlePaired.input2
        #set $ext = $input_file.ext.replace('fastqsanger', 'fastq')
        #set $fname = $input_file.element_identifier.replace(" ","_") + '.' + $ext
        #set $file_path = 'paired_reads2/' + str($fname)
        ln -s '$input_file' '$file_path' &&
        $rv_reads2.append($file_path)
    #end for
    #silent $fw_reads2.sort()
    #silent $rv_reads2.sort()
#else
    mkdir -p paired_reads2 &&
    #set fw_reads2 = []
    #set rv_reads2 = []
    #for $i, $input_file in enumerate($additional_reads.singlePaired.input)
        #set $ext = $input_file.forward.ext.replace('fastqsanger', 'fastq')
        #set $file_path = 'paired_reads2/fw' + str($i) + '.' + $ext
        ln -s '$input_file.forward' '$file_path' &&
        $fw_reads2.append($file_path)
        #set $file_path = 'paired_reads2/rv' + str($i) + '.' + $ext
        ln -s '$input_file.reverse' '$file_path' &&
        $rv_reads2.append($file_path)
    #end for
#end if
]]></token>

<!-- COMMANDS -->

<token name="@RESOURCES@"><![CDATA[
-t \${GALAXY_SLOTS:-4}
-m \$((\${GALAXY_MEMORY_MB:-8192}/1024))
]]></token>

<token name="@INPUT_READS_MAIN@"><![CDATA[
#if $singlePaired.sPaired == "single"
    #for $read in $file_paths1
        --s $library '${read}'
    #end for
#else if  $singlePaired.sPaired == "paired"
    #for $read in $fw_reads1
        --${singlePaired.type_paired}-1 $library '${read}'
    #end for
    #for $read in $rv_reads1
        --${singlePaired.type_paired}-2 $library '${read}'
        --${singlePaired.type_paired}-or $library $singlePaired.orientation
    #end for
#else if $singlePaired.sPaired == "paired_interlaced"
    #for $read in $file_paths1
        --${singlePaired.type_paired}-12 $library '${read}'
        --${singlePaired.type_paired}-or $library $singlePaired.orientation
    #end for
#else
    #for $read in $fw_reads1
        --${singlePaired.type_paired}-1 $library '${read}'
    #end for
    #for $read in $rv_reads1
        --${singlePaired.type_paired}-2 $library '${read}'
        --${singlePaired.type_paired}-or $library $singlePaired.orientation
    #end for
#end if
]]></token>


<token name="@INPUT_READS_ADDITIONAL@"><![CDATA[
@LIBRARY_NUMBER@
#if $additional_reads.singlePaired.sPaired == "single"
    #for $read in $file_paths2
        --s $library '${read}'
    #end for
#else if  $additional_reads.singlePaired.sPaired == "paired"
    #for $read in $fw_reads2
        --${additional_reads.singlePaired.type_paired}-1 $library '${read}'
    #end for
    #for $read in $rv_reads2
        --${additional_reads.singlePaired.type_paired}-2 $library '${read}'
        --${additional_reads.singlePaired.type_paired}-or $library $additional_reads.singlePaired.orientation
    #end for
#else if $additional_reads.singlePaired.sPaired == "paired_interlaced"
    #for $read in $file_paths2
        --${additional_reads.singlePaired.type_paired}-12 $library '${read}'
        --${additional_reads.singlePaired.type_paired}-or $library $additional_reads.singlePaired.orientation
    #end for
#else
    #for $read in $fw_reads2
        --${additional_reads.singlePaired.type_paired}-1 $library '${read}'
    #end for
    #for $read in $rv_reads2
        --${additional_reads.singlePaired.type_paired}-2 $library '${read}'
        --${additional_reads.singlePaired.type_paired}-or $library $additional_reads.singlePaired.orientation
    #end for
#end if
]]></token>

<token name="@PIPELINE_OPTIONS@"><![CDATA[
#for $i in $mode_sel
    $i
#end for
]]></token>

<token name="@KMER@"><![CDATA[
#if $kmer_cond.kmer_sel != 'auto'
    -k '$kmer_cond.manual'
#end if
]]></token>

<token name="@PHREDOFFSET@"><![CDATA[
#if $phred_offset != 'auto'
    --phred-offset $phred_offset
#end if
]]></token>

<!-- ADDITIONAL INPUTS-->

<token name="@PREPROCESS_CONTIGS_FILES@"><![CDATA[
#if $arf.trusted_contigs
    mkdir -p trusted_contigs &&
    #set trusted_contigs = []
    #for $i, $input_file in enumerate($arf.trusted_contigs,1)
        #set $ext = $input_file.ext.replace('fastqsanger', 'fastq')
        #set $fname = 'file' + str($i) + '.' + $ext
        #set $file_path = 'trusted_contigs/' + $fname
        ln -s '$input_file' '$file_path' &&
        $trusted_contigs.append($file_path)
    #end for
#end if
#if $arf.untrusted_contigs
    mkdir -p untrusted_contigs &&
    #set untrusted_contigs = []
    #for $i, $input_file in enumerate($arf.untrusted_contigs,1)
        #set $ext = $input_file.ext.replace('fastqsanger', 'fastq')
        #set $fname = 'file' + str($i) + '.' + $ext
        #set $file_path = 'untrusted_contigs/' + $fname
        ln -s '$input_file' '$file_path' &&
        $untrusted_contigs.append($file_path)
    #end for
#end if
]]></token>

<token name="@PREPROCESS_NANOPORE_PACBIO_FILES@"><![CDATA[
#if $arf.nanopore
    mkdir -p nanopore_reads &&
    #set nanopore_reads = []
    #for $i, $input_file in enumerate($arf.nanopore,1)
        #set $ext = $input_file.ext.replace('fastqsanger', 'fastq')
        #set $fname = 'file' + str($i) + '.' + $ext
        #set $file_path = 'nanopore_reads/' + $fname
        ln -s '$input_file' '$file_path' &&
        $nanopore_reads.append($file_path)
    #end for
#end if
#if $arf.pacbio
    mkdir -p pacbio_reads &&
    #set pacbio_reads = []
    #for $i, $input_file in enumerate($arf.pacbio,1)
        #set $ext = $input_file.ext.replace('fastqsanger', 'fastq')
        #set $fname = 'file' + str($i) + '.' + $ext
        #set $file_path = 'pacbio_reads/' + $fname
        ln -s '$input_file' '$file_path' &&
        $pacbio_reads.append($file_path)
    #end for
#end if
]]></token>

<token name="@PREPROCESS_SANGER_FILES@"><![CDATA[
    #if $arf.sanger
        mkdir -p sanger_reads &&
        #set sanger_reads = []
        #for $i, $input_file in enumerate($arf.sanger,1)
            #set $ext = $input_file.ext.replace('fastqsanger', 'fastq')
            #set $fname = 'file' + str($i) + '.' + $ext
            #set $file_path = 'sanger_reads/' + $fname
            ln -s '$input_file' '$file_path' &&
            $sanger_reads.append($file_path)
        #end for
    #end if
]]></token>

<token name="@PREPROCESS_FL_RNA_FILES@"><![CDATA[
    #if $arf.flrna
        mkdir -p flrna_reads &&
        #set flrna_reads = []
        #for $i, $input_file in enumerate($arf.flrna,1)
            #set $ext = $input_file.ext.replace('fastqsanger', 'fastq')
            #set $fname = 'file' + str($i) + '.' + $ext
            #set $file_path = 'flrna_reads/' + $fname
            ln -s '$input_file' '$file_path' &&
            $flrna_reads.append($file_path)
        #end for
    #end if
]]></token>

<token name="@PREPROCESS_ASSEMBLY_GRAPH_FILES@"><![CDATA[
    #if $arf.assembly_graph
        mkdir -p assembly_graphs &&
        #set assembly_graphs = []
        #for $i, $input_file in enumerate($arf.assembly_graph,1)
            #set $ext = $input_file.ext.replace('gfa1', 'gfa')
            #set $fname = 'file' + str($i) + '.' + $ext
            #set $file_path = 'assembly_graphs/' + $fname
            ln -s '$input_file' '$file_path' &&
            $assembly_graphs.append($file_path)
        #end for
    #end if
]]></token>


<token name="@NANOPORE_PACBIO@"><![CDATA[
#if $arf.nanopore
    #for $read in $nanopore_reads
        --nanopore $read
    #end for
#end if
#if $arf.pacbio
    #for $read in $pacbio_reads
        --pacbio $read
    #end for
#end if
]]></token>


<token name="@SANGER@"><![CDATA[
#if $arf.sanger
    #for $read in $sanger_reads
        --sanger $read
    #end for
#end if
]]></token>

<token name="@FL_RNA@"><![CDATA[
#if $arf.flrna
    #for $read in $flrna_reads
        --fl-rna $read
    #end for
#end if
]]></token>

<token name="@ASSEMBLY_GRAPH@"><![CDATA[
#if $arf.assembly_graph
    #for $graph in $assembly_graphs
        --assembly-graph $graph
    #end for
#end if
]]></token>

<token name="@CONTIGS@"><![CDATA[
#if $arf.trusted_contigs
    #for $read in $trusted_contigs
        --trusted-contigs $read
    #end for
#end if
#if $arf.untrusted_contigs
    #for $read in $untrusted_contigs
        --untrusted-contigs $read
    #end for
#end if
]]></token>

<token name="@LIBRARY_NUMBER@"><![CDATA[
#if $additional_reads.selector == 'true' and  $additional_reads.library_number == 'false'
    #set $library += 1
#end if
]]></token>

<!-- POSTPROCESSING -->

<token name="@STATS@"><![CDATA[
#if 'cs' in $optional_output
    && test -f 'output/contigs.fasta' && python '$__tool_directory__/write_tsv_script.py' < 'output/contigs.fasta' > '$out_cs' || echo 'No contigs.fasta.'
#end if
#if 'ss' in $optional_output
    && test -f 'output/scaffolds.fasta' && python '$__tool_directory__/write_tsv_script.py' < 'output/scaffolds.fasta' > '$out_ss' || echo 'No scaffolds.fasta.'
#end if
]]></token>

<token name="@CORRECTED@"><![CDATA[
    #if 'corrected' in $optional_output
        && test -d 'output/corrected' && zip -q -r 'corrected.zip' 'output/corrected/*.fastq.gz' || echo 'No output files for corrected reads.'
    #end if
]]></token>

    <!--
      input
    -->

    <xml name="input_files_all" token_format="" token_label="" token_help="It assumes that all samples belong to the same library. If you want to use samples from two different libraries, include the second library as additional set of short-reads.">
        <conditional name="singlePaired">
            <param name="sPaired" type="select" label="Single-end or paired-end short-reads" help="@HELP@">
                <option value="single" selected="true">Single-end</option>
                <option value="paired">Paired-end: individual datasets</option>
                <option value="paired_interlaced">Paired-end: interlaced reads</option>
                <option value="paired_collection">Paired-end: list of dataset pairs</option>
            </param>
            <when value="single">
                <param format="@FORMAT@" name="input1" type="data"  multiple="true" label="@LABEL@"/>
            </when>
            <when value="paired">
                <param format="@FORMAT@" name="input1" type="data" multiple="true" label="@LABEL@: forward reads"/>
                <param format="@FORMAT@" name="input2" type="data" multiple="true" label="@LABEL@: reverse reads"/>
                <expand macro="type_paired"/>
                <expand macro="orientation"/>
            </when>
            <when value="paired_interlaced">
                <param format="@FORMAT@" name="input1" type="data"  multiple="true" label="@LABEL@: interlaced"/>
                <expand macro="type_paired"/>
                <expand macro="orientation"/>
            </when>
            <when value="paired_collection">
                <param format="@FORMAT@" name="input" type="data_collection" collection_type="list:paired" label="@LABEL@: collection"/>
                <expand macro="type_paired"/>
                <expand macro="orientation"/>
            </when>
        </conditional>
    </xml>

    <xml name="input_files_paired" token_format="" token_label="" token_help="It assumes that all samples belong to the same library. If you want to use samples from two different libraries, include the second library as additional set of short-reads.">
        <conditional name="singlePaired">
            <param name="sPaired" type="select" label="Pair-end reads input format" help="@HELP@">
                <option value="paired" selected="true">Paired-end: individual datasets</option>
                <option value="paired_interlaced">Paired-end: interlaced reads</option>
                <option value="paired_collection">Paired-end: list of dataset pairs</option>
            </param>
            <when value="paired">
                <param format="@FORMAT@" name="input1" type="data" multiple="true" label="@LABEL@: forward reads"/>
                <param format="@FORMAT@" name="input2" type="data" multiple="true" label="@LABEL@: reverse reads"/>
                <expand macro="type_paired"/>
                <expand macro="orientation"/>
            </when>
            <when value="paired_interlaced">
                <param format="@FORMAT@" name="input1" type="data"  multiple="true" label="@LABEL@: interlaced"/>
                <expand macro="type_paired"/>
                <expand macro="orientation"/>
            </when>
            <when value="paired_collection">
                <param format="@FORMAT@" name="input" type="data_collection" collection_type="list:paired" label="@LABEL@: collection"/>
                <expand macro="type_paired"/>
                <expand macro="orientation"/>
            </when>
        </conditional>
        <param name="library_number" type="select" label="The samples belong to the same library" help="If the reads have been generated from the same sample, it means that they belong to the same library.">
            <option value="true" selected="true">True</option>
            <option value="false">False</option>
        </param>
    </xml>

    <xml name="orientation">
        <param name="orientation" type="select" label="Select orientation of reads" help="Note: mate-pair fragments are generally in a RF conformation. In general, paired-end reads tend to be in a FR orientation.">
            <option value="fr" selected="true"><![CDATA[FR (-> <-)]]></option>
            <option value="rf"><![CDATA[RF (<- ->)]]></option>
            <option value="ff"><![CDATA[FF (-> ->)]]></option>
        </param>
    </xml>

    <xml name="type_paired">
        <param name="type_paired" type="select" label="Type of paired-reads" 
            help="In paired-end sequencing, the library preparation yields a set of fragments, and the machine sequences each fragment from both ends. In mate-pair sequencing, 
                the library preparation yields two fragments that are distal to each other in the genome and in the opposite in orientation to that of a mate-paired fragment.">
            <option value="pe" selected="true">Default (--pe)</option>
            <option value="mp">Mate-pair reads (--mp)</option>
            <option value="hqmp">High-quality Nextera mate-pair reads (--hqmp)</option>
        </param>
    </xml>

    <xml name="input_additional_files_all" token_format="" token_label="" token_help="">
        <conditional name="additional_reads">
            <param name="selector" type="select" label="Use an additional set of short-reads" help="Enable this option if you want to combine to data sources (e.g. single and paired reads).">
                <option value="false" selected="true">Disabled</option>
                <option value="true">Enabled</option>
            </param>
            <when value="true">
                <expand macro="input_files_all" format="fastq,fastq.gz,fastqsanger.gz,fasta,fasta.gz" label="FASTA/FASTQ file(s)" help="@HELP@"/>
                <param name="library_number" type="select" label="The samples belong to the same library" help="If the reads have been generated from the sample sample, it means that they belong to the same library.">
                    <option value="true" selected="true">True</option>
                    <option value="false">False</option>
                </param>
            </when>
            <when value="false"/>
        </conditional>
    </xml>

    <xml name="input_additional_files_paired" token_format="" token_label="" token_help="" >
        <conditional name="additional_reads">
            <param name="selector" type="select" label="Use an additional set of short-reads" help="Enable this option if you want to combine to data sources (e.g. single and paired reads).">
                <option value="false" selected="true">Disabled</option>
                <option value="true">Enabled</option>
            </param>
            <when value="true">
                <expand macro="input_files_paired" format="fastq,fastq.gz,fastqsanger.gz,fasta,fasta.gz" label="FASTA/FASTQ file(s)" help="@HELP@"/>
                <param name="library_number" type="select" label="The samples belong to the same library" help="If the reads have been generated from the sample sample, it means that they belong to the same library.">
                    <option value="true" selected="true">True</option>
                    <option value="false">False</option>
                </param>
            </when>
            <when value="false"/>
        </conditional>
    </xml>

    <xml name="covcutoff">
        <conditional name="cov_cond">
            <param argument="--cov-cutoff" type="select" label="Set coverage cutoff option" help="When set to 'auto' SPAdes automatically computes coverage threshold using conservative strategy">
                <option value="off">Off</option>
                <option value="auto">Auto</option>
                <option value="value">User specific</option>
            </param>
            <when value="off"/>
            <when value="auto"/>
            <when value="value">
                <param name="manual" type="float" min="0" value="" label="Set value"/>
            </when>
        </conditional>
    </xml>
    <xml name="pipeline_options">
        <param name="mode_sel" type="select" label="Pipeline options"  multiple="true" optional="true" display="checkboxes" help="Error correction requires FASTQ input files.">
            <option value="--disable-rr">Disable repeat resolution (--disable-rr)</option>
            <yield/>
        </param>
    </xml>
    <xml name="kmer" token_help="" token_default="21,33,55,77">
        <conditional name="kmer_cond">
            <param name="kmer_sel" argument="-k" type="select" label="Select k-mer detection option" help="@HELP@ Comma-separated list, all values must be odd, less than 128 and listed in ascending order.">
                <option value="auto">Auto</option>
                <option value="manual">User specific</option>
            </param>
            <when value="auto"/>
            <when value="manual">
                <param name="manual" type="text" value="@DEFAULT@" label="K-mer size values" help="List of k-mer sizes (must be odd and less than 128)">
                    <sanitizer invalid_char="">
                        <valid initial="string.digits">
                            <add value="," />
                        </valid>
                    </sanitizer>
                    <validator type="regex">[0-9,]+</validator>
                </param>
            </when>
        </conditional>
    </xml>
    <xml name="nanopore_pacbio">
        <param argument="--nanopore" type="data" format="fastq,fastq.gz" multiple="true" optional="true" label="Nanopore reads" help="SPAdes will use Oxford Nanopore reads for gap closure and repeat resolution"/>
        <param argument="--pacbio" type="data" format="fastq,fastq.gz" multiple="true" optional="true" label="PacBio CLR reads" help="It is not recommended to run SPAdes on PacBio reads with low coverage (less than 5). In addition, SPAdes develpers suggest not to run SPAdes on PacBio reads for large genomes. SPAdes will use PacBio CLR reads for gap closure and repeat resolution"/>
    </xml>
    <xml name="flrna">
        <param argument="--fl-rna" name="flrna" type="data" format="fastq,fastq.gz,fasta,fasta.gz,fastqsanger,fastqsanger.gz" multiple="true" optional="true" label="PacBio/Nanopore/contigs that capture full-length transcripts" help="In addition to long reads, you may also provide a separate file with reads capturing the entire transcript sequences using this option. Full-length transcripts in such reads can be typically detected using the adapters. Note, that FL reads should be trimmed so that the adapters are excluded."/>
    </xml>

    <xml name="phred">
        <param argument="--phred-offset" type="select" label="Set Phred quality offset" help="Phred quality offset in the input reads. Default: auto-detect">
            <option value="auto" selected="true">Auto</option>
            <option value="33">33 (Sanger)</option>
            <option value="64">64 (Illumina)</option>
        </param>
    </xml>
    <xml name="reads" token_paramname="reads" token_help="" token_label="">
        <param name="@PARAMNAME@" type="data" format="fastq,fastq.gz" label="@LABEL@ reads" help="@HELP@"/>
    </xml>
    <xml name="sanger">
        <param argument="--sanger" type="data" format="fastq,fastq.gz" multiple="true" optional="true" label="Sanger reads"/>
    </xml>
    <xml name="contigs">
        <param argument="--trusted-contigs" type="data" format="fasta,fasta.gz" multiple="true" optional="true" label="Trusted contigs" help="Reliable contigs of the same genome, which are likely to have no misassemblies and small rate of other errors (e.g. mismatches and indels). This option is not intended for contigs of the related species."/>
        <param argument="--untrusted-contigs" type="data" format="fasta,fasta.gz" multiple="true" optional="true" label="Untrusted contigs" help="Contigs of the same genome, quality of which is average or unknown. Contigs of poor quality can be used but may introduce errors in the assembly. This option is also not intended for contigs of the related species."/>
    </xml>
    <xml name="assembly_graph">
        <param argument="--assembly-graph" type="data" format="gfa1" multiple="true" optional="true" label="Assembly graphs" help=" The primary purpose of this option to run these pipelines on already constructed and simplified assembly graph this way skipping a large part of SPAdes pipeline."/>
    </xml>
    <xml name="optional_output">
        <param name="optional_output" type="select" multiple="true" optional="false" label="Select optional output file(s)" help="Only shown in history if selected here and generated by the specific run.">
            <option value="ag" selected="true">Assembly graph</option>
            <option value="ags" selected="true">Assembly graph with scaffolds</option>
            <option value="cn" selected="true">Contigs</option>
            <option value="cp">Contigs paths</option>
            <option value="cr">Corrected reads</option>
            <option value="cs">Contigs stats</option>
            <option value="l">Log</option>
            <option value="sc" selected="true">Scaffolds</option>
            <option value="sp">Scaffolds paths</option>
            <option value="ss">Scaffolds stats</option>            
        </param>
    </xml>
    <!--
      output
    -->

    <xml name="out_ag">
        <data name="out_ag" format="fastg" from_work_dir="output/assembly_graph.fastg" label="${tool.name} on ${on_string}: Assembly graph">
            <filter>'ag' in optional_output</filter>
            <filter> operation_mode != '--only-error-correction'</filter>
        </data>
    </xml>
    <xml name="out_ags">
        <data name="out_ags" format="txt" from_work_dir="output/assembly_graph_with_scaffolds.gfa" label="${tool.name} on ${on_string}: Assembly graph with scaffolds">
            <filter>'ags' in optional_output</filter>
            <filter> operation_mode != '--only-error-correction'</filter>
        </data>
    </xml>
    <xml name="out_cn">
        <data name="out_cn" format="fasta" from_work_dir="output/contigs.fasta" label="${tool.name} on ${on_string}: Contigs">
            <filter>'cn' in optional_output</filter>
            <filter> operation_mode != '--only-error-correction'</filter>
        </data>
    </xml>
    <xml name="out_cp">
        <data name="out_cp" format="txt" from_work_dir="output/contigs.paths" label="${tool.name} on ${on_string}: Contigs paths">
            <filter>'cp' in optional_output</filter>
            <filter> operation_mode != '--only-error-correction'</filter>
        </data>
    </xml>
    <xml name="out_cr">
        <!-- some mode combinations create fastq, some fasta -->
        <collection name="out_cr" type="list" label="${tool.name} on ${on_string}: Corrected reads">
            <filter>'cr' in optional_output</filter>
            <filter> operation_mode != '--only-assembler'</filter>
            <discover_datasets pattern="(?P&lt;designation&gt;.+)\.fastq\.gz" format="fastq" directory="output/corrected"/>
            <discover_datasets pattern="(?P&lt;designation&gt;.+)\.fasta\.gz" format="fasta" directory="output/corrected"/>
        </collection>
    </xml>
    <xml name="out_cs">
        <data name="out_cs" format="tabular" label="${tool.name} on ${on_string}: Contigs stats">
            <actions>
                <action name="column_names" type="metadata" default="name,length,coverage"/>
            </actions>
            <filter>'cs' in optional_output</filter>
            <filter> operation_mode != '--only-error-correction'</filter>
        </data>
    </xml>
    <xml name="out_l">
        <data name="out_l" format="txt" from_work_dir="output/spades.log" label="${tool.name} on ${on_string}: Log">
            <filter>'l' in optional_output</filter>
        </data>
    </xml>
    <xml name="out_sc">
        <data name="out_sc" format="fasta" from_work_dir="output/scaffolds.fasta" label="${tool.name} on ${on_string}: Scaffolds">
            <filter>'sc' in optional_output</filter>
            <filter> operation_mode != '--only-error-correction'</filter>
        </data>
    </xml>
    <xml name="out_sp">
        <data name="out_sp" format="txt" from_work_dir="output/scaffolds.paths" label="${tool.name} on ${on_string}: Scaffolds paths">
            <filter>'sp' in optional_output</filter>
            <filter> operation_mode != '--only-error-correction'</filter>
        </data>
    </xml>
    <xml name="out_ss">
        <data name="out_ss" format="tabular" label="${tool.name} on ${on_string}: Scaffolds stats">
            <actions>
                <action name="column_names" type="metadata" default="name,length,coverage"/>
            </actions>
            <filter>'ss' in optional_output</filter>
            <filter> operation_mode != '--only-error-correction'</filter>
        </data>
    </xml>
    <xml name="out_rs">
        <data name="out_rs" format="fasta" from_work_dir="output/raw_scaffolds.fasta" label="${tool.name} on ${on_string}: Raw scaffolds">
            <filter>'rs' in optional_output</filter>
        </data>
    </xml>
    <xml name="out_b">
        <data name="out_b" format="txt" from_work_dir="output/hmm_statistics.txt" label="${tool.name} on ${on_string}: HMM statistics">
            <filter>'b' in optional_output</filter>
        </data>
    </xml>
    <xml name="out_dg">
        <data name="out_dg" format="fasta" from_work_dir="output/domain_graph.dot" label="${tool.name} on ${on_string}: Domain graph">
            <filter>'dg' in optional_output</filter>
        </data>
    </xml>
    <!--
      help
    -->

    <token name="@HELP_IN@"><![CDATA[

SPAdes takes as input paired-end reads, mate-pairs and single (unpaired) reads in FASTA and FASTQ. For IonTorrent data SPAdes also supports unpaired reads in unmapped BAM format (like the one produced by Torrent Server). However, in order to run read error correction, reads should be in FASTQ or BAM format. Sanger, Oxford Nanopore and PacBio CLR reads can be provided in both formats since SPAdes does not run error correction for these types of data.

To run SPAdes 3.15.3 you need at least one library of the following types:

- Illumina paired-end/high-quality mate-pairs/unpaired reads
- IonTorrent paired-end/high-quality mate-pairs/unpaired reads
- PacBio CCS reads
- Illumina and IonTorrent libraries should not be assembled together. All other types of input data are compatible. SPAdes should not be used if only PacBio CLR, Oxford Nanopore, Sanger reads or additional contigs are available.

SPAdes supports mate-pair only assembly. However, we recommend to use only high-quality mate-pair libraries in this case (e.g. that do not have a paired-end part). We tested mate-pair only pipeline using Illumina Nextera mate-pairs. 

Notes:

- It is strongly suggested to provide multiple paired-end and mate-pair libraries according to their insert size (from smallest to longest).
- It is not recommended to run SPAdes on PacBio reads with low coverage (less than 5).
- We suggest not to run SPAdes on PacBio reads for large genomes.
- SPAdes accepts gzip-compressed files.

A detailed description can be found in the `input section <https://github.com/ablab/spades/#sec3.1>`_ of the manual.
    ]]></token>
    <token name="@HELP_OUT_AG@">
- Assembly graph
    </token>
    <token name="@HELP_OUT_AGS@">
- Assembly graph with scaffolds
    </token>
    <token name="@HELP_OUT_C@">
- Contigs
    </token>
    <token name="@HELP_OUT_CP@">
- Contigs paths in the assembly graph
    </token>
    <token name="@HELP_OUT_CS@">
- Contigs stats
    </token>
    <token name="@HELP_OUT_CR@">   
- Corrected reads by BayesHammer
    </token>
    <token name="@HELP_OUT_L@">
- Log file
    </token>
    <token name="@HELP_OUT_S@">
- Scaffolds (recommended for use as resulting sequences)
    </token>
    <token name="@HELP_OUT_SP@">
- Scaffolds paths in the assembly graph
    </token>
    <token name="@HELP_OUT_SS@">
- Scaffolds stats
    </token>
    <token name="@HELP_WID@">
SPAdes - St. Petersburg genome assembler - is an assembly toolkit containing various assembly pipelines.
    </token>
    <token name="@IONTORRENT@"><![CDATA[
The selection of k-mer length is non-trivial for IonTorrent. If the dataset is more or less conventional (good coverage, not high GC, etc), then use our `recommendation for long reads <https://cab.spbu.ru/files/release3.12.0/manual.html#sec3.4>`_ (e.g. assemble using k-mer lengths 21,33,55,77,99,127). However, due to increased error rate some changes of k-mer lengths (e.g. selection of shorter ones) may be required. For example, if you ran SPAdes with k-mer lengths 21,33,55,77 and then decided to assemble the same data set using more iterations and larger values of K, you can run SPAdes once again specifying the same output folder and the following options: --restart-from k77 -k 21,33,55,77,99,127 --mismatch-correction -o <previous_output_dir>. Do not forget to copy contigs and scaffolds from the previous run. We're planning to tackle issue of selecting k-mer lengths for IonTorrent reads in next versions.

You may need no error correction for Hi-Q enzyme at all. However, we suggest trying to assemble your data with and without error correction and select the best variant.

For non-trivial datasets (e.g. with high GC, low or uneven coverage) we suggest to enable single-cell mode (setting --sc option) and use k-mer lengths of 21,33,55.

    ]]></token>    

</macros>