20
|
1 <?xml version="1.0" ?>
|
|
2 <tool id="qiime_tools_import" name="qiime tools import" version="2020.8">
|
|
3 <description> - Import data into a new QIIME 2 Artifact.</description>
|
|
4 <requirements>
|
|
5 <requirement type="package" version="2020.8">qiime2</requirement>
|
|
6 </requirements>
|
|
7 <command>
|
|
8 <![CDATA[
|
|
9 mkdir input;
|
|
10
|
|
11 #set $in_= 'input'
|
|
12
|
|
13
|
|
14 #if '__ob__' in str($semantic_type):
|
|
15 #set $type_temp = str($semantic_type).replace('__ob__', '[')
|
|
16 #set $type_temp = str($type_temp).replace('__cb__', ']')
|
|
17 #set $semantic_type = $type_temp
|
|
18 #end if
|
|
19
|
|
20 #def is_fastq($f_test)
|
|
21 #set $f = open($f_test, 'rb')
|
|
22 #set $fastq = str($f.readline()[0])
|
|
23 #if str($f.readline()[0]) == '@'
|
|
24 #$f.close()
|
|
25 #return True
|
|
26 #end if
|
|
27
|
|
28 #$f.close()
|
|
29 #return $fastq
|
|
30 #end def
|
|
31
|
|
32
|
|
33 ## Symlinks creation or On the fly creation of a combo file
|
|
34 #if $input_type.type == 'list_list'
|
|
35 ## Symlinks creation or On the fly creation of a combo file
|
|
36 #for $f in $input_type.list_list:
|
|
37
|
|
38 #set $is_fastq_file = $is_fastq(str($f))
|
|
39
|
|
40 #if $is_fastq_file:
|
|
41 #set $file_for_processing = "'input/" + $f.name + '.gz' + "'"
|
|
42 gzip -c ${f} > $file_for_processing;
|
|
43 ##echo $is_fastq_file;
|
|
44 #else
|
|
45 #set $file_for_processing = "'input/" + $f.name + "'"
|
|
46 ln -s ${f} $file_for_processing;
|
|
47 ##echo $is_fastq_file;
|
|
48 #end if
|
|
49 #end for
|
|
50 #if 'SingleEndFastqManifestPhred' in str($inputformat):
|
|
51 #set $cwf = str($outputpath.extra_files_path) + "_manifest_file.txt"
|
|
52 #set $tt = str("sample-id,absolute-filepath,direction")
|
|
53 echo $tt >> $cwf;
|
|
54 #for $f in $input_type.list_list:
|
|
55 #set $tt = str($f.name).split("_")[0]+",$PWD/input/"+str($f.name).split(".")[0]+".fastq.gz,forward\n"
|
|
56 echo $tt >> $cwf;
|
|
57 #end for
|
|
58
|
|
59 #set $in_= str($cwf)
|
|
60 #end if
|
|
61
|
|
62
|
|
63 #elif $input_type.type == 'list_paired_collection':
|
|
64
|
|
65 #set $cwf = str($outputpath.extra_files_path) + "_manifest_file.txt"
|
|
66 #set $tt = str("sample-id,absolute-filepath,direction")
|
|
67 echo $tt >> $cwf;
|
|
68
|
|
69 #for $pair in $input_type.list_paired_collection:
|
|
70 #set $forward_is_fastq_file = $is_fastq(str($pair.forward))
|
|
71 #set $reverse_is_fastq_file = $is_fastq(str($pair.reverse))
|
|
72
|
|
73 #if $forward_is_fastq_file:
|
|
74 gzip -c ${pair.forward} > input/${pair.name}_R1_001.fastq.gz;
|
|
75 #set $tt = str($pair.name).split("_")[0]+",$PWD/input/"+str($pair.name)+"_R1_001.fastq.gz,forward\n"
|
|
76 echo $tt >> $cwf;
|
|
77 #else
|
|
78 ln -s ${pair.forward} input/${pair.name}_R1_001.fastq.gz;
|
|
79 #set $tt = str($pair.name).split("_")[0]+",$PWD/input/"+str($pair.name)+"_R1_001.fastq.gz,forward\n"
|
|
80 echo $tt >> $cwf;
|
|
81 #end if
|
|
82
|
|
83 #if $reverse_is_fastq_file:
|
|
84 gzip -c ${pair.reverse} > input/${pair.name}_R2_001.fastq.gz;
|
|
85 #set $tt = str($pair.name).split("_")[0]+",$PWD/input/"+str($pair.name)+"_R2_001.fastq.gz,reverse\n"
|
|
86 echo $tt >> $cwf;
|
|
87 #else
|
|
88 ln -s ${pair.reverse} input/${pair.name}_R2_001.fastq.gz;
|
|
89 #set $tt = str($pair.name).split("_")[0]+",$PWD/input/"+str($pair.name)+"_R2_001.fastq.gz,reverse\n"
|
|
90 echo $tt >> $cwf;
|
|
91 #end if
|
|
92 #end for
|
|
93
|
|
94
|
|
95
|
|
96 #if 'PairedEndFastqManifestPhred' in str($inputformat) or 'SingleEndFastqManifestPhred33V2' in str($inputformat) or 'SingleEndFastqManifestPhred33' in str($inputformat):
|
|
97
|
|
98 #set $in_= str($cwf)
|
|
99
|
|
100 #elif 'Casava' in str($inputformat):
|
|
101 #set $in_= 'input'
|
|
102 #end if
|
|
103
|
|
104
|
|
105 #else
|
|
106 #set $res = $is_fastq(str($file))
|
|
107
|
|
108 #if $res
|
|
109 gzip -c ${file} > ${file.name}.gz;
|
|
110 #set $in_= $file.name + '.gz'
|
|
111
|
|
112 #else
|
|
113 #set $in_= str($file)
|
|
114 #end if
|
|
115
|
|
116 #if "MultiplexedSingleEndBarcodeInSequence" in str($semantic_type):
|
|
117 mv *_R1_* forward.fastq.gz;
|
|
118 #set $in_= 'forward.fastq.gz';
|
|
119 #end if
|
|
120
|
|
121 #end if
|
|
122
|
|
123
|
|
124 ## rename files to predefined names for "MultiplexedPairedEndBarcodeInSequence"
|
|
125 #if "MultiplexedPairedEndBarcodeInSequence" in str($semantic_type):
|
|
126 mv input/*_R1_* input/forward.fastq.gz;
|
|
127 mv input/*_R2_* input/reverse.fastq.gz;
|
|
128 #end if
|
|
129
|
|
130
|
|
131 qiime tools import
|
|
132
|
|
133 --input-path=$in_
|
|
134
|
|
135 #if str($inputformat) != 'None':
|
|
136 #if '__ob__' in str($inputformat):
|
|
137 #set $inputformat_temp = str($inputformat).replace('__ob__', '[')
|
|
138 #set $inputformat_temp = str($inputformat_temp).replace('__cb__', ']')
|
|
139 #set $inputformat = $inputformat_temp
|
|
140 #end if
|
|
141 --input-format="$inputformat"
|
|
142 #end if
|
|
143
|
|
144 --type="$semantic_type"
|
|
145
|
|
146 --output-path=outputpath.qza
|
|
147
|
|
148 ;
|
|
149 cp outputpath.qza $outputpath
|
|
150 ]]>
|
|
151 </command>
|
|
152 <inputs>
|
|
153 <conditional name="input_type">
|
|
154 <param name="type" type="select" label="Select a way to provide data, either using a file or a list" help="">
|
|
155 <option value="regular">Input file</option>
|
|
156 <option selected="true" value="list_paired_collection">Multiple pairs - Combo mode (list:paired collection)</option>
|
|
157 <option value="list_list">Input list</option>
|
|
158 </param>
|
|
159
|
|
160 <when value="regular">
|
|
161 <param name="file" type="data" multiple="false" label="Input file" />
|
|
162 </when>
|
|
163 <when value="list_paired_collection">
|
|
164 <param name="list_paired_collection" type="data_collection" collection_type="list:paired" label="Fastq pairs (collection)" help="Dataset collection made from multiple pairs of files" />
|
|
165 </when>
|
|
166 <when value="list_list">
|
|
167 <param name="list_list" type="data_collection" collection_type="list" label="Input list" />
|
|
168 </when>
|
|
169 </conditional>
|
|
170
|
|
171 <param label="--type: The semantic type of the artifact that will be created upon importing. [required]" name="semantic_type" optional="False" type="select">
|
|
172 <option value="DeblurStats">DeblurStats</option>
|
|
173 <option value="DistanceMatrix">DistanceMatrix</option>
|
|
174 <option value="EMPPairedEndSequences">EMPPairedEndSequences</option>
|
|
175 <option value="EMPSingleEndSequences">EMPSingleEndSequences</option>
|
|
176 <option value="ErrorCorrectionDetails">ErrorCorrectionDetails</option>
|
|
177 <option value="FeatureData[AlignedSequence]">FeatureData[AlignedSequence]</option>
|
|
178 <option value="FeatureData[Importance]">FeatureData[Importance]</option>
|
|
179 <option value="FeatureData[PairedEndSequence]">FeatureData[PairedEndSequence]</option>
|
|
180 <option value="FeatureData[Sequence]">FeatureData[Sequence]</option>
|
|
181 <option value="FeatureData[Taxonomy]">FeatureData[Taxonomy]</option>
|
|
182 <option value="FeatureTable[Balance]">FeatureTable[Balance]</option>
|
|
183 <option value="FeatureTable[Composition]">FeatureTable[Composition]</option>
|
|
184 <option value="FeatureTable[Frequency]">FeatureTable[Frequency]</option>
|
|
185 <option value="FeatureTable[PercentileNormalized]">FeatureTable[PercentileNormalized]</option>
|
|
186 <option value="FeatureTable[PresenceAbsence]">FeatureTable[PresenceAbsence]</option>
|
|
187 <option value="FeatureTable[RelativeFrequency]">FeatureTable[RelativeFrequency]</option>
|
|
188 <option value="Hierarchy">Hierarchy</option>
|
|
189 <option value="MultiplexedPairedEndBarcodeInSequence">MultiplexedPairedEndBarcodeInSequence</option>
|
|
190 <option value="MultiplexedSingleEndBarcodeInSequence">MultiplexedSingleEndBarcodeInSequence</option>
|
|
191 <option value="PCoAResults">PCoAResults</option>
|
|
192 <option value="Phylogeny[Rooted]">Phylogeny[Rooted]</option>
|
|
193 <option value="Phylogeny[Unrooted]">Phylogeny[Unrooted]</option>
|
|
194 <option value="Placements">Placements</option>
|
|
195 <option value="QualityFilterStats">QualityFilterStats</option>
|
|
196 <option value="RawSequences">RawSequences</option>
|
|
197 <option value="SampleData[AlphaDiversity]">SampleData[AlphaDiversity]</option>
|
|
198 <option value="SampleData[BooleanSeries]">SampleData[BooleanSeries]</option>
|
|
199 <option value="SampleData[ClassifierPredictions]">SampleData[ClassifierPredictions]</option>
|
|
200 <option value="SampleData[DADA2Stats]">SampleData[DADA2Stats]</option>
|
|
201 <option value="SampleData[FirstDifferences]">SampleData[FirstDifferences]</option>
|
|
202 <option value="SampleData[JoinedSequencesWithQuality]">SampleData[JoinedSequencesWithQuality]</option>
|
|
203 <option selected="True" value="SampleData[PairedEndSequencesWithQuality]">SampleData[PairedEndSequencesWithQuality]</option>
|
|
204 <option value="SampleData[RegressorPredictions]">SampleData[RegressorPredictions]</option>
|
|
205 <option value="SampleData[SequencesWithQuality]">SampleData[SequencesWithQuality]</option>
|
|
206 <option value="SampleData[Sequences]">SampleData[Sequences]</option>
|
|
207 <option value="SampleData[Classifier]">SampleData[Classifier]</option>
|
|
208 <option value="SampleData[Regressor]">SampleData[Regressor]</option>
|
|
209 <option value="TaxonomicClassifier">TaxonomicClassifier</option>
|
|
210 <option value="UchimeStats">UchimeStats</option>
|
|
211 </param>
|
|
212
|
|
213 <param label="--input-format: The format of the data to be imported. If not provided, data must be in the format expected by the semantic type provided via --type." name="inputformat" optional="True" type="select">
|
|
214 <option value="AlignedDNAFASTAFormat">AlignedDNAFASTAFormat</option>
|
|
215 <option value="AlignedDNASequencesDirectoryFormat">AlignedDNASequencesDirectoryFormat</option>
|
|
216 <option value="AlphaDiversityDirectoryFormat">AlphaDiversityDirectoryFormat</option>
|
|
217 <option value="AlphaDiversityFormat">AlphaDiversityFormat</option>
|
|
218 <option value="BIOMV100DirFmt">BIOMV100DirFmt</option>
|
|
219 <option value="BIOMV100Format">BIOMV100Format</option>
|
|
220 <option value="BIOMV210DirFmt">BIOMV210DirFmt</option>
|
|
221 <option value="BIOMV210Format">BIOMV210Format</option>
|
|
222 <option value="BooleanSeriesDirectoryFormat">BooleanSeriesDirectoryFormat</option>
|
|
223 <option value="BooleanSeriesFormat">BooleanSeriesFormat</option>
|
|
224 <option value="CasavaOneEightLanelessPerSampleDirFmt">CasavaOneEightLanelessPerSampleDirFmt</option>
|
|
225 <option value="CasavaOneEightSingleLanePerSampleDirFmt">CasavaOneEightSingleLanePerSampleDirFmt</option>
|
|
226 <option value="DADA2StatsDirFmt">DADA2StatsDirFmt</option>
|
|
227 <option value="DADA2StatsFormat">DADA2StatsFormat</option>
|
|
228 <option value="DNAFASTAFormat">DNAFASTAFormat</option>
|
|
229 <option value="DNASequencesDirectoryFormat">DNASequencesDirectoryFormat</option>
|
|
230 <option value="DeblurStatsDirFmt">DeblurStatsDirFmt</option>
|
|
231 <option value="DeblurStatsFmt">DeblurStatsFmt</option>
|
|
232 <option value="DistanceMatrixDirectoryFormat">DistanceMatrixDirectoryFormat</option>
|
|
233 <option value="EMPPairedEndCasavaDirFmt">EMPPairedEndCasavaDirFmt</option>
|
|
234 <option value="EMPPairedEndDirFmt">EMPPairedEndDirFmt</option>
|
|
235 <option value="EMPSingleEndCasavaDirFmt">EMPSingleEndCasavaDirFmt</option>
|
|
236 <option value="EMPSingleEndDirFmt">EMPSingleEndDirFmt</option>
|
|
237 <option value="ErrorCorrectionDetailsDirFmt">ErrorCorrectionDetailsDirFmt</option>
|
|
238 <option value="FastqGzFormat">FastqGzFormat</option>
|
|
239 <option value="FirstDifferencesDirectoryFormat">FirstDifferencesDirectoryFormat</option>
|
|
240 <option value="FirstDifferencesFormat">FirstDifferencesFormat</option>
|
|
241 <option value="HeaderlessTSVTaxonomyDirectoryFormat">HeaderlessTSVTaxonomyDirectoryFormat</option>
|
|
242 <option value="HeaderlessTSVTaxonomyFormat">HeaderlessTSVTaxonomyFormat</option>
|
|
243 <option value="ImportanceDirectoryFormat">ImportanceDirectoryFormat</option>
|
|
244 <option value="ImportanceFormat">ImportanceFormat</option>
|
|
245 <option value="LSMatFormat">LSMatFormat</option>
|
|
246 <option value="MultiplexedPairedEndBarcodeInSequenceDirFmt">MultiplexedPairedEndBarcodeInSequenceDirFmt</option>
|
|
247 <option value="MultiplexedSingleEndBarcodeInSequenceDirFmt">MultiplexedSingleEndBarcodeInSequenceDirFmt</option>
|
|
248 <option value="NewickDirectoryFormat">NewickDirectoryFormat</option>
|
|
249 <option value="NewickFormat">NewickFormat</option>
|
|
250 <option value="OrdinationDirectoryFormat">OrdinationDirectoryFormat</option>
|
|
251 <option value="OrdinationFormat">OrdinationFormat</option>
|
|
252 <option value="PairedDNASequencesDirectoryFormat">PairedDNASequencesDirectoryFormat</option>
|
|
253 <option value="PairedEndFastqManifestPhred33">PairedEndFastqManifestPhred33</option>
|
|
254 <option value="PairedEndFastqManifestPhred33V2">PairedEndFastqManifestPhred33V2</option>
|
|
255 <option value="PairedEndFastqManifestPhred64">PairedEndFastqManifestPhred64</option>
|
|
256 <option value="PairedEndFastqManifestPhred64V2">PairedEndFastqManifestPhred64V2</option>
|
|
257 <option value="PlacementsDirFmt">PlacementsDirFmt</option>
|
|
258 <option value="PlacementsFormat">PlacementsFormat</option>
|
|
259 <option value="PredictionsDirectoryFormat">PredictionsDirectoryFormat</option>
|
|
260 <option value="PredictionsFormat">PredictionsFormat</option>
|
|
261 <option value="QIIME1DemuxDirFmt">QIIME1DemuxDirFmt</option>
|
|
262 <option value="QIIME1DemuxFormat">QIIME1DemuxFormat</option>
|
|
263 <option value="QualityFilterStatsDirFmt">QualityFilterStatsDirFmt</option>
|
|
264 <option value="QualityFilterStatsFmt">QualityFilterStatsFmt</option>
|
|
265 <option value="SampleEstimatorDirFmt">SampleEstimatorDirFmt</option>
|
|
266 <option value="SingleEndFastqManifestPhred33">SingleEndFastqManifestPhred33</option>
|
|
267 <option value="SingleEndFastqManifestPhred33V2">SingleEndFastqManifestPhred33V2</option>
|
|
268 <option value="SingleEndFastqManifestPhred64">SingleEndFastqManifestPhred64</option>
|
|
269 <option value="SingleEndFastqManifestPhred64V2">SingleEndFastqManifestPhred64V2</option>
|
|
270 <option value="SingleLanePerSamplePairedEndFastqDirFmt">SingleLanePerSamplePairedEndFastqDirFmt</option>
|
|
271 <option value="SingleLanePerSampleSingleEndFastqDirFmt">SingleLanePerSampleSingleEndFastqDirFmt</option>
|
|
272 <option value="TSVTaxonomyDirectoryFormat">TSVTaxonomyDirectoryFormat</option>
|
|
273 <option value="TSVTaxonomyFormat">TSVTaxonomyFormat</option>
|
|
274 <option value="TaxonomicClassiferTemporaryPickleDirFmt">TaxonomicClassiferTemporaryPickleDirFmt</option>
|
|
275 <option value="UchimeStatsDirFmt">UchimeStatsDirFmt</option>
|
|
276 <option value="UchimeStatsFmt">UchimeStatsFmt</option>
|
|
277 </param>
|
|
278 </inputs>
|
|
279 <outputs>
|
|
280 <data format="qza" label="${tool.name} on ${on_string}: outputpath.qza" name="outputpath"/>
|
|
281 </outputs>
|
|
282 <!--<stdio>
|
|
283 <exit_code range="2" level="warning" description="Error" />
|
|
284 </stdio>-->
|
|
285 <help>
|
|
286 </help>
|
|
287 <macros>
|
|
288 <import>qiime_citation.xml</import>
|
|
289 </macros>
|
|
290 <expand macro="qiime_citation" />
|
|
291 </tool>
|