view analysis_load_fasta.xml @ 2:0fbe72b81b9e draft

planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/tripal commit 81a83f06b49db32928ba0cd44e5b6d0431868d27
author gga
date Thu, 21 Jun 2018 08:48:27 -0400
parents 43bb9308b52d
children 9e38e70f02f6
line wrap: on
line source

<?xml version="1.0"?>
<tool id="analysis_load_fasta" profile="16.04" name="Load a Fasta file" version="@WRAPPER_VERSION@.2">
    <description>into Tripal</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <code file="tripal.py"/>
    <expand macro="stdio"/>
    <command><![CDATA[
        tmp_dir=`mktemp -d -p "@DATA_DIR@"` && chmod a+rx "\${tmp_dir}"

        &&

        cp '${fasta}' "\${tmp_dir}/content.fasta"

        &&

        @AUTH@

        tripaille analysis load_fasta

            --organism_id '${organism}'

            --analysis_id '${analysis}'

            --sequence_type '${sequence_type}'

            --method '${loading.method}'

            #if str($loading.method) != "insert":
                --match_type '${loading.match_type}'
            #end if

            #if str($naming.re_name):
                --re_name '${naming.re_name}'
            #end if

            #if str($naming.re_uniquename):
                --re_uniquename '${naming.re_uniquename}'
            #end if

            #if str($relationships.rel_type) != "none":
                --rel_type '${relationships.rel_type}'
                --rel_subject_re '${relationships.rel_subject_re}'
                --rel_subject_type '${relationships.rel_subject_type}'
            #end if

            #if str($ext_db.db_ext_id):
                --db_ext_id '${ext_db.db_ext_id}'
            #end if

            #if str($ext_db.re_accession):
                --re_accession '${ext_db.re_accession}'
            #end if

            "\${tmp_dir}/content.fasta"

        &&

        echo "Data loaded" > $results
    ]]></command>
    <inputs>
        <param name="fasta"
               type="data"
               format="fasta"
               label="Fasta file to load" />

        <param argument="--organism"
               type="select"
               dynamic_options="list_organisms()"
               label="Organism" />

        <param argument="--analysis"
               type="select"
               dynamic_options="list_analyses()"
               label="Analysis" />

        <param name="sequence_type"
               argument="--sequence_type"
               type="text"
               label="Sequence type"
               value="contig"
               help="this should be a Sequence Ontology term" />

        <conditional name="loading">
            <param name="method"
                   argument="--method"
                   type="select"
                   label="Loading method"
                   help="select wether you expect feature to be already existing or not">
                <option value="insup" selected="true">Insert and update</option>
                <option value="insert">Insert only</option>
                <option value="update">Update only</option>
            </param>
            <when value="insup">
                <expand macro="match_type" />
            </when>
            <when value="insert"/>
            <when value="update">
                <expand macro="match_type" />
            </when>
        </conditional>

        <section name="naming" title="Feature naming">
            <param name="re_name"
                   argument="--re_name"
                   type="text"
                   optional="true"
                   label="Regular expression to extract feature name"
                   help="this regex will be applied on the fasta definition line to generate the feature name">
                <expand macro="sanitized"/>
            </param>

            <param name="re_uniquename"
                   argument="--re_uniquename"
                   type="text"
                   optional="true"
                   label="Regular expression to extract feature uniquename"
                   help="this regex will be applied on the fasta definition line to generate the feature uniquename">
                <expand macro="sanitized"/>
            </param>
        </section>

        <conditional name="relationships">
            <param name="rel_type"
                   argument="--rel_type"
                   type="select"
                   label="Relationship type"
                   help="Use this when inserting features that should be associated to other already existing features">
                <option value="none" selected="true">No relationship</option>
                <option value="part_of">Part of (for CDS sequences)</option>
                <option value="derives_from">Derives from (for peptide sequences)</option>
            </param>
            <when value="none"/>
            <when value="part_of">
                <expand macro="feature_rel" />
            </when>
            <when value="derives_from">
                <expand macro="feature_rel" />
            </when>
        </conditional>

        <section name="ext_db" title="Cross references to external database">
            <param name="db_ext_id"
                   argument="--db_ext_id"
                   type="integer"
                   optional="true"
                   label="External Database ID"
                   help="Numeric ID from the Chado database" />

            <param name="re_accession"
                   argument="--re_accession"
                   type="text"
                   optional="true"
                   label="Regular expression to extract the accession from external DB"
                   help="this regex will be applied on the fasta definition line to generate the accession from external DB" />
        </section>
        <expand macro="wait_for"/>
    </inputs>
    <outputs>
        <data format="txt" name="results" label="Load Fasta into Tripal" />
    </outputs>
    <tests>
        <test expect_failure="true" expect_exit_code="1">
            <param name="fasta" value="citrus_genome.fasta" />
            <param name="organism" value="Testus testus" />
            <param name="analysis" value="Annotation xx" />
            <param name="sequence_type" value="mRNA" />
            <conditional name="loading">
                <param name="method" value="insup" />
                <param name="match_type" value="uniquename" />
            </conditional>
            <section name="naming">
                <param name="re_name" value="([a-z]{4}[0-9]+)_suffix" />
                <param name="re_uniquename" value="([a-z]{4}[0-9]+_suffix)" />
            </section>

            <expand macro="test_result" />
        </test>
    </tests>
    <help><![CDATA[
        @HELP_OVERVIEW@

        **Load Fasta**

        With this tool, you can load sequences from a Fasta file into the Tripal/Chado database.

        Corresponding features can be created if needed.

        @HELP@
    ]]></help>
    <expand macro="citation"/>
</tool>