comparison fastq_dump.xml @ 0:878e5d4becef

planemo upload
author jasmine_amir
date Thu, 02 Feb 2023 18:11:05 -0500
parents
children c9fb9ecae076
comparison
equal deleted inserted replaced
-1:000000000000 0:878e5d4becef
1 <tool id="fastq_dump" name="Download and Extract Reads in FASTQ" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
2 <description>format from NCBI SRA</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro="edam_ontology"/>
7 <expand macro="bio_tools"/>
8 <expand macro="requirements"/>
9 <version_command>fastq-dump --version | tr -d $'\n'</version_command>
10 <command detect_errors="exit_code"><![CDATA[
11 @COPY_CONFIGFILE@
12 @SET_ACCESSIONS@
13
14 #if $input.input_select == "sra_file":
15 fastq-dump --log-level fatal --accession '${input.file.name}'
16 #else:
17 ## Do not use prefetch if region is specified, to avoid downloading
18 ## the complete sra file.
19 #if ( str( $adv.region ) == "" ) and ( str( $adv.minID ) == "" ) and ( str( $adv.maxID ) == "" ):
20 prefetch -X 200000000 "\$acc" &&
21 #end if
22 fastq-dump --accession "\$acc"
23 --split-files
24 #end if
25 --defline-seq '@\$sn[_\$rn]/\$ri'
26 --defline-qual '+'
27
28 $adv.split
29 #if str( $adv.alignments ) == "aligned":
30 --aligned
31 #end if
32 #if str( $adv.alignments ) == "unaligned":
33 --unaligned
34 #end if
35 #if str( $adv.minID ) != "":
36 --minSpotId "$adv.minID"
37 #end if
38 #if str( $adv.maxID ) != "":
39 --maxSpotId "$adv.maxID"
40 #end if
41 #if str( $adv.minlen ) != "":
42 --minReadLen "$adv.minlen"
43 #end if
44 #if str( $adv.readfilter ) != "":
45 --read-filter "$adv.readfilter"
46 #end if
47 #if str( $adv.region ) != "":
48 --aligned-region "$adv.region"
49 #end if
50 #if str( $adv.spotgroups ) != "":
51 --spot-groups "$adv.spotgroups"
52 #end if
53 #if str( $adv.matepairDist ) != "":
54 --matepair-distance "$adv.matepairDist"
55 #end if
56 $adv.clip
57 $adv.skip_technical
58
59 #if str( $outputformat ) == "fastqsanger.gz":
60 --gzip
61 #elif str( $outputformat ) == "fastqsanger.bz2":
62 --bzip2
63 #end if
64
65 #if str($adv.table) != "":
66 --table $adv.table
67 #end if
68 ;
69
70 mkdir -p output &&
71 data=(\$(ls ./*.fast*));
72 if [ \${\#data[@]} -eq 2 ]; then
73 mv "\${data[0]}" output/"\${data[0]}"_forward.$outputformat;
74 mv "\${data[1]}" output/"\${data[1]}"_reverse.$outputformat;
75 elif [ \${\#data[@]} -eq 1 ]; then
76 mv "\${data[0]}" output/"\${data[0]}"__single.$outputformat;
77 fi;
78
79 #if $input.input_select != "sra_file":
80 ); done;
81 #end if
82 echo "Done with all accessions."
83 ]]>
84 </command>
85 <expand macro="configfile_hack"/>
86 <inputs>
87 <expand macro="input_conditional"/>
88 <param name="outputformat" type="select" display="radio" label="Select output format" help="Compression will greatly reduce the amount of space occupied by downloaded data. Downstream applications such as a short-read mappers will accept compressed data as input. Consider this example: an uncoimpressed 400 Mb fastq datasets compresses to 100 Mb or 80 Mb by gzip or bzip2, respectively. " argument="--gzip --bzip2">
89 <option value="fastqsanger.gz">gzip compressed fastq</option>
90 <option value="fastqsanger">Uncompressed fastq</option>
91 <option value="fastqsanger.bz2">bzip2 compressed fastq</option>
92 </param>
93 <section name="adv" title="Advanced Options" expanded="False">
94 <param name="minID" type="integer" label="Minimum spot ID" optional="true" help="Minimum spot id to be dumped." argument="--minSpotId"/>
95 <param name="maxID" type="integer" label="Maximum spot ID" optional="true" help="Maximum spot id to be dumped." argument="--maxSpotId"/>
96 <param name="minlen" type="integer" label="Minimum read length" optional="true" help="Filter by sequence length. Will dump only reads longer or equal to this value." argument="--minReadLen"/>
97 <param name="split" type="boolean" checked="true" truevalue="--split-spot" falsevalue="" label="Split spot by read pairs" help="Split spots into individual reads." argument="--split-spot"/>
98 <expand macro="alignments"/>
99 <expand macro="region"/>
100 <expand macro="matepairDist"/>
101 <param name="readfilter" type="select" value="" label="filter by value" argument="--read-filter">
102 <option value="">None</option>
103 <option value="pass">pass</option>
104 <option value="reject">reject</option>
105 <option value="criteria">criteria</option>
106 <option value="redacted">redacted</option>
107 </param>
108 <param name="spotgroups" type="text" label="Filter by spot-groups" optional="true" argument="--spot-groups"/>
109 <param type="boolean" truevalue="--clip" falsevalue="" argument="--clip" label="Apply left and right clips" />
110 <param type="boolean" truevalue="--skip-technical" falsevalue="" checked="False" label="Dump only biological reads" argument="--skip-technical"/>
111 <param label="Table name within cSRA object" type="text" value="" optional="true" help="For SRA of noisy long-reads put SEQUENCE" argument="--table"/>
112 </section>
113 </inputs>
114 <outputs>
115 <collection name="list_paired" type="list:paired" label="Paired-end data (fastq-dump)">
116 <!-- Use named regex group to grab pattern
117 <identifier_0>_<identifier_1>.fq. Here identifier_0 is the list
118 identifier in the nested collection and identifier_1 is either
119 forward or reverse (for instance samp1_forward.fq).
120 -->
121 <discover_datasets pattern="(?P&lt;identifier_0&gt;[^_]+)_\d+.fastq_(?P&lt;identifier_1&gt;[^_]+)\.fastqsanger" ext="fastqsanger" directory="output"/>
122 <discover_datasets pattern="(?P&lt;identifier_0&gt;[^_]+)_\d+.fastq.gz_(?P&lt;identifier_1&gt;[^_]+)\.fastqsanger.gz" ext="fastqsanger.gz" directory="output"/>
123 <discover_datasets pattern="(?P&lt;identifier_0&gt;[^_]+)_\d+.fastq.bz2_(?P&lt;identifier_1&gt;[^_]+)\.fastqsanger.bz2" ext="fastqsanger.bz2" directory="output"/>
124 </collection>
125 <collection name="list_single" type='list' label="Single-end data (fastq-dump)">
126 <discover_datasets pattern="(?P&lt;designation&gt;.+)_\d+.fastq__single\.fastqsanger" directory="output" ext='fastqsanger'/>
127 <discover_datasets pattern="(?P&lt;designation&gt;.+)_\d+.fastq.gz__single\.fastqsanger.gz" directory="output" ext='fastqsanger.gz'/>
128 <discover_datasets pattern="(?P&lt;designation&gt;.+)_\d+.fastq.bz2__single\.fastqsanger.bz2" directory="output" ext='fastqsanger.bz2'/>
129 </collection>
130 </outputs>
131 <tests>
132 <test expect_num_outputs="2">
133 <param name="input_select" value="accession_number"/>
134 <param name="outputformat" value="fastqsanger"/>
135 <param name="accession" value="SRR044777"/>
136 <param name="skip_technical" value="True"/>
137 <output_collection name="list_single" type="list" count="1">
138 <element name="SRR044777">
139 <assert_contents>
140 <not_has_text text="rRNA_primer"/>
141 <has_text text="F47USSH02GNP1D"/>
142 </assert_contents>
143 </element>
144 </output_collection>
145 </test>
146 <test expect_num_outputs="2">
147 <param name="input_select" value="accession_number"/>
148 <param name="outputformat" value="fastqsanger.gz"/>
149 <param name="accession" value="SRR925743"/>
150 <param name="maxID" value="5"/>
151 <output_collection name="list_paired" type="list:paired" count="1">
152 <element name="SRR925743">
153 <element name="forward" file="SRR925743_forward.fastqsanger" decompress="True"/>
154 <element name="reverse" file="SRR925743_reverse.fastqsanger" decompress="True"/>
155 </element>
156 </output_collection>
157 </test>
158 <test expect_num_outputs="2">
159 <param name="input_select" value="accession_number"/>
160 <param name="outputformat" value="fastqsanger"/>
161 <param name="accession" value="SRR925743"/>
162 <param name="maxID" value="5"/>
163 <output_collection name="list_paired" type="list:paired" count="1">
164 <element name="SRR925743">
165 <element name="forward" file="SRR925743_forward.fastqsanger"/>
166 <element name="reverse" file="SRR925743_reverse.fastqsanger"/>
167 </element>
168 </output_collection>
169 </test>
170 <test expect_num_outputs="2">
171 <param name="input_select" value="file_list"/>
172 <param name="outputformat" value="fastqsanger"/>
173 <param name="file_list" value="list_pe"/>
174 <param name="maxID" value="5"/>
175 <output_collection name="list_paired" type="list:paired" count="1">
176 <element name="DRR015708">
177 <element name="forward" file="DRR015708_forward.fastqsanger"/>
178 <element name="reverse" file="DRR015708_reverse.fastqsanger"/>
179 </element>
180 </output_collection>
181 </test>
182 <test expect_num_outputs="2">
183 <param name="input_select" value="file_list"/>
184 <param name="outputformat" value="fastqsanger"/>
185 <param name="file_list" value="list_pe2"/>
186 <param name="maxID" value="5"/>
187 <output_collection name="list_paired" type="list:paired" count="1">
188 <element name="ERR027433">
189 <element name="forward" file="ERR027433_forward.fastqsanger"/>
190 <element name="reverse" file="ERR027433_reverse.fastqsanger"/>
191 </element>
192 </output_collection>
193 </test>
194 <test expect_num_outputs="2">
195 <param name="input_select" value="file_list"/>
196 <param name="outputformat" value="fastqsanger"/>
197 <param name="file_list" value="list_se"/>
198 <param name="maxID" value="5"/>
199 <output_collection name="list_single" type="list" count="1">
200 <element name="SRR1993644" file="SRR1993644.fastqsanger"/>
201 </output_collection>
202 </test>
203 <test expect_num_outputs="2">
204 <param name="input_select" value="accession_number"/>
205 <param name="outputformat" value="fastqsanger.gz"/>
206 <param name="accession" value="SRR6982805"/>
207 <param name="maxID" value="2"/>
208 <param name="table" value="SEQUENCE"/>
209 <output_collection name="list_single" type="list" count="1">
210 <element name="SRR6982805" file="SRR6982805.fastqsanger.gz" ftype="fastqsanger.gz" decompress="True"/>
211 </output_collection>
212 </test>
213 <test expect_num_outputs="2">
214 <param name="input_select" value="accession_number"/>
215 <param name="outputformat" value="fastqsanger.gz"/>
216 <param name="accession" value="ERR086330, SRR11953971"/>
217 <output_collection name="list_paired" type="list:paired" count="2">
218 <element name="ERR086330">
219 <element name="forward" file="ERR086330_1.fastq.gz" ftype="fastqsanger.gz" decompress="True"/>
220 <element name="reverse" file="ERR086330_2.fastq.gz" ftype="fastqsanger.gz" decompress="True"/>
221 </element>
222 <element name="SRR11953971">
223 <element name="forward" file="SRR11953971_1.fastq.gz" ftype="fastqsanger.gz" decompress="True"/>
224 <element name="reverse" file="SRR11953971_2.fastq.gz" ftype="fastqsanger.gz" decompress="True"/>
225 </element>
226 </output_collection>
227 </test>
228 </tests>
229 <help><![CDATA[
230 **What it does?**
231
232 This tool extracts data (in fastq_ format) from the Short Read Archive (SRA) at the National Center for Biotechnology Information (NCBI). It is based on the fasterq-dump_ utility of the SRA Toolkit. The following applies:
233
234 - if data is paired-ended (or mate-pair) the tool will generate a collection of file pairs, in which each element will be a pair of fastq_ files containing forward and reverse mates.
235 - if data is single ended, each element of the collection will be a single fastq_ dataset.
236
237
238 @HOW_TO_USE_IT@
239
240 -----
241
242 **Output**
243
244 In every case, fastq datasets produced will be saved in Galaxy's history as a collection_ - a single history element containing multiple datasets. In fact, regardless of the experimental design, three collections will be produced: one containing paired-end data, another containing single-end data, and a third one which contains reads which could not be classified.
245 Some collections may be empty if the accessions provided in the list do not contain one of the type of data.
246
247 .. class:: warningmark
248
249 When you decide to dump technical reads (in Advanced Options Dump only biological reads is set to No), you will probably find your PAIRED data in the other data collection as it is impossible to determine if it was 2 biological reads or one biological and one technical.
250
251 .. class:: warningmark
252
253 By default, only biological reads are dumped and in case of PAIRED dataset only the spots which have both reads will be in the paired-end collection. The remaining single reads will be in the other colletion.
254 To keep all reads, and potentially not have the same number of reads in forward and reverse use the --split-files option in Advanced Options, Select how to split the spots.
255
256 @ACCESSION_LIST_HOWTO@
257
258 -----
259
260
261 .. _fastq: https://en.wikipedia.org/wiki/FASTQ_format
262 .. _fasterq-dump: https://github.com/ncbi/sra-tools/wiki/HowTo:-fasterq-dump
263 .. _collection: https://galaxyproject.org/tutorials/collections/
264 .. _link: https://trace.ncbi.nlm.nih.gov/Traces/index.html?view=run_browser&display=reads
265
266 @SRATOOLS_ATTRRIBUTION@
267 ]]>
268 </help>
269 <expand macro="citation"/>
270 </tool>