comparison macros_process.xml @ 5:aef37afe214f draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/stacks2 commit 4e87a14a5479800df9675c1cbcdbe1b11f63653b-dirty
author matthias
date Wed, 27 Feb 2019 09:58:12 -0500
parents e0ac675a6785
children
comparison
equal deleted inserted replaced
4:176f2a0c6683 5:aef37afe214f
1 <?xml version="1.0"?> 1 <?xml version="1.0"?>
2 2
3 <!-- macros and tokens for process_radtags and process_short_reads --> 3 <!-- macros and tokens for process_radtags and process_short_reads -->
4 4
5 <macros> 5 <macros>
6 <!-- fastq input for process_radtags/shortreads--> 6
7 <xml name="process_inputs">
8 <conditional name="input_type">
9 <param name="options_type_selector" type="select" label="Single-end or paired-end reads files">
10 <option value="single" selected="True">Single-end files</option>
11 <option value="paired">Paired-end files</option>
12 </param>
13 <when value="single">
14 <param name="fqinputs" argument="-f" format="fastqsanger,fastqsanger.gz" multiple="true" type="data" label="singles-end reads infile(s)" help="input files" />
15 <param name="barcode_encoding" type="select" label="Barcode location">
16 <expand macro="barcode_encoding_single" type="Barcode" />
17 </param>
18 </when>
19 <when value="paired">
20 <param name="fqinputs" type="data_collection" collection_type="list:paired" label="paired-end reads infile(s)" format="fastqsanger,fastqsanger.gz"/>
21 <param name="barcode_encoding" type="select" label="Barcode location">
22 <expand macro="barcode_encoding_pair" type="Barcode" />
23 </param>
24 </when>
25 </conditional>
26 <param name="barcode" argument="-b" type="data" format="tabular,txt" label="Barcode file" />
27 </xml>
28 <token name="@FASTQ_INPUT_PREPROC@"><![CDATA[
29 #for $input in $input_type.fqinputs:
30 #if $input_type.options_type_selector == "single"
31 #set $isfq=$input.is_of_type('fastqsanger')
32 #set $name=$clean_ext($input.element_identifier)
33 #else:
34 #set $isfq=$input.forward.is_of_type('fastqsanger')
35 ## TODO if https://github.com/galaxyproject/galaxy/pull/7031 is
36 ## backported use element_identifier consistently and fix release in <tool>?
37 #set $name=$clean_ext($input.name)
38 #end if
39
40 #if $isfq:
41 #set $ext = "fastq"
42 #set inputype = "fastq"
43 #else
44 #set $ext = "fastq.gz"
45 #set inputype = "gzfastq"
46 #end if
47
48 #if $input_type.options_type_selector == "single"
49 ln -s '$input' 'stacks_inputs/${name}.${ext}' &&
50 #else:
51 ## procrad needs _R[12]_ in the file name, so we add an add 0
52 ln -s '$input.forward' 'stacks_inputs/${name}_R1_0.${ext}' &&
53 ln -s '$input.reverse' 'stacks_inputs/${name}_R2_0.${ext}' &&
54 #end if
55 #end for
56 ]]></token>
57 <token name="@PROCESS_IOOPTIONS@"><![CDATA[ 7 <token name="@PROCESS_IOOPTIONS@"><![CDATA[
58 -p stacks_inputs/ 8 -p stacks_inputs/
59 #if $input_type.options_type_selector == "paired" 9 #if $input_type.input_type_select == "paired"
60 --paired 10 --paired
61 #end if 11 #end if
62 -i $inputype 12 -i $inputype
63 -b '$barcode' 13 -b '$barcode'
64 $input_type.barcode_encoding 14 $input_type.barcode_encoding
87 <discover_datasets pattern="@PATTERN@\.fa$" ext="fasta" directory="@DIR@/" /> 37 <discover_datasets pattern="@PATTERN@\.fa$" ext="fasta" directory="@DIR@/" />
88 </xml> 38 </xml>
89 39
90 <xml name="process_outputs"> 40 <xml name="process_outputs">
91 <collection name="demultiplexed" type="list" label="${tool.name} on ${on_string} Demultiplexed reads"> 41 <collection name="demultiplexed" type="list" label="${tool.name} on ${on_string} Demultiplexed reads">
92 <filter>input_type['options_type_selector'] == "single"</filter> 42 <filter>input_type['input_type_select'] == "single"</filter>
93 <expand macro="discover_faqgz_output_macro" pattern="(?P&lt;name&gt;.+)" dir="stacks_outputs"/> 43 <expand macro="discover_faqgz_output_macro" pattern="(?P&lt;name&gt;.+)" dir="stacks_outputs"/>
94 </collection> 44 </collection>
95 <collection name="demultiplexed_paired" type="list:paired" label="${tool.name} on ${on_string} Demultiplexed reads"> 45 <collection name="demultiplexed_paired" type="list:paired" label="${tool.name} on ${on_string} Demultiplexed reads">
96 <filter>input_type['options_type_selector'] == "paired"</filter> 46 <filter>input_type['input_type_select'] == "paired"</filter>
97 <expand macro="discover_faqgz_output_macro" pattern="(?P&lt;identifier_0&gt;.+)\.(?P&lt;identifier_1&gt;[^.]+)" dir="stacks_outputs"/> 47 <expand macro="discover_faqgz_output_macro" pattern="(?P&lt;identifier_0&gt;.+)\.(?P&lt;identifier_1&gt;[^.]+)" dir="stacks_outputs"/>
98 </collection> 48 </collection>
99 49
100 <collection name="remaining" type="list:paired" label="${tool.name} on ${on_string} Remaining orphan reads"> 50 <collection name="remaining" type="list:paired" label="${tool.name} on ${on_string} Remaining orphan reads">
101 <filter>input_type['options_type_selector'] == "paired"</filter> 51 <filter>input_type['input_type_select'] == "paired"</filter>
102 <expand macro="discover_faqgz_output_macro" pattern="(?P&lt;identifier_0&gt;.+)\.rem\.(?P&lt;identifier_1&gt;[^.]+)" dir="stacks_outputs/remaining"/> 52 <expand macro="discover_faqgz_output_macro" pattern="(?P&lt;identifier_0&gt;.+)\.rem\.(?P&lt;identifier_1&gt;[^.]+)" dir="stacks_outputs/remaining"/>
103 </collection> 53 </collection>
104 54
105 <!-- note irrespective of -y output is always named fastq and are never zipped --> 55 <!-- note irrespective of -y output is always named fastq and are never zipped -->
106 <collection name="discarded" type="list" label="${tool.name} on ${on_string} Discarded reads"> 56 <collection name="discarded" type="list" label="${tool.name} on ${on_string} Discarded reads">
107 <filter>capture is True and input_type['options_type_selector'] == "single"</filter> 57 <filter>capture is True and input_type['input_type_select'] == "single"</filter>
108 <expand macro="discover_faq_output_macro" pattern="(?P&lt;name&gt;.*)" dir="stacks_outputs/discarded"/> 58 <expand macro="discover_faq_output_macro" pattern="(?P&lt;name&gt;.*)" dir="stacks_outputs/discarded"/>
109 </collection> 59 </collection>
110 <collection name="discarded_paired" type="list:paired" label="${tool.name} on ${on_string} Discarded reads"> 60 <collection name="discarded_paired" type="list:paired" label="${tool.name} on ${on_string} Discarded reads">
111 <filter>capture is True and input_type['options_type_selector'] == "paired"</filter> 61 <filter>capture is True and input_type['input_type_select'] == "paired"</filter>
112 <expand macro="discover_faq_output_macro" pattern="(?P&lt;identifier_0&gt;.+)\.(?P&lt;identifier_1&gt;[^.]+)" dir="stacks_outputs/discarded"/> 62 <expand macro="discover_faq_output_macro" pattern="(?P&lt;identifier_0&gt;.+)\.(?P&lt;identifier_1&gt;[^.]+)" dir="stacks_outputs/discarded"/>
113 </collection> 63 </collection>
114 </xml> 64 </xml>
115 65
116 <!-- FASTQ filtering options --> 66 <!-- FASTQ filtering options -->
117 <xml name="process_filter"> 67 <xml name="process_filter">
118 <conditional name="filter_cond" > 68 <conditional name="filter_cond" >
119 <param name="filter_select" type="select" label="do quality filtering"> 69 <param name="filter_select" type="select" label="Do quality filtering">
120 <option value="yes">Yes</option> 70 <option value="yes">Yes</option>
121 <option value="no" selected="true">No</option> 71 <option value="no" selected="true">No</option>
122 </param> 72 </param>
123 <when value="yes"> 73 <when value="yes">
124 <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" /> 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" />
125 <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" /> 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" />
126 <param name="remove" type="boolean" checked="false" truevalue="-c" falsevalue="" argument="-c" label="Clean data, remove any read with an uncalled base" /> 76 <param name="remove" type="boolean" checked="false" truevalue="-c" falsevalue="" argument="-c" label="Clean data, remove any read with an uncalled base" />
127 <param name="discard" type="boolean" checked="false" truevalue="-q" falsevalue="" argument="-q" label="Discard reads with low quality scores"/> 77 <param name="discard" type="boolean" checked="false" truevalue="-q" falsevalue="" argument="-q" label="Discard reads with low quality scores"/>
128 <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" /> 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" />
129 </when> 79 </when>
130 <when value="no"> 80 <when value="no">
131 <param argument="--len_limit" type="integer" value="" optional="true" label="minimum sequence length" help="useful if your data has already been trimmed"/> 81 <param argument="--len_limit" type="integer" value="" optional="true" label="Minimum sequence length" help="useful if your data has already been trimmed"/>
132 </when> 82 </when>
133 </conditional> 83 </conditional>
134 <param name="capture" type="boolean" checked="false" truevalue="-D" falsevalue="" argument="-D" label="Capture discarded reads to a file" /> 84 <param name="capture" type="boolean" checked="false" truevalue="-D" falsevalue="" argument="-D" label="Capture discarded reads to a file" />
135 </xml> 85 </xml>
136 <token name="@PROCESS_FILTER@"><![CDATA[ 86 <token name="@PROCESS_FILTER@"><![CDATA[
151 #if $capture: 101 #if $capture:
152 && mkdir stacks_outputs/discarded/ 102 && mkdir stacks_outputs/discarded/
153 && mv stacks_outputs/*discards stacks_outputs/discarded/ 103 && mv stacks_outputs/*discards stacks_outputs/discarded/
154 104
155 ## fix the _R[12]_0 that was added for preparing the input 105 ## fix the _R[12]_0 that was added for preparing the input
156 #if $input_type.options_type_selector == 'paired': 106 #if $input_type.input_type_select == 'paired':
157 && find stacks_outputs/discarded/ -type f | while read file; do mv "\$file" "\$(echo \$file | sed 's/_R1_0/.1/; s/_R2_0/.2/;')"; done 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
158 #end if 108 #end if
159 ## also remove the gz which is added by procrad (but its uncompressed) 109 ## also remove the gz which is added by procrad (but its uncompressed)
160 && find stacks_outputs/discarded/ -type f -iname "*.gz.discards" | while read file; do mv "\$file" "\$(echo \$file | sed 's/.gz.discards$/.discards/;')"; done 110 && find stacks_outputs/discarded/ -type f -iname "*.gz.discards" | while read file; do mv "\$file" "\$(echo \$file | sed 's/.gz.discards$/.discards/;')"; done
161 111
165 #else 115 #else
166 && find stacks_outputs/discarded/ -type f | while read file; do mv "\$file" "\$(echo \$file | sed 's/\.fastq.discards/.fq/;')"; done 116 && find stacks_outputs/discarded/ -type f | while read file; do mv "\$file" "\$(echo \$file | sed 's/\.fastq.discards/.fq/;')"; done
167 #end if 117 #end if
168 #end if 118 #end if
169 ## prepare paired read output for processing in galaxy 119 ## prepare paired read output for processing in galaxy
170 #if $input_type.options_type_selector == 'paired': 120 #if $input_type.input_type_select == 'paired':
171 && mkdir stacks_outputs/remaining 121 && mkdir stacks_outputs/remaining
172 && find stacks_outputs -iregex ".*\.rem\.[12]\.f[aq]\(\.gz\)?" | while read file; do mv "\$file" stacks_outputs/remaining/; done 122 && find stacks_outputs -iregex ".*\.rem\.[12]\.f[aq]\(\.gz\)?" | while read file; do mv "\$file" stacks_outputs/remaining/; done
173 && find stacks_outputs/ -iregex ".*.f[aq]\(\.gz\)?" | while read file; do mv "\$file" "\$(echo \$file | sed 's/\.1\./.forward./; s/\.2\./.reverse./')"; 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
174 #end if 124 #end if
175 ]]></token> 125 ]]></token>
176 126
177
178
179 <!-- adapter trimming options --> 127 <!-- adapter trimming options -->
180 <xml name="process_adapter"> 128 <xml name="process_adapter">
181 <param argument="--adapter_1" type="text" value="" optional="true" label="adaptor sequence that may occur on the first read" /> 129 <param argument="--adapter_1" type="text" value="" optional="true" label="Adaptor sequence that may occur on the first read" />
182 <param argument="--adapter_2" type="text" value="" optional="true" label="adaptor sequence that may occur on the paired-read" /> 130 <param argument="--adapter_2" type="text" value="" optional="true" label="Adaptor sequence that may occur on the paired-read" />
183 <param argument="--adapter_mm" type="integer" value="" optional="true" label="number of mismatches allowed in the adapter sequence"/> 131 <param argument="--adapter_mm" type="integer" value="" optional="true" label="Number of mismatches allowed in the adapter sequence"/>
184 </xml> 132 </xml>
185 <token name="@PROCESS_ADAPTER@"><![CDATA[ 133 <token name="@PROCESS_ADAPTER@"><![CDATA[
186 ## Adapter options 134 ## Adapter options
187 #if str($options_advanced.adapter_1) != "": 135 #if str($options_advanced.adapter_1) != "":
188 --adapter_1 $options_advanced.adapter_1 136 --adapter_1 $options_advanced.adapter_1
200 <conditional name="rescue_cond"> 148 <conditional name="rescue_cond">
201 <param name="rescue" type="select" argument="-r" label="Rescue mutated barcodes and RAD-Tags?"> 149 <param name="rescue" type="select" argument="-r" label="Rescue mutated barcodes and RAD-Tags?">
202 <option value="-r">yes</option> 150 <option value="-r">yes</option>
203 <option value="" selected="true">no</option> 151 <option value="" selected="true">no</option>
204 </param> 152 </param>
205 <when value="-r"> 153 <when value="-r">
206 <param argument="--barcode_dist_1" type="integer" value="" optional="true" label="number of allowed mismatches when rescuing first read barcodes" help="(default 1)"/> 154 <param argument="--barcode_dist_1" type="integer" value="" optional="true" label="Number of allowed mismatches when rescuing first read barcodes" help="(default 1)"/>
207 <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)"/> 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)"/>
208 </when> 156 </when>
209 <when value=""/> 157 <when value=""/>
210 </conditional> 158 </conditional>
211 </xml> 159 </xml>
212 <token name="@RESCUE_BARCODE@"><![CDATA[ 160 <token name="@RESCUE_BARCODE@"><![CDATA[
219 --barcode_dist_2 $options_advanced.rescue_cond.barcode_dist_2 167 --barcode_dist_2 $options_advanced.rescue_cond.barcode_dist_2
220 #end if 168 #end if
221 #end if 169 #end if
222 ]]></token> 170 ]]></token>
223 171
224 <!-- advanced options that are shared --> 172 <!-- advanced options that are shared -->
225 <xml name="common_advanced"> 173 <xml name="common_advanced">
226 <param name="truncate" type="integer" value="" optional="True" argument="-t" label="Truncate final read length to this value" /> 174 <param name="truncate" type="integer" value="" optional="True" argument="-t" label="Truncate final read length to this value" />
227 <param argument="--retain_header" type="boolean" checked="false" truevalue="--retain_header" falsevalue="" label="Retain unmodified FASTQ headers in the output" /> 175 <param argument="--retain_header" type="boolean" checked="false" truevalue="--retain_header" falsevalue="" label="Retain unmodified FASTQ headers in the output" />
228 </xml> 176 </xml>
229 <token name="@COMMON_ADVANCED@"><![CDATA[ 177 <token name="@COMMON_ADVANCED@"><![CDATA[