-
Notifications
You must be signed in to change notification settings - Fork 417
/
make.contigs.xml
266 lines (257 loc) · 13.9 KB
/
make.contigs.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
<tool profile="16.07" id="mothur_make_contigs" name="Make.contigs" version="@WRAPPER_VERSION@.1">
<description>Aligns paired forward and reverse fastq files to contigs as fasta and quality</description>
<macros>
<import>macros.xml</import>
</macros>
<expand macro="biotools"/>
<expand macro="requirements"/>
<expand macro="stdio"/>
<expand macro="version_command"/>
<command><![CDATA[
@SHELL_OPTIONS@
## Symlinks creation or On the fly creation of a combo file
#if $input_type.type == 'list_collection'
#for $pair in $input_type.list_paired_collection:
ln -s ${pair.forward} `basename ${pair.forward}` &&
ln -s ${pair.reverse} `basename ${pair.reverse}` &&
echo -e "${pair.name}\t`basename ${pair.forward}`\t`basename ${pair.reverse}`" >> combo_fastq.dat &&
#end for
#elif $input_type.type == 'simple_collection'
ln -s '$input_type.paired_collection.forward' ffastq.dat &&
ln -s '$input_type.paired_collection.reverse' rfastq.dat &&
#else
ln -s '$input_type.forward_fastq' ffastq.dat &&
ln -s '$input_type.reverse_fastq' rfastq.dat &&
#end if
#if $oligo.add == "yes":
ln -s '$oligo.oligos' oligo.oligos.dat &&
ln -s '$oligo.findex' oligo.findex.dat &&
ln -s '$oligo.rindex' oligo.rindex.dat &&
#end if
echo 'make.contigs(
#if $input_type.type == 'list_collection':
file=combo_fastq.dat,
#else:
ffastq=ffastq.dat,
rfastq=rfastq.dat,
#end if
align=$align,
#if $oligo.add == "yes":
oligos=oligo.oligos.dat,
bdiffs=$oligo.bdiffs,
pdiffs=$oligo.pdiffs,
tdiffs=$oligo.tdiffs,
#if $oligo.findex:
findex=oligo.findex.dat,
#end if
#if $oligo.rindex:
rindex=oligo.rindex.dat,
#end if
#end if
match=$match,
mismatch=$mismatch,
gapopen=$gapopen,
gapextend=$gapextend,
rename=$rename,
processors='\${GALAXY_SLOTS:-8}'
)'
| sed 's/ //g' ## mothur trips over whitespace
| mothur
| tee mothur.out.log
]]></command>
<inputs>
<conditional name="input_type">
<param name="type" type="select" label="Select a way to provide forward and reverse fastq files ?" help="">
<option value="regular" selected="true">Two simple fastq files (forward and reverse)</option>
<option value="simple_collection">One pair (paired collection)</option>
<option value="list_collection">Multiple pairs - Combo mode (list:paired collection)</option>
</param>
<when value="regular">
<param name="forward_fastq" type="data" format="fastq" label="Forward reads"/>
<param name="reverse_fastq" type="data" format="fastq" label="Reverse reads"/>
</when>
<when value="simple_collection">
<param name="paired_collection" type="data_collection" format="fastq" collection_type="paired" label="Fastq pair (collection)" help="Dataset collection made from a single pair of fastq files (forward + reverse)"/>
</when>
<when value="list_collection">
<param name="list_paired_collection" type="data_collection" format="fastq" collection_type="list:paired" label="Fastq pairs (collection)" help="Dataset collection made from multiple pairs of fastq files" />
</when>
</conditional>
<param name="align" type="select" label="align - Select a pairwise alignment method" help="">
<option value="needleman" selected="true">needleman (default) </option>
<option value="gotoh">gotoh</option>
<option value="kmer">kmer</option>
</param>
<conditional name="oligo">
<param name="add" type="select" label="Trim with an oligos file?" help="">
<option value="no">no</option>
<option value="yes">yes</option>
</param>
<when value="no"/>
<when value="yes">
<param name="oligos" type="data" format="mothur.oligos" optional="true" label="oligos - barcodes and primers"
help="a file that can contain the sequences of the forward and reverse primers and barcodes and their sample identifier. Each line of the oligos file can start with the key words "forward", "reverse" and "barcode" or it can start with a "#" to tell mothur to ignore that line of the oligos file"/>
<param name="bdiffs" type="integer" value="0" min="0" label="bdiffs - number of differences to allow in the barcode (default 0)"/>
<param name="pdiffs" type="integer" value="0" min="0" label="pdiffs - number of differences to allow in the primer (default 0)"/>
<param name="tdiffs" type="integer" value="0" min="0" label="tdiffs - total number of differences to allow in primer and barcode (default 0)"/>
<param name="findex" type="data" format="fastq" optional="true" label="forward index file (fastq)"/>
<param name="rindex" type="data" format="fastq" optional="true" label="revese index file (fastq)"/>
</when>
</conditional>
<param name="match" type="integer" value="1" label="match - Pairwise alignment reward for a match"/>
<param name="mismatch" type="integer" value="-1" label="mismatch - Pairwise alignment penalty for a mismatch"/>
<param name="gapopen" type="integer" value="-2" label="gapopen - Pairwise alignment penalty for opening a gap"/>
<param name="gapextend" type="integer" value="-1" label="gapextend - Pairwise alignment penalty for extending a gap"/>
<param name="rename" type="boolean" checked="true" truevalue="True" falsevalue="False" label="Renames sequences"
help="reduce file sizes and greatly reduce the size of the column formatted distance matrix downstream.
Uses the rename.seqs command to rename which creates a map file so you can revert to original names at any time"/>
<expand macro="param-savelog"/>
</inputs>
<outputs>
<expand macro="logfile-output"/>
<data name="fasta" format="fasta" from_work_dir="*fastq.trim.*.fasta" label="${tool.name} on ${on_string}: trim.contigs.fasta"/>
<data name="qual" format="qual" from_work_dir="*fastq*.trim.*.qual" label="${tool.name} on ${on_string}: trim.contigs.qual"/>
<data name="scrapfasta" format="fasta" from_work_dir="*fastq*.scrap.*.fasta" label="${tool.name} on ${on_string}: scrap.contigs.fasta"/>
<data name="scrapqual" format="qual" from_work_dir="*fastq*.scrap.*.qual" label="${tool.name} on ${on_string}: scrap.contigs.qual"/>
<data name="report" format="txt" from_work_dir="*fastq*.contigs.report" label="${tool.name} on ${on_string}: report"/>
<data name="group" format="mothur.groups" from_work_dir="*fastq*.groups" label="${tool.name} on ${on_string}: group file">
<filter>input_type['type'] == 'list_collection'</filter>
</data>
</outputs>
<tests>
<!-- Test with two regular files as input -->
<test>
<conditional name="input_type">
<param name="type" value="regular"/>
<param name="forward_fastq" value="Mock_S280_L001_R1_001_small.fastq" ftype="fastq"/>
<param name="reverse_fastq" value="Mock_S280_L001_R2_001_small.fastq" ftype="fastq"/>
</conditional>
<output name="fasta" file="Mock_S280_L001_R1_001_small.trim.contigs.fasta" ftype="fasta"/>
<output name="qual" file="Mock_S280_L001_R1_001_small.trim.contigs.qual" ftype="qual"/>
<output name="report" file="Mock_S280_L001_R1_001_small.contigs.report" ftype="txt"/>
<param name="savelog" value="true"/>
<param name="rename" value="false"/>
<expand macro="logfile-test"/>
</test>
<!-- Test with a simple paired collection as input -->
<test>
<conditional name="input_type">
<param name="type" value="simple_collection"/>
<param name="paired_collection">
<collection type="paired">
<element name="forward" value="Mock_S280_L001_R1_001_small.fastq" />
<element name="reverse" value="Mock_S280_L001_R2_001_small.fastq" />
</collection>
</param>
</conditional>
<output name="fasta" file="Mock_S280_L001_R1_001_small.trim.contigs.fasta" ftype="fasta"/>
<output name="qual" file="Mock_S280_L001_R1_001_small.trim.contigs.qual" ftype="qual"/>
<output name="report" file="Mock_S280_L001_R1_001_small.contigs.report" ftype="txt"/>
<param name="savelog" value="true"/>
<param name="rename" value="false"/>
<expand macro="logfile-test"/>
</test>
<!-- Test with a simple paired collection as input + extra parameters specified -->
<test>
<conditional name="input_type">
<param name="type" value="simple_collection"/>
<param name="paired_collection">
<collection type="paired">
<element name="forward" value="Mock_S280_L001_R1_001_small.fastq" />
<element name="reverse" value="Mock_S280_L001_R2_001_small.fastq" />
</collection>
</param>
</conditional>
<param name="align" value="gotoh"/>
<param name="match" value="2"/>
<param name="mismatch" value="-2"/>
<param name="gapopen" value="-3"/>
<param name="gapextend" value="-2"/>
<output name="fasta" md5="48e32c65bd9f064c5c0b4ea7695cabe9" ftype="fasta">
<assert_contents>
<has_text text=">M00967_43_000000000-A3JHG_1_1101_19936_3208" />
</assert_contents>
</output>
<output name="qual" md5="1e7778cee0d86bfa2759a07bb4356165" ftype="qual">
<assert_contents>
<has_text text=">M00967_43_000000000-A3JHG_1_1101_19936_3208" />
</assert_contents>
</output>
<output name="report" md5="5274725ef45890fd6da4650d5d536173" ftype="txt">
<assert_contents>
<has_line line="M00967_43_000000000-A3JHG_1_1101_19936_3208	253	249	2	251	0	0" />
</assert_contents>
</output>
<param name="savelog" value="true"/>
<param name="rename" value="false"/>
<expand macro="logfile-test"/>
</test>
<!-- Test with a simple paired collection as input + rename sequences -->
<test>
<conditional name="input_type">
<param name="type" value="simple_collection"/>
<param name="paired_collection">
<collection type="paired">
<element name="forward" value="Mock_S280_L001_R1_001_small.fastq" />
<element name="reverse" value="Mock_S280_L001_R2_001_small.fastq" />
</collection>
</param>
</conditional>
<output name="fasta" md5="addcc2f4233df75ab9e5feacadb6850f" ftype="fasta">
<assert_contents>
<has_text text=">1" />
</assert_contents>
</output>
<output name="qual" md5="476932c0236a672c0c99cada2b114fe7" ftype="qual">
<assert_contents>
<has_text text=">1" />
</assert_contents>
</output>
<output name="report" md5="7634bcab8db8907f80087da03259012a" ftype="txt">
<assert_contents>
<has_line line="1	253	249	2	251	0	0" />
</assert_contents>
</output>
<param name="savelog" value="true"/>
<param name="rename" value="true"/>
<expand macro="logfile-test"/>
</test>
<!-- Test with a list:paired collection as input -->
<test>
<conditional name="input_type">
<param name="type" value="list_collection"/>
<param name="list_paired_collection">
<collection type="list:paired">
<element name="Pair1">
<collection type="paired">
<element name="forward" value="Mock_S280_L001_R1_001_small.fastq" />
<element name="reverse" value="Mock_S280_L001_R2_001_small.fastq" />
</collection>
</element>
<element name="Pair2">
<collection type="paired">
<element name="forward" value="test_forward.fastq" />
<element name="reverse" value="test_reverse.fastq" />
</collection>
</element>
</collection>
</param>
</conditional>
<output name="fasta" md5="91bd3b91adc6559182ad118b767f0a07" ftype="fasta"/>
<output name="qual" md5="7094d1ac82a40e9f89cc6cdf5e214da7" ftype="qual"/>
<output name="report" md5="96a07f664105e4ddcb645c7cd9f5d692" ftype="txt"/>
<output name="group" md5="ef83b393be4103f0b61a021234905210" ftype="mothur.groups"/>
<param name="savelog" value="true"/>
<param name="rename" value="false"/>
<expand macro="logfile-test"/>
</test>
</tests>
<help><![CDATA[
@MOTHUR_OVERVIEW@
**Command Documentation**
The make.contigs_ command reads a forward fastq file and a reverse fastq file and outputs new fasta and quality files.
.. _make.contigs: https://www.mothur.org/wiki/Make.contigs
v.1.27.0: Updated to use Mothur 1.33. Added findex and rindex parmaeters, optionally used with the oligos file.
]]></help>
<expand macro="citations"/>
</tool>