Mercurial > repos > iuc > krakentools_extract_kraken_reads
comparison extract_kraken_reads.xml @ 0:519e0835abd7 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/krakentools commit 92c58a65005708fbd56b27b86969c01a1258ddb9
author | iuc |
---|---|
date | Wed, 15 Mar 2023 18:18:27 +0000 |
parents | |
children | f329328da134 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:519e0835abd7 |
---|---|
1 <tool id="krakentools_extract_kraken_reads" name="Krakentools: Extract Kraken Reads By ID" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> | |
2 <description> | |
3 Extract reads that were classified by the Kraken family at specified taxonomic IDs | |
4 </description> | |
5 <macros> | |
6 <import>macros.xml</import> | |
7 </macros> | |
8 <expand macro="requirements"> | |
9 <requirement type="package" version="1.12">gzip</requirement> | |
10 </expand> | |
11 <command detect_errors="exit_code"> | |
12 <![CDATA[ | |
13 | |
14 ##set input | |
15 #if $library.type == 'paired': | |
16 #set input_1 = $library.input_1 | |
17 #set input_2 = $library.input_2 | |
18 #else if $library.type == 'paired_collection' | |
19 #set input_1 = $library.input_1.forward | |
20 #set input_2 = $library.input_1.reverse | |
21 #else | |
22 #set input_1 = $library.input_1 | |
23 #end if | |
24 | |
25 ## name output according to --fastq_output param | |
26 ## tests fails if file does not have correct ending | |
27 #if str($fastq_output) == '': | |
28 #set temp_output_1 = 'output_1.fasta' | |
29 #set temp_output_2 = 'output_2.fasta' | |
30 #else: | |
31 #set temp_output_1 = 'output_1.fastq' | |
32 #set temp_output_2 = 'output_2.fastq' | |
33 #end if | |
34 | |
35 ## do not quote $taxid | |
36 extract_kraken_reads.py | |
37 -k '$results' | |
38 -s '$input_1' | |
39 -o '$temp_output_1' | |
40 --taxid $taxid | |
41 --max '$max' | |
42 $include_parents | |
43 $include_children | |
44 $exclude | |
45 $fastq_output | |
46 | |
47 #if str( $library.type ) != "single": | |
48 -s2 '$input_2' | |
49 -o2 '$temp_output_2' | |
50 #end if | |
51 #if $include_parents or $include_children: | |
52 --report '$report' | |
53 #end if | |
54 | |
55 ##compress output | |
56 && gzip -cvf '$temp_output_1' > output_1.gz | |
57 | |
58 #if str( $library.type ) != "single": | |
59 && gzip -cvf '$temp_output_2' > output_2.gz | |
60 #end if | |
61 | |
62 ]]> | |
63 </command> | |
64 <inputs> | |
65 <!-- Reads --> | |
66 <conditional name="library"> | |
67 <param name="type" type="select" label="Single or paired reads?"> | |
68 <option value="single"> | |
69 Single | |
70 </option> | |
71 <option value="paired"> | |
72 Paired | |
73 </option> | |
74 <option value="paired_collection"> | |
75 Paired Collection | |
76 </option> | |
77 </param> | |
78 <when value="single"> | |
79 <param name="input_1" format="fastq,fasta" type="data" label="FASTQ/A file" help="FASTQ or FASTQ input reads (may be gzipped)" /> | |
80 </when> | |
81 <when value="paired"> | |
82 <param name="input_1" format="fastq,fasta" type="data" label="FASTQ/A forward file" help="FASTQ or FASTQ input reads (may be gzipped)" /> | |
83 <param name="input_2" format="fastq,fasta" type="data" label="FASTQ/A reverse file" help="FASTQ or FASTQ input reads (for paired reads, may be gzipped)" /> | |
84 </when> | |
85 <when value="paired_collection"> | |
86 <param name="input_1" format="fastq,fasta" type="data_collection" collection_type="paired" label="Paired Collection" help="FASTQ or FASTA read pair collection (may be gzipped)" /> | |
87 </when> | |
88 </conditional> | |
89 <param name="results" argument="-k" format="tabular" type="data" label="Results" help="Results (classification) file from Kraken/KrakenUniq/Kraken2" /> | |
90 <param argument="--report" format="tabular" type="data" label="Report" optional="true" help="Report file from Kraken/KrakenUniq/Kraken2" /> | |
91 <param argument="--taxid" type="text" value="" label="Taxonomic ID(s) to match" help="Space-delimited list of taxonomic IDs for which to extract matching reads"> | |
92 <validator type="regex" message="Enter a space-separated list of numeric tax IDs">^\d+[\d ]*$</validator> | |
93 </param> | |
94 <param argument="--max" type="integer" value="100000000" min="1" label="Maximum reads to save" help="Maximum number of reads to save for each ID" /> | |
95 <param argument="--exclude" type="boolean" value="False" truevalue="--exclude" falsevalue="" label="Invert output" help="Instead of finding reads that match given taxonomic IDs, find all reads that DO NOT match given IDs" /> | |
96 <param argument="--fastq_output" type="boolean" value="False" truevalue="--fastq-output" falsevalue="" label="Output as FASTQ" help="Write output as FASTQ instead of the default FASTA" /> | |
97 <param argument="--include_parents" type="boolean" value="False" truevalue="--include-parents" falsevalue="" label="Include parents" help="Include reads classified at parent levels of the specified tax IDs" /> | |
98 <param argument="--include_children" type="boolean" value="False" truevalue="--include-children" falsevalue="" label="Include children" help="Include reads classified more specifically than the specified tax IDs" /> | |
99 </inputs> | |
100 <outputs> | |
101 <data name="output_1" format="fasta.gz" from_work_dir="output_1.gz" metadata_source="input_1" label="${tool.name} on ${on_string}: forward reads"> | |
102 <filter> | |
103 (library['type'] == 'single' or library['type'] == 'paired') | |
104 </filter> | |
105 <change_format> | |
106 <when input="fastq_output" value="--fastq-output" format="fastq.gz" /> | |
107 </change_format> | |
108 </data> | |
109 <data name="output_2" format="fasta.gz" from_work_dir="output_2.gz" metadata_source="input_2" label="${tool.name} on ${on_string}: reverse reads"> | |
110 <filter> | |
111 (library['type'] == 'paired') | |
112 </filter> | |
113 <change_format> | |
114 <when input="fastq_output" value="--fastq-output" format="fastq.gz" /> | |
115 </change_format> | |
116 </data> | |
117 <collection type="paired" name="output_collection" label="${tool.name} on ${on_string}: collection"> | |
118 <filter>(library['type'] == 'paired_collection')</filter> | |
119 <data name="forward" format="fasta.gz" metadata_source="input_1" from_work_dir="output_1.gz" > | |
120 <change_format> | |
121 <when input="fastq_output" value="--fastq-output" format="fastq.gz" /> | |
122 </change_format> | |
123 </data> | |
124 <data name="reverse" format="fasta.gz" metadata_source="input_2" from_work_dir="output_2.gz" > | |
125 <change_format> | |
126 <when input="fastq_output" value="--fastq-output" format="fastq.gz" /> | |
127 </change_format> | |
128 </data> | |
129 </collection> | |
130 </outputs> | |
131 <tests> | |
132 <!-- test Kraken2 input, single input --> | |
133 <test expect_num_outputs="1"> | |
134 <param name="input_1" value="extract_kraken_reads/R1.fq.gz" ftype="fastqsanger" /> | |
135 <param name="library|type" value="single" /> | |
136 <param name="results" value="extract_kraken_reads/kraken2.results" ftype="tabular" /> | |
137 <param name="taxid" value="11176" /> | |
138 <output name="output_1" file="extract_kraken_reads/out1.k2.11176.fa" decompress="true" ftype="fasta.gz" /> | |
139 </test> | |
140 <!-- test paired input --> | |
141 <test expect_num_outputs="2"> | |
142 <param name="input_1" value="extract_kraken_reads/R1.fq.gz" ftype="fastqsanger" /> | |
143 <param name="input_2" value="extract_kraken_reads/R2.fq.gz" ftype="fastqsanger" /> | |
144 <param name="library|type" value="paired" /> | |
145 <param name="results" value="extract_kraken_reads/kraken2.results" ftype="tabular" /> | |
146 <param name="taxid" value="11176" /> | |
147 <output name="output_1" file="extract_kraken_reads/out1.k2.11176.fa" decompress="true" ftype="fasta.gz" /> | |
148 <output name="output_2" file="extract_kraken_reads/out2.k2.11176.fa" decompress="true" ftype="fasta.gz" /> | |
149 </test> | |
150 <!-- test paired collection input --> | |
151 <test expect_num_outputs="3"> | |
152 <param name="input_1"> | |
153 <collection type="paired"> | |
154 <element name="forward" value="extract_kraken_reads/R1.fq.gz" ftype="fastqsanger" /> | |
155 <element name="reverse" value="extract_kraken_reads/R2.fq.gz" ftype="fastqsanger" /> | |
156 </collection> | |
157 </param> | |
158 <param name="library|type" value="paired_collection" /> | |
159 <param name="results" value="extract_kraken_reads/kraken2.results" ftype="tabular" /> | |
160 <param name="taxid" value="11176" /> | |
161 <output_collection name="output_collection" type="paired"> | |
162 <element name="forward" file="extract_kraken_reads/out1.k2.11176.fa" decompress="true" ftype="fasta.gz" /> | |
163 <element name="reverse" file="extract_kraken_reads/out2.k2.11176.fa" decompress="true" ftype="fasta.gz" /> | |
164 </output_collection> | |
165 </test> | |
166 <!-- test Kraken1 input, include children --> | |
167 <test expect_num_outputs="1"> | |
168 <param name="input_1" value="extract_kraken_reads/R1.fq.gz" ftype="fastqsanger" /> | |
169 <param name="library|type" value="single" /> | |
170 <param name="results" value="extract_kraken_reads/kraken1.results" ftype="tabular" /> | |
171 <param name="report" value="extract_kraken_reads/kraken1.report" ftype="tabular" /> | |
172 <param name="taxid" value="11176" /> | |
173 <param name="include_children" value="True" /> | |
174 <output name="output_1" file="extract_kraken_reads/out1.k1.11176.children.fa" decompress="true" ftype="fasta.gz" /> | |
175 </test> | |
176 <!-- test exclude --> | |
177 <test expect_num_outputs="1"> | |
178 <param name="input_1" value="extract_kraken_reads/R1.fq.gz" ftype="fastqsanger" /> | |
179 <param name="library|type" value="single" /> | |
180 <param name="results" value="extract_kraken_reads/kraken1.results" ftype="tabular" /> | |
181 <param name="report" value="extract_kraken_reads/kraken1.report" ftype="tabular" /> | |
182 <param name="taxid" value="10386" /> | |
183 <param name="include_children" value="True" /> | |
184 <param name="exclude" value="True" /> | |
185 <output name="output_1" file="extract_kraken_reads/out1.k1.e10386.children.fa" decompress="true" ftype="fasta.gz" /> | |
186 </test> | |
187 <!-- test max --> | |
188 <test expect_num_outputs="1"> | |
189 <param name="input_1" value="extract_kraken_reads/R1.fq.gz" ftype="fastqsanger" /> | |
190 <param name="library|type" value="single" /> | |
191 <param name="results" value="extract_kraken_reads/kraken2.results" ftype="tabular" /> | |
192 <param name="taxid" value="11176" /> | |
193 <param name="max" value="2" /> | |
194 <output name="output_1" file="extract_kraken_reads/out1.k2.11176.max2.fa" decompress="true" ftype="fasta.gz" /> | |
195 </test> | |
196 <!-- test include parents --> | |
197 <test expect_num_outputs="1"> | |
198 <param name="input_1" value="extract_kraken_reads/R1.fq.gz" ftype="fastqsanger" /> | |
199 <param name="library|type" value="single" /> | |
200 <param name="results" value="extract_kraken_reads/kraken2.results" ftype="tabular" /> | |
201 <param name="taxid" value="11176" /> | |
202 <param name="include_parents" value="True" /> | |
203 <param name="report" value="extract_kraken_reads/kraken2.report" ftype="tabular" /> | |
204 <output name="output_1" file="extract_kraken_reads/out1.k2.11176.parents.fa" decompress="true" ftype="fasta.gz" /> | |
205 </test> | |
206 <!-- test multiple tax IDs --> | |
207 <test expect_num_outputs="1"> | |
208 <param name="input_1" value="extract_kraken_reads/R1.fq.gz" ftype="fastqsanger" /> | |
209 <param name="library|type" value="single" /> | |
210 <param name="results" value="extract_kraken_reads/kraken2.results" ftype="tabular" /> | |
211 <param name="taxid" value="10386 11176" /> | |
212 <param name="exclude" value="True" /> | |
213 <param name="include_parents" value="True" /> | |
214 <param name="report" value="extract_kraken_reads/kraken2.report" ftype="tabular" /> | |
215 <output name="output_1" file="extract_kraken_reads/out1.k2.exclude_both.fa" decompress="true" ftype="fasta.gz" /> | |
216 </test> | |
217 <!-- test multiple tax IDs --> | |
218 <test expect_failure="true"> | |
219 <param name="input_1" value="extract_kraken_reads/R1.fq.gz" ftype="fastqsanger" /> | |
220 <param name="library|type" value="single" /> | |
221 <param name="results" value="extract_kraken_reads/kraken2.results" ftype="tabular" /> | |
222 <param name="taxid" value="10386 f5" /> | |
223 </test> | |
224 <!-- test FASTQ output --> | |
225 <test expect_num_outputs="1"> | |
226 <param name="input_1" value="extract_kraken_reads/R1.fq.gz" ftype="fastqsanger" /> | |
227 <param name="library|type" value="single" /> | |
228 <param name="results" value="extract_kraken_reads/kraken2.results" ftype="tabular" /> | |
229 <param name="taxid" value="11176" /> | |
230 <param name="fastq_output" value="true" /> | |
231 <output name="output_1" file="extract_kraken_reads/out1.k2.11176.fq" decompress="true" ftype="fastq.gz" /> | |
232 </test> | |
233 </tests> | |
234 <help> | |
235 <![CDATA[ | |
236 **What it does** | |
237 ------------------- | |
238 After running Kraken, Kraken2, or KrakenUniq, users may use the | |
239 `extract_kraken_reads.py` program to extract the FASTA or FASTQ reads | |
240 classified as a specific taxonomy ID. For example, this program can be used to | |
241 extract all bacterial reads or only reads assigned to Escherichia coli. Users | |
242 must provide (at minimum) the original sequence file(s), at least one taxonomy | |
243 ID, and the Kraken output file. | |
244 ]]> | |
245 </help> | |
246 <expand macro="citations" /> | |
247 <creator> | |
248 <person givenName="Jeremy" familyName="Volkening" url="https://github.com/jvolkening" /> | |
249 <person givenName="Paul" familyName="Zierep" email="zierep@informatik.uni-freiburg.de" /> | |
250 </creator> | |
251 </tool> |