view macros.xml @ 16:8f1df515eb87 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cutadapt commit 034c93600ce3279644d05f3675b4820ef7180851
author iuc
date Thu, 01 Nov 2018 19:19:11 -0400
parents 78e1cf88d133
children 49370cb85f0f
line wrap: on
line source

<macros>

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

        ## Read1 trimming

        #for $a in $library.r1.adapters
            #if $a.adapter_source.adapter_source_list == 'builtin':
                -a "${a.adapter_source.adapter.fields.name}"='${a.adapter_source.adapter}'
            #else if str($a.adapter_source.adapter_name) != "":
                -a '${a.adapter_source.adapter_name}'='${a.adapter_source.adapter}'
            #else
                -a '${a.adapter_source.adapter}'
            #end if
        #end for
        #for $aa in $library.r1.anywhere_adapters
            #if $aa.anywhere_adapter_source.anywhere_adapter_source_list == 'builtin':
                -b ${aa.anywhere_adapter_source.anywhere_adapter.fields.name}"='${aa.anywhere_adapter_source.anywhere_adapter}'
            #else if str($aa.anywhere_adapter_source.anywhere_adapter_name) != "":
                -b '${aa.anywhere_adapter_source.anywhere_adapter_name}'='${aa.anywhere_adapter_source.anywhere_adapter}'
            #else
                -b '${aa.anywhere_adapter_source.anywhere_adapter}'
            #end if
        #end for
        #for $fa in $library.r1.front_adapters
            #if $fa.front_adapter_source.front_adapter_source_list == 'builtin':
                -g "${fa.front_adapter_source.front_adapter.fields.name}"='${fa.front_adapter_source.front_adapter}'
            #else if str($fa.front_adapter_source.front_adapter_name) != "":
                -g '${fa.front_adapter_source.front_adapter_name}'='${fa.front_adapter_source.front_adapter}'
            #else
                -g '${fa.front_adapter_source.front_adapter}'
            #end if
        #end for

        #if str($library.r1.cut) != '0':
            -u $library.r1.cut
        #end if

        ## Additional Outputs

        #if $output_options.info_file:
            --info-file=$info_file
        #end if
        #if $output_options.rest_file:
            --rest-file=$rest_output
        #end if
        #if $output_options.wildcard_file:
            --wildcard-file=$wild_output
        #end if
        #if $output_options.too_short_file:
            --too-short-output=$too_short_output
        #end if
        #if $output_options.too_long_file:
            --too-long-output=$too_long_output
        #end if
        #if $output_options.untrimmed_file:
            --untrimmed-output=$untrimmed_output
        #end if

    ]]></token>

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

        ## Read2 trimming

        #for $a in $library.r2.adapters2
            #if $a.adapter_source2.adapter_source_list2 == 'builtin':
                -A "${a.adapter_source2.adapter2.fields.name}"='${a.adapter_source2.adapter2}'
            #else if str($a.adapter_source2.adapter_name2) != "":
                -A '${a.adapter_source2.adapter_name2}'='${a.adapter_source2.adapter2}'
            #else
                -A '${a.adapter_source2.adapter2}'
            #end if
        #end for
        #for $aa in $library.r2.anywhere_adapters2
            #if $aa.anywhere_adapter_source2.anywhere_adapter_source_list2 == 'builtin':
                -B "${aa.anywhere_adapter_source2.anywhere_adapter2.fields.name}"='${aa.anywhere_adapter_source2.anywhere_adapter2}'
            #else if str($aa.anywhere_adapter_source2.anywhere_adapter_name2) != "":
                -B '${aa.anywhere_adapter_source2.anywhere_adapter_name2}'='${aa.anywhere_adapter_source2.anywhere_adapter2}'
            #else
                -B '${aa.anywhere_adapter_source2.anywhere_adapter2}'
            #end if
        #end for
        #for $fa in $library.r2.front_adapters2
            #if $fa.front_adapter_source2.front_adapter_source_list2 == 'builtin':
                -G "${fa.front_adapter_source2.front_adapter2.fields.name}"='${fa.front_adapter_source2.front_adapter2}'
            #else if str($fa.front_adapter_source2.front_adapter_name2) != "":
                -G '${fa.front_adapter_source2.front_adapter_name2}'='${fa.front_adapter_source2.front_adapter2}'
            #else
                -G '${fa.front_adapter_source2.front_adapter2}'
            #end if
        #end for

        #if str($library.r2.cut2) != '0':
            -U $library.r2.cut2
        #end if

        ## Additional Outputs - Read 2

        #if $output_options.too_short_file:
            --too-short-paired-output=$too_short_paired_output
        #end if
        #if $output_options.too_long_file:
            --too-long-paired-output=$too_long_paired_output
        #end if
        #if $output_options.untrimmed_file:
            --untrimmed-paired-output=$untrimmed_paired_output
        #end if

    ]]></token>

        <xml name="single_end_options" >

            <section name="r1" title="Read 1 Options" 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.">
                    <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>
                        </param>

                        <when value="user">
                            <param name="adapter_name" type="text" value="" optional="True" label="Enter custom 3' adapter name (Optional if Multiple output is 'No')" />
                            <param name="adapter" argument="-a" type="text" value="AATTGGCC" label="Enter custom 3' adapter sequence" />
                        </when>

                        <when value="builtin">
                            <param name="adapter" argument="-a" type="select" label="Choose 3' adapter">
                                <options from_data_table="adapters">
                                    <filter type="sort_by" column="1" />
                                </options>
                            </param>
                        </when>
                    </conditional>
                </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.">
                    <conditional name="front_adapter_source">
                        <param name="front_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>
                        </param>

                        <when value="user">
                            <param name="front_adapter_name" type="text" value="" optional="True" label="Enter custom 5' adapter name (Optional if Multiple output is 'No')" />
                            <param name="front_adapter" argument="-g" type="text" value="AATTGGCC" label="Enter custom 5' adapter sequence" />
                        </when>
                        <when value="builtin">
                            <param name="front_adapter" argument="-g" type="select" label="Choose 5' adapter">
                                <options from_data_table="adapters">
                                    <filter type="sort_by" column="1" />
                                </options>
                            </param>
                        </when>
                    </conditional>
                </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!">
                    <conditional name="anywhere_adapter_source">
                        <param name="anywhere_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>
                        </param>

                        <when value="user">
                            <param name="anywhere_adapter_name" type="text" value="" optional="True" label="Enter custom 5' or 3' adapter name (Optional if Multiple output is 'No')"  />
                            <param name="anywhere_adapter" argument="-b" type="text" value="AATTGGCC" label="Enter custom 5' or 3' adapter sequence" />
                        </when>
                        <when value="builtin">
                            <param name="anywhere_adapter" argument="-b" type="select" label="Choose 5' or 3' adapter">
                                <options from_data_table="adapters">
                                    <filter type="sort_by" column="1" />
                                </options>
                            </param>
                        </when>
                    </conditional>
                </repeat>

                <param name="cut" argument="-u" type="integer" value="0" optional="True" label="Cut bases from reads before adapter trimming" help="Remove bases from each read (first read only if paired). If positive, remove bases from the beginning. If negative, remove bases from the end. This is applied *before* adapter trimming." />

            </section>

        </xml>

        <xml name="paired_end_options" >

            <!-- Read 1 Options -->
            <expand macro="single_end_options" />

            <!-- Read 2 Options -->
            <section name="r2" title="Read 2 Options" 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.">
                    <conditional name="adapter_source2">
                        <param name="adapter_source_list2" type="select" label="Source" >
                            <option value="builtin" selected="True">Standard (select from the list below)</option>
                            <option value="user">Enter custom sequence</option>
                        </param>

                        <when value="user">
                            <param name="adapter_name2" type="text" value="" optional="True" label="Enter custom 3' adapter name (Optional)" />
                            <param name="adapter2" argument="-A" type="text" label="Enter custom 3' adapter sequence" value="AATTGGCC" />
                        </when>

                        <when value="builtin">
                            <param name="adapter2" argument="-A" type="select" label="Choose 3' adapter">
                                <options from_data_table="adapters">
                                    <filter type="sort_by" column="1" />
                                </options>
                            </param>
                        </when>
                    </conditional>
                </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.">
                    <conditional name="front_adapter_source2">
                        <param name="front_adapter_source_list2" type="select" label="Source">
                            <option value="builtin" selected="True">Standard (select from the list below)</option>
                            <option value="user">Enter custom sequence</option>
                        </param>

                        <when value="user">
                            <param name="front_adapter_name2" type="text" value="" label="Enter custom 5' adapter name (Optional)" />
                            <param name="front_adapter2" argument="-G" type="text" value="AATTGGCC" label="Enter custom 5' adapter sequence" />
                        </when>
                        <when value="builtin">
                            <param name="front_adapter2" argument="-G" type="select" label="Choose 5' adapter">
                                <options from_data_table="adapters">
                                    <filter type="sort_by" column="1" />
                                </options>
                            </param>
                        </when>
                    </conditional>
                </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!">
                    <conditional name="anywhere_adapter_source2">
                        <param name="anywhere_adapter_source_list2" type="select" label="Source">
                            <option value="builtin" selected="True">Standard (select from the list below)</option>
                            <option value="user">Enter custom sequence</option>
                        </param>

                        <when value="user">
                            <param name="anywhere_adapter_name2" type="text" value="" optional="True" label="Enter custom 5' or 3' adapter name (Optional)" />
                            <param name="anywhere_adapter2" argument="-B" type="text" label="Enter custom 5' or 3' adapter sequence" value="AATTGGCC" />
                        </when>
                        <when value="builtin">
                            <param name="anywhere_adapter2" argument="-B" type="select" label="Choose 5' or 3' adapter">
                                <options from_data_table="adapters">
                                    <filter type="sort_by" column="1" />
                                </options>
                            </param>
                        </when>
                    </conditional>
                </repeat>

            <param name="cut2" argument="-U" type="integer" value="0" optional="True" label="Cut bases from the second read in each pair." help="Remove bases from the beginning or end of each read before trimming adapters. If positive, the bases are removed from the beginning of each read. If negative, the bases are removed from the end of each read." />

            </section>

        </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>
                    <when value="paired_collection">
                        <action type="format">
                            <option type="from_param" name="library.input_1" param_attribute="forward.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>
                    <when value="paired_collection">
                        <action type="format">
                            <option type="from_param" name="library.input_1" param_attribute="reverse.ext" />
                        </action>
                    </when>
                </conditional>
            </actions>
        </xml>

</macros>