view megahit_wrapper.xml @ 7:a96f3ad4e0d8 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/megahit commit 64421702fce231e2fb05bd2f585679154c3e2140
author iuc
date Tue, 28 Nov 2023 07:47:49 +0000
parents 14ddfc8ffb93
children
line wrap: on
line source

<tool id="megahit" name="MEGAHIT" version="@TOOL_VERSION@+galaxy1">
    <description>for metagenomics assembly</description>
    <macros>
        <token name="@TOOL_VERSION@">1.2.9</token>
    </macros>
    <xrefs>
        <xref type="bio.tools">megahit</xref>
    </xrefs>
    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">megahit</requirement>
    </requirements>
    <version_command>megahit --version</version_command>
    <command detect_errors="exit_code"><![CDATA[
if [[ -n "\$GALAXY_MEMORY_MB" ]]; then
    MEMORY="-m \$((GALAXY_MEMORY_MB * 1024))";
fi;

megahit
    --num-cpu-threads \${GALAXY_SLOTS:-4}
    #if $input_option.choice == 'paired'
        -1 '${input_option.fastq_input1}'
        -2 '${input_option.fastq_input2}'
    #else if $input_option.choice == 'paired_collection'

        #if $input_option.batchmode.processmode == 'merge':
            -1 ${ ','.join(['"%s"' % x.forward for x in $input_option.batchmode.pair_input_list]) }
            -2 ${ ','.join(['"%s"' % x.reverse for x in $input_option.batchmode.pair_input_list]) }
        #else:
            -1 '${input_option.batchmode.pair_input.forward}'
            -2 '${input_option.batchmode.pair_input.reverse}'
        #end if
    #else if $input_option.choice == 'interleaved'
        --12 '${input_option.interleaved_file}'
    #else
        -r '${input_option.single_files}'
    #end if
    ##basic assembly
    --min-count '${basic_section.min_count}'
    #if $basic_section.k_mer.k_mer_method == "klist_method":
        --k-list '${basic_section.k_mer.k_list}'
    #else:
        --k-step '${basic_section.k_mer.k_step}'
        --k-min '${basic_section.k_mer.k_min}'
        --k-max '${basic_section.k_mer.k_max}'
    #end if
    ##advanced assembly
    ${advanced_section.nomercy}
    --bubble-level '${advanced_section.bubble_level}'
    --merge-level '${advanced_section.merge_level}'
    --prune-level '${advanced_section.prune_level}'
    --prune-depth '${advanced_section.prune_depth}'
	--disconnect-ratio '${advanced_section.disconnect_ratio}'
    --low-local-ratio '${advanced_section.low_local_ratio}'
	--cleaning-rounds '${advanced_section.cleaning_rounds}'					  
    ${advanced_section.nolocal}
    ${advanced_section.kmin1pass}
    --min-contig-len '${output_section.min_contig_len}'
    \$MEMORY
&& cat megahit_out/log
    ]]></command>
    <inputs>
        <conditional name="input_option">
            <param name="choice" type="select" label="Select your input option">
                <option value="single" selected="true">Single</option>
                <option value="interleaved">Interleaved-paired-end</option>
                <option value="paired">Paired-end</option>
                <option value="paired_collection">Paired-end collection</option>
            </param>
            <when value="single">
                <param name="single_files" argument="-r" type="data" format="fastq,fastqsanger,fasta,fastq.gz,fastqsanger.gz,fastq.bz2" multiple="true" label="Single-end file(s)" help="Accepts fasta (.fasta, .fa) and fastq (.fastq) formats as well as gzip (.gz) and gzip2 (.bz2) files" />
            </when>
            <when value="interleaved">
                <param name="interleaved_file" argument="--12" type="data" format="fastq,fastqsanger,fasta,fastq.gz,fastqsanger.gz,fastq.bz2" multiple="true" label="Interleaved-paired-end file(s)" help="Accepts fasta (.fasta, .fa) and fastq (.fastq) formats as well as gzip (.gz) and gzip2 (.bz2) files" />
            </when>
            <when value="paired">
                <param name="fastq_input1" argument="-1" type="data" format="fastq,fastqsanger,fasta,fastq.gz,fastqsanger.gz" multiple="true" label="Mate 1 input reads"/>
                <param name="fastq_input2" argument="-2" type="data" format="fastq,fastqsanger,fasta,fastq.gz,fastqsanger.gz" multiple="true" label="Mate 2 input reads"/>
            </when>
            <when value="paired_collection">
              <conditional name="batchmode">
                <param name="processmode" type="select" label="Run in batch mode?" help="Selecting individual mode will generate one assembly dataset for each fastq pair-end dataset. Selecting the merge option will produce one assembly dataset for all input fastq pair-end datasets" display="radio">
                  <option value="individual" selected="true">Run individually</option>
                  <option value="merge">Merge all fastq pair-end</option>
                </param>
                <when value="individual">
                  <param name="pair_input" type="data_collection" format="fastq,fastqsanger,fasta,fastq.gz,fastqsanger.gz" collection_type="paired" label="Select a paired collection"/>
                </when>
                <when value="merge">
                  <param name="pair_input_list" type="data_collection" format="fastq,fastqsanger,fasta,fastq.gz,fastqsanger.gz" collection_type="list:paired" label="Select a paired collection"/>
                </when>
              </conditional>
            </when>
        </conditional>
        <section name="basic_section" title="Basic assembly options" expanded="True">
            <param argument="--min-count" type="integer" value="2" label="minimum multiplicity for filtering (k_min+1)-mers" help="(kmin+1)-mer with multiplicity lower than d (default 2, specified by --min-count option) will be discarded. You should be cautious to set d less than 2, which will lead to a much larger and noisy graph. We recommend using the default value 2 for metagenomics assembly. If you want to use MEGAHIT to do generic assemblies, please change this value according to the sequencing depth. (recommend --min-count 3 for >40x)."/>
            <conditional name="k_mer">
                <param name="k_mer_method" type="select" label="K-mer specification method">
                    <option value="klist_method">Specify list</option>
                    <option value="klim_method">Specify min, max, and step values</option>
                </param>
                <when value="klist_method">
                    <param argument="--k-list" type="text" value="21,29,39,59,79,99,119,141" label="Comma-separated list of kmer size" help="all must be odd, in the range 15-255, and with increments &lt;= 28"/>
                </when>
                <when value="klim_method"> 
                    <param argument="--k-min" type="integer" value="21" label="Minimum kmer size" max="255" help="Must be odd number. For ultra complex metagenomics data such as soil, a larger kmin, say 27, is recommended to reduce the complexity of the de Bruijn graph. Quality trimming is also recommended. For high-depth generic data, large --k-min (25 to 31) is recommended. Smaller --k-step, say 10, is more friendly to low-coverage datasets."/>
                    <param argument="--k-max" type="integer" value="141" label="Maximum kmer size" max="255" help="must be odd number"/>
                    <param argument="--k-step" type="integer" value="12" label="Increment of kmer size of each iteration" max="28" help="must be even number"/>
                </when>
            </conditional>
        </section>
        <section name="advanced_section" title="Advanced assembly options" expanded="False">
            <param name="nomercy" type="boolean" checked="false" truevalue="--no-mercy" falsevalue="" label="Do not add mercy kmers" help="Mercy kmers are specially designed for metagenomics assembly to recover low coverage sequences. For generic dataset >= 30x, MEGAHIT may generate better results with no mercy kmers." />
            <param argument="--bubble-level" type="integer" value="2" min="0" max="2" label="Intensity of bubble merging (0-2), 0 to disable" />
            <param argument="--merge-level" type="text" value="20,0.95" label="Merge complex bubbles of length" />
            <param argument="--prune-level" type="integer" value="2" min="0" max="3" label="Strength of low depth pruning" />
            <param argument="--prune-depth" type="integer" value="2" min="0" label="Remove unitigs with avg kmer depth less than this value" />
			<param argument="--disconnect-ratio" type="float" value="0.1" label="Disconnect unitigs if its depth is less than this ratio times the total depth of itself and its siblings" />
            <param argument="--low-local-ratio" type="float" value="0.2" label="Remove unitigs if its depth is less than this ratio times the average depth of the neighborhoods" />
			<param argument="--cleaning-rounds" type="integer" value="5" label="Number of rounds for graph cleanning" />	  
            <param name="nolocal" type="boolean" checked="false" truevalue="--no-local" falsevalue="" label="Disable local assembly" />
            <param name="kmin1pass" type="boolean" checked="false" truevalue="--kmin-1pass" falsevalue="" label="Use 1pass mode to build SdBG of k_min" />
        </section>
        <section name="output_section" title="Output options" expanded="True">
            <param argument="--min-contig-len" type="integer" value="200" label="Minimum length of contigs to output" />
            <param name="show_intermediate_contigs" type="boolean" checked="false" label="Return intermediate contigs?"/>
        </section>
    </inputs>
    <outputs>
        <data format="fasta" name="output" from_work_dir="megahit_out/final.contigs.fa" label="Assembly with ${tool.name} on ${on_string}" />
        <collection name="intermediate_contigs" type="list" label="Intermediate contigs from ${tool.name} on ${on_string}">
            <filter>output_section['show_intermediate_contigs']</filter>
            <discover_datasets pattern="(?P&lt;designation&gt;.*\d)\.contigs\.fa$" ext="fasta" directory="megahit_out/intermediate_contigs" />
        </collection>
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <conditional name="input_option">
                <param name="choice" value="single"/>
                <param name="single_files" value="refExample.fa" ftype="fasta"/>
            </conditional>
            <output name="output">
            <assert_contents>
              <has_line_matching expression=">k21_0 flag=3 multi=1.0486 len=576" />
            </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
             <conditional name="input_option">
                <param name="choice" value="interleaved"/>
                <param name="interleaved_file" value="interleaved-fq.fa"/>
            </conditional>
            <output name="output" file="interleaved_result.fa"/>
        </test>
        <test expect_num_outputs="1">
            <conditional name="input_option">
                <param name="choice" value="paired"/>
                <param name="fastq_input1" value="paired-fq1.fa"/>
                <param name="fastq_input2" value="paired-fq2.fa"/>
            </conditional>
            <output name="output" file="paired_result.fa"/>
        </test>
        <test expect_num_outputs="1">
            <conditional name="input_option">
                <param name="choice" value="paired_collection"/>
                <conditional name="batchmode">
                    <param name="processmode" value="merge"/>
                    <param name="pair_input_list">
                        <collection type="list:paired">
                        <element name="Pair1">
                          <collection type="paired">
                            <element name="forward" value="paired-fq1.fa" ftype="fasta"/>
                            <element name="reverse" value="paired-fq2.fa" ftype="fasta"/>
                          </collection>
                        </element>
                        </collection>
                    </param>
                </conditional>
            </conditional>
            <output name="output" file="paired_result.fa"/>
        </test>
    </tests>
    <help><![CDATA[

**What it does**

MEGAHIT is a single node assembler for large and complex metagenomics NGS reads, such as soil. It makes use of succinct de Bruijn graph (SdBG) to achieve low memory assembly. MEGAHIT can optionally utilize a CUDA-enabled GPU to accelerate its SdBG contstruction. The GPU-accelerated version of MEGAHIT has been tested on NVIDIA GTX680 (4G memory) and Tesla K40c (12G memory) with CUDA 5.5, 6.0 and 6.5.

--------

**Project links:**

https://github.com/voutcn/megahit


    ]]></help>
    <citations>
        <citation type="doi">10.1093/bioinformatics/btv033</citation>
    </citations>
</tool>