view macros.xml @ 39:fe74900d6dc7 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cutadapt commit a5b6cb44f81abe57a4269bded1fa4d41f462f9d5
author iuc
date Fri, 17 May 2024 13:32:03 +0000
parents b1c926deaa2d
children
line wrap: on
line source

<macros>
    <token name="@TOOL_VERSION@">4.8</token>
    <token name="@VERSION_SUFFIX@">1</token>
    <token name="@FASTQ_TYPES@">fastq.bz2,fastq.gz,fastq,fasta.bz2,fasta.gz,fasta</token>
    <xml name="edam_ontology">
        <edam_topics>
            <edam_topic>topic_0632</edam_topic>
        </edam_topics>
        <edam_operations>
            <edam_operation>operation_0231</edam_operation>
        </edam_operations>
    </xml>
    <xml name="requirements">
        <requirements>
            <requirement type="package" version="@TOOL_VERSION@">cutadapt</requirement>
        </requirements>
    </xml>
    <xml name="citations">
        <citations>
            <citation type="doi">10.14806/ej.17.1.200</citation>
        </citations>
    </xml>
    <xml name="xrefs">
        <xrefs>
            <xref type='bio.tools'>cutadapt</xref>
        </xrefs>
    </xml>
    <!-- parametrized token - you need to set `$ADAPTER_ARGUMENT` -->
    <token name="@adapter_cli@">
        #if $a.adapter_source.adapter_source_list == 'builtin':
            $ADAPTER_ARGUMENT '${a.adapter_source.adapter.fields.name}'='${a.adapter_source.adapter}${a.single_noindels}'
        #elif $a.adapter_source.adapter_source_list == 'file':
            $ADAPTER_ARGUMENT file:'${a.adapter_source.adapter_file}${a.single_noindels}'
        #elif str($a.adapter_source.adapter_name) != "":
            $ADAPTER_ARGUMENT '${a.adapter_source.adapter_name}'='${a.adapter_source.adapter}${a.single_noindels}'
        #else:
            $ADAPTER_ARGUMENT '${a.adapter_source.adapter}${a.single_noindels}'
        #end if
    </token>
    <xml name="adapter_sanitizer">
        <sanitizer>
            <valid initial="string.digits">
                <add value="A"/><!--standard nucleotides-->
                <add value="T"/>
                <add value="C"/>
                <add value="G"/>
                <add value="U"/><!--ambiguous nucleotides-->
                <add value="R"/>
                <add value="Y"/>
                <add value="S"/>
                <add value="W"/>
                <add value="K"/>
                <add value="M"/>
                <add value="B"/>
                <add value="D"/>
                <add value="H"/>
                <add value="V"/>
                <add value="N"/>
                <add value="X"/><!-- don't match any nucleotide-->
                <add value="{"/><!--specify repeats .. needs digits which are added as default-->
                <add value="}"/>
                <add value="^"/><!--anchoring-->
                <add value="$"/>
                <add value="."/>
                <add value="("/><!--specify what to keep-->
                <add value=")"/>
            </valid>
        </sanitizer>
    </xml>
    <xml name="adapter_conditional" tokens="adapter_type,argument">
        <conditional name="adapter_source">
            <param name="adapter_source_list" type="select" label="Source" >
                <option value="builtin" selected="true">Standard (select from the list below)</option>
                <option value="user">Enter custom sequence</option>
                <option value="file">File from history</option>
            </param>
            <when value="user">
                <param name="adapter_name" type="text" value="" optional="true" label="Custom @ADAPTER_TYPE@ adapter name" help="Optional if 'Multiple output' is selected in the Outputs selector'" />
                <param name="adapter" argument="@ARGUMENT@" type="text" value="AATTGGCC" label="Custom @ADAPTER_TYPE@ adapter sequence">
                    <expand macro="adapter_sanitizer"/>
                </param>
            </when>
            <when value="builtin">
                <param name="adapter" argument="@ARGUMENT@" type="select" label="@ADAPTER_TYPE@ adapter">
                    <options from_data_table="adapters">
                        <filter type="sort_by" column="1" />
                        </options>
                    <expand macro="adapter_sanitizer"/>
                </param>
            </when>
            <when value="file">
                <param name="adapter_file" argument="@ARGUMENT@" format="fasta" type="data"  label="File containing @ADAPTER_TYPE@ adapters" help="Should be of datatype FASTA" />
            </when>
        </conditional>
        <param name="single_noindels" type="boolean" truevalue=";noindels" falsevalue="" checked="false" label="Disallow indels for this adapter"/>
    </xml>
    <xml name="read1_adapters" >
        <section name="r1" title="Read 1 Adapters" expanded="true">
            <repeat name="adapters" title="3' (End) Adapters" help="Sequence of an adapter ligated to the 3' end (paired data: of the first read). The adapter and subsequent bases are trimmed. If a '$' character is appended ('anchoring'), the adapter is only found if it is a suffix of the read. To search for a linked adapter, separate the 2 sequences with 3 dots (ADAPTER1...ADAPTER2), see Help below.">
                <expand macro="adapter_conditional" argument="-a" adapter_type="3'"/>
            </repeat>
            <repeat name="front_adapters" title="5' (Front) Adapters" help="Sequence of an adapter ligated to the 5' end (paired data: of the first read). The adapter and any preceding bases are trimmed. Partial matches at the 5' end are allowed. If a '^' character is prepended ('anchoring'), the adapter is only found if it is a prefix of the read. To search for a linked adapter, separate the 2 sequences with 3 dots (ADAPTER1...ADAPTER2), see Help below.">
                <expand macro="adapter_conditional" argument="-g" adapter_type="5'"/>
            </repeat>
            <repeat name="anywhere_adapters" title="5' or 3' (Anywhere) Adapters" help="Sequence of an adapter that may be ligated to the 5' or 3' end (paired data: of the first read). Both types of matches as described under 3' und 5' Adapters are allowed. If the first base of the read is part of the match, the behavior is as with 5' Adapters, otherwise as with 3' Adapters. This option is mostly for rescuing failed library preparations - do not use if you know which end your adapter was ligated to!">
                <expand macro="adapter_conditional" argument="-b" adapter_type="5' or 3'"/>
            </repeat>
        </section>
    </xml>
    <xml name="read2_adapters">
        <section name="r2" title="Read 2 Adapters" expanded="true">
            <repeat name="adapters2" title="3' (End) Adapters" help="Sequence of an adapter ligated to the 3' end of the second read in each pair. The adapter and subsequent bases are trimmed. If a '$' character is appended ('anchoring'), the adapter is only found if it is a suffix of the read. To search for a linked adapter, separate the 2 sequences with 3 dots (ADAPTER1...ADAPTER2), see Help below.">
                <expand macro="adapter_conditional" argument="-A" adapter_type="3'"/>
            </repeat>
            <repeat name="front_adapters2" title="5' (Front) Adapters" help="Sequence of an adapter ligated to the 5' end of the second read in each pair. The adapter and any preceding bases are trimmed. Partial matches at the 5' end are allowed. If a '^' character is prepended ('anchoring'), the adapter is only found if it is a prefix of the read. To search for a linked adapter, separate the 2 sequences with 3 dots (ADAPTER1...ADAPTER2), see Help below.">
                <expand macro="adapter_conditional" argument="-G" adapter_type="5'"/>
            </repeat>
            <repeat name="anywhere_adapters2" title="5' or 3' (Anywhere) Adapters" help="Sequence of an adapter that may be ligated to the 5' or 3' end of the second read in each pair. Both types of matches as described under under 3' und 5' Adapters are allowed. If the first base of the read is part of the match, the behavior is as with 5' Adapters, otherwise as with 3' Adapters. This option is mostly for rescuing failed library preparations - do not use if you know which end your adapter was ligated to!">
                <expand macro="adapter_conditional" argument="-B" adapter_type="5' or 3'"/>
            </repeat>
        </section>
        <param argument="--pair-adapters" type="boolean" truevalue="--pair-adapters" falsevalue="" label="Pairwise adapter search" help="The tool will normally look for R1 and R2 read adapters independently. By enabling this option you can have the lists of R1 and R2 read adapters handled pairwise instead. In this mode you need to provide equal numbers of R1 and R2 adapters of each type, or the tool will fail. For a more detailed explanation see the section Paired Adapters in the tool help below."/>
    </xml>
    <xml name="inherit_format_1">
        <actions>
            <conditional name="library.type">
                <when value="single">
                    <action type="format">
                        <option type="from_param" name="library.input_1" param_attribute="ext" />
                    </action>
                </when>
                <when value="paired">
                    <action type="format">
                        <option type="from_param" name="library.input_1" param_attribute="ext" />
                    </action>
                </when>
            </conditional>
        </actions>
    </xml>
    <xml name="inherit_format_2">
        <actions>
            <conditional name="library.type">
                <when value="paired">
                    <action type="format">
                        <option type="from_param" name="library.input_2" param_attribute="ext" />
                    </action>
                </when>
            </conditional>
        </actions>
    </xml>
</macros>