comparison convert_extract_sequence_file.xml @ 0:01c2b74b3a21 draft

planemo upload commit 23ef4b1699065b4f6200c58328bfecfb33dd7fd1-dirty
author bebatut
date Tue, 26 Apr 2016 08:18:18 -0400
parents
children 158642ce204f
comparison
equal deleted inserted replaced
-1:000000000000 0:01c2b74b3a21
1 <tool id="convert_extract_sequence_file" name="Convert/ Extract information" version="1.0.0">
2
3 <description>from a sequence file, with possible constraints</description>
4
5 <macros>
6 <xml name="extraction_option">
7 <param name="to_extract" type="select" display="checkboxes" multiple="true" label="Information to extract" help="">
8 <option value="id">Identifiant</option>
9 <option value="length">Length</option>
10 <validator type="no_options" message="Select at least one information to extract"/>
11 </param>
12 </xml>
13
14 <xml name="extraction_test">
15 <param name='specific_extraction' type="select" label="Extract specific information?" help="If no is selected, a sequence file is generated. If yes, a text file containing the wanted information is generated">
16 <option value="True">Yes</option>
17 <option value="False" selected="true">No</option>
18 </param>
19 </xml>
20 </macros>
21
22 <requirements>
23 </requirements>
24
25 <stdio>
26 </stdio>
27
28 <version_command>
29 </version_command>
30
31 <!--<command>-->
32 <command><![CDATA[
33 python $__tool_directory__/convert_extract_sequence_file.py
34 --input $sequence_file_format.sequence_file
35
36 --custom_extraction_type $sequence_file_format.extraction.specific_extraction
37
38 #if $sequence_file_format.extraction.specific_extraction == "True":
39 --to_extract "{$sequence_file_format.extraction.to_extract}"
40 --output_information $information_file
41 #else if $sequence_file_format.format=="fastq":
42 --split $sequence_file_format.extraction.split.split_test
43 #if $sequence_file_format.extraction.split.split_test :
44 --quality_format $sequence_file_format.extraction.split.quality_format
45 --output_sequence $fasta_sequence_file_from_fastq
46 --output_quality $quality_file
47 #else:
48 --output_sequence $fastq_sequence_file
49 #end if
50 #else:
51 --output_sequence $fasta_sequence_file
52 #end if
53
54 #if $constraints.constrained_extraction == "True" :
55 #for $i, $constrain in enumerate( $constraints.constraint_definition )
56 #set info_to_constrain=$constrain.constrained_information['info_to_constrain']
57 #if $info_to_constrain in ("id"):
58 --constraint "$info_to_constrain:
59 ${constrain.constrained_information.constraint_type.type}:
60 ${constrain.constrained_information.constraint_type.value}"
61 #else:
62 #for $j, $sub_constrain in enumerate( $constrain.constrained_information.constraint_definition )
63 --constraint "$info_to_constrain:
64 ${sub_constrain.type}:
65 ${sub_constrain.value}"
66 #end for
67 #end if
68 #end for
69 #end if
70
71 --report $report_filepath
72 --format $sequence_file_format.format
73 ]]>
74 </command>
75
76 <inputs>
77 <conditional name="sequence_file_format">
78 <param name="format" type="select" display="radio"
79 label="Format of the sequence file" help="">
80 <option value="fasta">Fasta</option>
81 <option value="fastq">FastQ</option>
82 </param>
83 <when value="fastq">
84 <param name="sequence_file" type="data" format="fastq"
85 label="Sequence file" help=""/>
86 <conditional name="extraction">
87 <expand macro="extraction_test"/>
88
89 <when value="True">
90 <expand macro="extraction_option"/>
91 </when>
92 <when value="False">
93 <conditional name="split">
94 <param name='split_test' type="select" label="Split file into sequence and quality files?" help="If yes is selected, a fasta and a quality file are generated. If no, a fastq file is generated">
95 <option value="True" selected="true">Yes</option>
96 <option value="False">No</option>
97 </param>
98
99 <when value="True">
100 <param name="quality_format" type="select" display="radio" label="Coding of quality scores?" help="">
101 <option value="sanger" selected="true">Sanger (Phred+33)</option>
102 <option value="solexa">Solexa (Solexa+64) </option>
103 <option value="illumina_1_3">Illumina 1.3+ (Phred+64) </option>
104 <option value="illumina_1_5">Illumina 1.5+ (Phred+64) </option>
105 <option value="illumina_1_8">Illumina 1.8+ (Phred+33) </option>
106 </param>
107 </when>
108 <when value="False" />
109 </conditional>
110 </when>
111 </conditional>
112 </when>
113
114 <when value="fasta">
115 <param name="sequence_file" type="data" format="fasta"
116 label="Sequence file" help=""/>
117 <conditional name="extraction">
118 <expand macro="extraction_test"/>
119
120 <when value="True">
121 <expand macro="extraction_option"/>
122 </when>
123 <when value="False" />
124 </conditional>
125 </when>
126 </conditional>
127
128 <conditional name="constraints">
129 <param name='constrained_extraction' type='select' label="Constrain extraction?" help="">
130 <option value="True">Yes</option>
131 <option value="False" selected="true">No</option>
132 </param>
133
134 <when value="True">
135 <repeat name="constraint_definition" title="Constraints on sequences" min="1">
136 <conditional name="constrained_information">
137 <param name="info_to_constrain" type="select" label="Information to constrain" help="">
138 <option value="id">Identifiant</option>
139 <option value="length">Length</option>
140 </param>
141 <when value="id">
142 <conditional name="constraint_type">
143 <param name="type" type="select" display="radio" label="Type of constraint" help="">
144 <option value="equal">Equal a value</option>
145 <option value="in">In a list</option>
146 <option value="not_in">Not in a list</option>
147 </param>
148 <when value="equal">
149 <param name="value" type="text" size="200" label="Equal to" help=""/>
150 <validator type="empty_field" message="Give a value"/>
151 </when>
152 <when value="in">
153 <param format="txt" name="value" type="data" label="List of constraint" help="Text file with a value per line and nothing else"/>
154 <validator type="unspecified_build" message="Select a file"/>
155 </when>
156 <when value="not_in">
157 <param format="txt" name="value" type="data" label="List of constraint" help="Text file with a value per line and nothing else"/>
158 <validator type="unspecified_build" message="Select a file"/>
159 </when>
160 </conditional>
161 </when>
162 <when value="length">
163 <repeat name="constraint_definition" title="Constraint on sequence length" min="1">
164 <param name="type" type="select" label="Type of constraint" help="">
165 <option value="equal">Equal to </option>
166 <option value="lower">Lower than </option>
167 <option value="strictly_lower">Strictly lower than </option>
168 <option value="greater">Greater than </option>
169 <option value="strictly_greater">Strictly greater than </option>
170 </param>
171 <param name="value" type="integer" min="0" max="3000" value="100" label="Value" help=""/>
172 </repeat>
173 </when>
174 </conditional>
175 </repeat>
176 </when>
177 <when value="False" />
178 </conditional> />
179 </inputs>
180
181 <outputs>
182 <data format="txt" name="information_file"
183 label="${tool.name} on ${on_string}: Information">
184 <filter>((sequence_file_format['extraction']['specific_extraction'] == "True" ))</filter>
185 </data>
186
187 <data format="fasta" name="fasta_sequence_file"
188 label="${tool.name} on ${on_string}: Extracted sequences" >
189 <filter>((sequence_file_format['format'] == 'fasta' and not sequence_file_format['extraction']['specific_extraction']== "True" ))</filter>
190 </data>
191
192 <data format="fastq" name="fastq_sequence_file"
193 label="${tool.name} on ${on_string}: Extracted sequences">
194 <filter>((sequence_file_format['format'] == 'fastq' and sequence_file_format['extraction']['specific_extraction'] == "False" and sequence_file_format['extraction']['split']['split_test'] == "False" ))</filter>
195 </data>
196
197 <data format="qual" name="quality_file"
198 label="${tool.name} on ${on_string}: Extracted quality">
199 <filter>((sequence_file_format['format'] == 'fastq' and sequence_file_format['extraction']['specific_extraction'] == "False" and sequence_file_format['extraction']['split']['split_test'] == "True" ))</filter>
200 </data>
201
202 <data format="fasta" name="fasta_sequence_file_from_fastq"
203 label="${tool.name} on ${on_string}: Extracted sequences">
204 <filter>((sequence_file_format['format'] == 'fastq' and sequence_file_format['extraction']['specific_extraction'] == "False" and sequence_file_format['extraction']['split']['split_test'] == "True" ))</filter>
205 </data>
206
207 <data format="txt" name="report_filepath"
208 label="${tool.name} on ${on_string}: Report"/>
209 </outputs>
210
211 <tests>
212 <test>
213 <param name="format" value="fasta"/>
214 <param name="sequence_file" value="input_sequence_file.fasta"/>
215 <param name="specific_extraction" value="True" />
216 <param name="to_extract" value="length" />
217 <param name="constrained_extraction" value="False" />
218 <output name="information_file" file="information_lenght_fasta_output.txt"/>
219 <output name="report_filepath" file="report_length_fasta_output.txt"/>
220 </test>
221 <test>
222 <param name="format" value="fastq"/>
223 <param name="sequence_file" value="input_sequence_file.fastq"/>
224 <param name="specific_extraction" value="False" />
225 <param name="split_test" value="True" />
226 <param name="quality_format" value="illumina_1_3" />
227 <param name="constrained_extraction" value="False" />
228 <output name="quality_file" file="extracted_quality_illumina_1_3_fastq_output.qual"/>
229 <output name="fasta_sequence_file_from_fastq" file="extracted_sequences_illumina_1_3_fastq_output.fasta"/>
230 <output name="report_filepath" file="report_illumina_1_3_fastq_output.txt"/>
231 </test>
232 </tests>
233
234 <help><![CDATA[
235
236 **What it does**
237
238 This tool extracts information (sequences, id, length, ...) from sequence files or convert a FastQ file to Fasta file.
239
240 Some constraints could be added to extraction/conversion. For example, only sequences with more than 30 bp could be extracted. Or, a sequences whose the identifiant is in a list.
241
242 The input is a sequence file in fasta or fastq format. The tool generates different outputs given the chosen parameters.
243 ]]>
244 </help>
245
246 <citations>
247 </citations>
248 </tool>
249