view lasttrain.xml @ 4:8705e0d74a0f draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/last commit 6b601baaf89634bc8d110ea06e3e64c7a585f3ba"
author iuc
date Wed, 24 Mar 2021 22:36:50 +0000
parents 3de2195f32c0
children 19c265784f35
line wrap: on
line source

<tool id="last_train" name="LAST-train" version="@LAST_CONDA_VERSION@+galaxy0" profile="20.01">

    <description>finds the rates (probabilities) of insertion, deletion, and substitutions between two sets of sequences.</description>

    <macros>
        <import>macros_last.xml</import>
    </macros>

    <requirements>
        <requirement type="package" version="@LAST_CONDA_VERSION@">last</requirement>
    </requirements>

    <command detect_errors="exit_code"><![CDATA[
        set -e -o pipefail; 
        #if $db_opts.db_opts_input == 'lastdb'
            ln -s '$db_opts.lastdatabase.extra_files_path' './db_files' &&
        #end if
        #if $query_fasta.ext.endswith('.gz')
        zcat 
        #else
        cat 
        #end if
        '$query_fasta' | last-train

        -Q $init_options.Q
        -r $init_options.r
        -q $init_options.q
        -a $init_options.cost_opt.a
        -b $init_options.cost_opt.b
        -A $init_options.cost_opt.A
        -B $init_options.cost_opt.B
        -D $last_train_opt.align_opt.D
        #if $last_train_opt.align_opt.E != ""
            -E $last_train_opt.align_opt.E
        #end if
        -s $last_train_opt.align_opt.s
        -S $last_train_opt.align_opt.S
        -T $last_train_opt.align_opt.T
        -m $last_train_opt.align_opt.m
        -k $last_train_opt.align_opt.k
        -X $last_train_opt.align_opt.X

        -P \${GALAXY_SLOTS:-1}

        #if $db_opts.db_opts_input == 'db'
            '${"' '".join(str($db_opts.database.fields.path).split(","))}'
        #else if $db_opts.db_opts_input == 'lastdb'
            'db_files/lastdb'
        #end if

        >'$outfile'

    ]]></command>

    <inputs>
        <expand macro="input_db" />
        <param name="query_fasta" type="data" format="fasta,fasta.gz,fastqsanger,fastqsanger.gz" label="Queries input files" />
        <conditional name="init_options">            
            <param argument="-Q" type="select" multiple="false" label="Query input format">
                <option value="0" selected="true">FASTA</option>
                <option value="1">Fastq-sanger</option>
            </param>
            <when value="0">
                <param argument="-r" type="integer" value="5" label="Match score"/>
                <param argument="-q" type="integer" value="5" label="Mismatch cost"/>
                <expand macro="cost_macro" a="15" b="3"/>
            </when>
            <when value="1">
                <param argument="-r" type="integer" value="6" label="Match score"/>
                <param argument="-q" type="integer" value="18" label="Mismatch cost"/>
                <expand macro="cost_macro" a="21" b="9"/>
            </when>
        </conditional>

        <section name="last_train_opt" title="Last-train options" expanded="false">
            <!-- Training options missing  -->
            <section name="align_opt" title="Alignment options" expanded="true">
                <param argument="-D" type="integer" value="1000000" label="Query letters per random alignment"/>
                <param argument="-E" type="integer" value="" optional="true" label="Maximum expected alignments per square giga"/>
                <param argument="-s" type="select" multiple="false" label="Query strand to use">
                    <option value="0">Reverse</option>
                    <option value="1" selected="true">Forward</option>
                    <option value="2">Both</option>
                </param>
                <param argument="-S" type="select" multiple="false" label="Score matrix applies to forward strand of:">
                    <option value="0">Reference</option>
                    <option value="1" selected="true">Query</option>
                </param>                
                <!--<param name="gapless_align" argument="-C" type="integer" value="" label="Omit gapless alignments in COUNT others with > score-per-length"/>-->
                <param argument="-T" type="select" multiple="false" label="Type of alignment:">
                    <option value="0" selected="true">Local</option>
                    <option value="1">Overlap</option>
                </param>
                <param argument="-m" type="integer" value="10" label="Maximum initial matches per query position"/>
                <param argument="-k" type="integer" value="1" label="Use initial matches starting at every STEP-th position in each query"/>
                <param argument="-X" type="select" multiple="false" label="N/X is ambiguous in:">
                    <option value="0" selected="true">Neither sequence</option>
                    <option value="1">Reference</option>
                    <option value="2">Query</option>
                    <option value="3">Both</option>
                </param>
            </section>
        </section>
    </inputs>

    <outputs>
        <data name="outfile" format="txt" label="LAST train from ${on_string}" />
    </outputs>

    <tests>
        <test>
            <conditional name="db_opts">
                <param name="db_opts_input" value="db"/>
                <param name="database" value="humdb"/>
            </conditional>
            <section name="last_train_opt">
                <section name="align_opt">
                    <param name="E" value="10"/>
                </section>
            </section>
            <param name="query_fasta" value="fuguMito.fa.gz" ftype="fasta.gz"/>
            <output name="outfile" file="last_train_E.txt" ftype="txt" lines_diff="28"/>
        </test>
        <test>
            <conditional name="db_opts">
                <param name="db_opts_input" value="db"/>
                <param name="database" value="humdb"/>
            </conditional>
            <param name="query_fasta" value="fuguMito.fq.gz" ftype="fastqsanger.gz"/>
            <output name="outfile" file="last_train.txt" ftype="txt" lines_diff="22"/>
        </test>
    </tests>

    <help>@LAST_HELP@</help>
    <citations><expand macro="citations"/></citations>
</tool>