comparison macros_process.xml @ 0:7e5a174bc201 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/stacks2 commit b395fa36fa826e26085820ba3a9faacaeddcb460
author iuc
date Mon, 01 Jul 2019 10:57:49 -0400
parents
children 21d2aa544835
comparison
equal deleted inserted replaced
-1:000000000000 0:7e5a174bc201
1 <?xml version="1.0"?>
2
3 <!-- macros and tokens for process_radtags and process_short_reads -->
4
5 <macros>
6
7 <token name="@PROCESS_IOOPTIONS@"><![CDATA[
8 -p stacks_inputs/
9 #if $input_type.input_type_select == "paired"
10 --paired
11 #end if
12 -i $inputype
13 -b '$barcode'
14 $input_type.barcode_encoding
15 #if str( $outype ) != "auto"
16 -y $outype
17 #end if
18 -o stacks_outputs
19 ]]></token>
20 <xml name="process_output_types">
21 <param name="outype" argument="-y" type="select" label="Output format" >
22 <option value="auto" selected="True">Same as input</option>
23 <option value="fastq">fastq</option>
24 <option value="fasta">fasta</option>
25 <option value="gzfastq">gzipped fastq</option>
26 <option value="gzfasta">gzipped fasta</option>
27 </param>
28 </xml>
29
30 <xml name="discover_faqgz_output_macro" token_pattern="" token_dir="">
31 <expand macro="discover_faq_output_macro" pattern="@PATTERN@" dir="@DIR@"/>
32 <discover_datasets pattern="@PATTERN@\.fq\.gz$" ext="fastqsanger.gz" directory="@DIR@/" />
33 <discover_datasets pattern="@PATTERN@\.fa\.gz$" ext="fasta.gz" directory="@DIR@/" />
34 </xml>
35 <xml name="discover_faq_output_macro" token_pattern="" token_dir="">
36 <discover_datasets pattern="@PATTERN@\.fq$" ext="fastqsanger" directory="@DIR@/" />
37 <discover_datasets pattern="@PATTERN@\.fa$" ext="fasta" directory="@DIR@/" />
38 </xml>
39
40 <xml name="process_outputs">
41 <collection name="demultiplexed" type="list" label="${tool.name} on ${on_string} Demultiplexed reads">
42 <filter>input_type['input_type_select'] == "single"</filter>
43 <expand macro="discover_faqgz_output_macro" pattern="(?P&lt;name&gt;.+)" dir="stacks_outputs"/>
44 </collection>
45 <collection name="demultiplexed_paired" type="list:paired" label="${tool.name} on ${on_string} Demultiplexed reads">
46 <filter>input_type['input_type_select'] == "paired"</filter>
47 <expand macro="discover_faqgz_output_macro" pattern="(?P&lt;identifier_0&gt;.+)\.(?P&lt;identifier_1&gt;[^.]+)" dir="stacks_outputs"/>
48 </collection>
49
50 <collection name="remaining" type="list:paired" label="${tool.name} on ${on_string} Remaining orphan reads">
51 <filter>input_type['input_type_select'] == "paired"</filter>
52 <expand macro="discover_faqgz_output_macro" pattern="(?P&lt;identifier_0&gt;.+)\.rem\.(?P&lt;identifier_1&gt;[^.]+)" dir="stacks_outputs/remaining"/>
53 </collection>
54
55 <!-- note irrespective of -y output is always named fastq and are never zipped -->
56 <collection name="discarded" type="list" label="${tool.name} on ${on_string} Discarded reads">
57 <filter>capture is True and input_type['input_type_select'] == "single"</filter>
58 <expand macro="discover_faq_output_macro" pattern="(?P&lt;name&gt;.*)" dir="stacks_outputs/discarded"/>
59 </collection>
60 <collection name="discarded_paired" type="list:paired" label="${tool.name} on ${on_string} Discarded reads">
61 <filter>capture is True and input_type['input_type_select'] == "paired"</filter>
62 <expand macro="discover_faq_output_macro" pattern="(?P&lt;identifier_0&gt;.+)\.(?P&lt;identifier_1&gt;[^.]+)" dir="stacks_outputs/discarded"/>
63 </collection>
64 </xml>
65
66 <!-- FASTQ filtering options -->
67 <xml name="process_filter">
68 <conditional name="filter_cond" >
69 <param name="filter_select" type="select" label="Do quality filtering">
70 <option value="yes">Yes</option>
71 <option value="no" selected="true">No</option>
72 </param>
73 <when value="yes">
74 <param name="sliding" type="float" value="0.15" min="0" max="1" argument="-w" label="Set the size of the sliding window as a fraction of the read length, between 0 and 1" />
75 <param name="score" type="integer" value="10" min="0" max="40" argument="-s" label="Set the score limit. If the average score within the sliding window drops below this value, the read is discarded" />
76 <param name="remove" type="boolean" checked="false" truevalue="-c" falsevalue="" argument="-c" label="Clean data, remove any read with an uncalled base" />
77 <param name="discard" type="boolean" checked="false" truevalue="-q" falsevalue="" argument="-q" label="Discard reads with low quality scores"/>
78 <param argument="--filter_illumina" type="boolean" checked="false" truevalue="--filter_illumina" falsevalue="" label="Discard reads that have been marked by Illumina's chastity/purity filter as failing" />
79 </when>
80 <when value="no">
81 <param argument="--len_limit" type="integer" value="" optional="true" label="Minimum sequence length" help="useful if your data has already been trimmed"/>
82 </when>
83 </conditional>
84 <param name="capture" type="boolean" checked="false" truevalue="-D" falsevalue="" argument="-D" label="Capture discarded reads to a file" />
85 </xml>
86 <token name="@PROCESS_FILTER@"><![CDATA[
87 #if $filter_cond.filter_select == 'yes':
88 -w $filter_cond.sliding
89 -s $filter_cond.score
90 $filter_cond.remove
91 $filter_cond.discard
92 $filter_cond.filter_illumina
93 #else
94 #if str($filter_cond.len_limit) != "":
95 --len_limit $filter_cond.len_limit
96 #end if
97 #end if
98 $capture
99 ]]></token>
100 <token name="@PROCESS_FASTQ_POSTPROC@"><![CDATA[
101 #if $capture:
102 && mkdir stacks_outputs/discarded/
103 && mv stacks_outputs/*discards stacks_outputs/discarded/
104
105 ## fix the _R[12]_0 that was added for preparing the input
106 #if $input_type.input_type_select == 'paired':
107 && find stacks_outputs/discarded/ -type f | while read file; do mv "\$file" "\$(echo \$file | sed 's/_R1_0/.1/; s/_R2_0/.2/;')"; done
108 #end if
109 ## also remove the gz which is added by procrad (but its uncompressed)
110 && find stacks_outputs/discarded/ -type f -iname "*.gz.discards" | while read file; do mv "\$file" "\$(echo \$file | sed 's/.gz.discards$/.discards/;')"; done
111
112 ## the discard files are named fastq even if the output is fasta
113 #if str($outype).endswith("fasta"):
114 && find stacks_outputs/discarded/ -type f | while read file; do mv "\$file" "\$(echo \$file | sed 's/\.fastq.discards/.fa/;')"; done
115 #else
116 && find stacks_outputs/discarded/ -type f | while read file; do mv "\$file" "\$(echo \$file | sed 's/\.fastq.discards/.fq/;')"; done
117 #end if
118 #end if
119 ## prepare paired read output for processing in galaxy
120 #if $input_type.input_type_select == 'paired':
121 && mkdir stacks_outputs/remaining
122 && find stacks_outputs -iregex ".*\.rem\.[12]\.f[aq]\(\.gz\)?" | while read file; do mv "\$file" stacks_outputs/remaining/; done
123 && find stacks_outputs/ -iregex ".*.f[aq]\(\.gz\)?" | while read file; do mv "\$file" "\$(echo \$file | sed 's/\.1\./.forward./; s/\.2\./.reverse./')"; done
124 #end if
125 ]]></token>
126
127 <!-- adapter trimming options -->
128 <xml name="process_adapter">
129 <param argument="--adapter_1" type="text" value="" optional="true" label="Adaptor sequence that may occur on the first read" />
130 <param argument="--adapter_2" type="text" value="" optional="true" label="Adaptor sequence that may occur on the paired-read" />
131 <param argument="--adapter_mm" type="integer" value="" optional="true" label="Number of mismatches allowed in the adapter sequence"/>
132 </xml>
133 <token name="@PROCESS_ADAPTER@"><![CDATA[
134 ## Adapter options
135 #if str($options_advanced.adapter_1) != "":
136 --adapter_1 $options_advanced.adapter_1
137 #end if
138 #if str($options_advanced.adapter_2) != "":
139 --adapter_2 $options_advanced.adapter_2
140 #end if
141 #if str($options_advanced.adapter_mm) != "":
142 --adapter_mm $options_advanced.adapter_mm
143 #end if
144 ]]></token>
145
146 <!-- barcode rescue options -->
147 <xml name="rescue_barcode">
148 <conditional name="rescue_cond">
149 <param name="rescue" type="select" argument="-r" label="Rescue mutated barcodes and RAD-Tags?">
150 <option value="-r">yes</option>
151 <option value="" selected="true">no</option>
152 </param>
153 <when value="-r">
154 <param argument="--barcode_dist_1" type="integer" value="" optional="true" label="Number of allowed mismatches when rescuing first read barcodes" help="(default 1)"/>
155 <param argument="--barcode_dist_2" type="integer" value="" optional="true" label="Number of allowed mismatches when rescuing paired read barcodes" help="(default value for single end barcodes)"/>
156 </when>
157 <when value=""/>
158 </conditional>
159 </xml>
160 <token name="@RESCUE_BARCODE@"><![CDATA[
161 #if str($options_advanced.rescue_cond.rescue) != ""
162 $options_advanced.rescue_cond.rescue
163 #if str($options_advanced.rescue_cond.barcode_dist_1) != "":
164 --barcode_dist_1 $options_advanced.rescue_cond.barcode_dist_1
165 #end if
166 #if str($options_advanced.rescue_cond.barcode_dist_2) != "":
167 --barcode_dist_2 $options_advanced.rescue_cond.barcode_dist_2
168 #end if
169 #end if
170 ]]></token>
171
172 <!-- advanced options that are shared -->
173 <xml name="common_advanced">
174 <param name="truncate" type="integer" value="" optional="True" argument="-t" label="Truncate final read length to this value" />
175 <param argument="--retain_header" type="boolean" checked="false" truevalue="--retain_header" falsevalue="" label="Retain unmodified FASTQ headers in the output" />
176 </xml>
177 <token name="@COMMON_ADVANCED@"><![CDATA[
178 #if str($options_advanced.truncate)
179 -t $options_advanced.truncate
180 #end if
181 $options_advanced.retain_header
182 ]]></token>
183 </macros>