Mercurial > repos > iuc > sra_tools
comparison fastq_dump.xml @ 1:462ee06c9358 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sra-tools commit 4defaa3ff1c21e2ec39033bfe63ee69471104ede
author | iuc |
---|---|
date | Tue, 17 May 2016 14:14:50 -0400 |
parents | b723c120161a |
children | f256cb398262 |
comparison
equal
deleted
inserted
replaced
0:b723c120161a | 1:462ee06c9358 |
---|---|
1 <tool id="fastq_dump" name="Extract reads" version="1.2.5"> | 1 <tool id="fastq_dump" name="Extract reads" version="1.3.0"> |
2 <description>in FASTQ/A format from NCBI SRA.</description> | 2 <description>in FASTQ/A format from NCBI SRA.</description> |
3 <macros> | 3 <macros> |
4 <import>sra_macros.xml</import> | 4 <import>sra_macros.xml</import> |
5 </macros> | 5 </macros> |
6 <expand macro="requirements"/> | 6 <expand macro="requirements"/> |
8 <exit_code range="127" level="fatal" description="Could not locate fastq-dump binary"/> | 8 <exit_code range="127" level="fatal" description="Could not locate fastq-dump binary"/> |
9 </stdio> | 9 </stdio> |
10 <version_command>fastq-dump --version</version_command> | 10 <version_command>fastq-dump --version</version_command> |
11 <command> | 11 <command> |
12 <![CDATA[ | 12 <![CDATA[ |
13 | |
14 #if $input.input_select=="file_list": | |
15 for acc in `cat $input.file_list` ; | |
16 do | |
17 #elif $input.input_select=="accession_number": | |
18 acc="$input.accession" && | |
19 #end if | |
20 | |
21 #if $input.input_select=="file_list" or $input.input_select=="accession_number": | |
22 [ ""\$acc" =~ ^[E|S|D]RR[0-9]{1,}$" ] && ( | |
23 #end if | |
24 | |
13 ## Need to set the home directory to the current working directory, | 25 ## Need to set the home directory to the current working directory, |
14 ## else the tool tries to write to home/.ncbi and fails when used | 26 ## else the tool tries to write to home/.ncbi and fails when used |
15 ## with a cluster manager. | 27 ## with a cluster manager. |
16 export HOME=\$PWD && | 28 export HOME=\$PWD && |
17 vdb-config --restore-defaults && | 29 vdb-config --restore-defaults && |
22 ## Do not use prefetch if region is specified, to avoid downloading | 34 ## Do not use prefetch if region is specified, to avoid downloading |
23 ## the complete sra file. | 35 ## the complete sra file. |
24 #if ( str( $adv.region ) == "" ) and ( str( $adv.minID ) == "" ) and ( str( $adv.maxID ) == "" ): | 36 #if ( str( $adv.region ) == "" ) and ( str( $adv.minID ) == "" ) and ( str( $adv.maxID ) == "" ): |
25 ASCP_PATH=`command -v ascp` && | 37 ASCP_PATH=`command -v ascp` && |
26 ASCP_KEY=`dirname \$ASCP_PATH`/asperaweb_id_dsa.openssh || true && | 38 ASCP_KEY=`dirname \$ASCP_PATH`/asperaweb_id_dsa.openssh || true && |
27 prefetch --ascp-path "\$ASCP_PATH|\$ASCP_KEY" $input.accession && | 39 prefetch --ascp-path "\$ASCP_PATH|\$ASCP_KEY" "\$acc" && |
28 ## Duplicate vdb-config, in case settings changed between prefetch and | 40 ## Duplicate vdb-config, in case settings changed between prefetch and |
29 ## dump command. | 41 ## dump command. |
30 vdb-config -s "/repository/user/main/public/root=\$PWD" && | 42 vdb-config -s "/repository/user/main/public/root=\$PWD" && |
31 #end if | 43 #end if |
32 fastq-dump --accession "$input.accession" | 44 fastq-dump --accession "\$acc" |
45 --split-files | |
33 #end if | 46 #end if |
34 --defline-seq '@\$sn[_\$rn]/\$ri' | 47 --defline-seq '@\$sn[_\$rn]/\$ri' |
35 --stdout | 48 |
36 $adv.split | 49 $adv.split |
37 #if str( $adv.alignments ) == "aligned": | 50 #if str( $adv.alignments ) == "aligned": |
38 --aligned | 51 --aligned |
39 #end if | 52 #end if |
40 #if str( $adv.alignments ) == "unaligned": | 53 #if str( $adv.alignments ) == "unaligned": |
61 #if str( $adv.matepairDist ) != "": | 74 #if str( $adv.matepairDist ) != "": |
62 --matepair-distance "$adv.matepairDist" | 75 --matepair-distance "$adv.matepairDist" |
63 #end if | 76 #end if |
64 $adv.clip | 77 $adv.clip |
65 $adv.skip_technical | 78 $adv.skip_technical |
79 | |
66 #if str( $outputformat ) == "fasta": | 80 #if str( $outputformat ) == "fasta": |
67 --fasta | 81 --fasta |
68 #end if | 82 #end if |
69 #if $input.input_select=="file": | 83 #if $input.input_select=="file": |
84 --stdout | |
70 "$input.file" > "$output_file" | 85 "$input.file" > "$output_file" |
86 #elif $input.input_select=="file_list": | |
87 "\$acc" | |
71 #else: | 88 #else: |
72 "$input.accession" > "$output_accession" | 89 --stdout |
73 #end if | 90 "\$acc" > "$output_accession" ) |
91 #end if | |
92 | |
93 #if $input.input_select=="file_list": | |
94 ) ; done | |
95 | |
96 ; | |
97 | |
98 | |
99 #if str( $outputformat ) == "fasta": | |
100 | |
101 for f in *_2.fasta ; do mv "\$f" "`basename \$f _2.fasta`_reverse.fasta" ; mv "`basename \$f _2.fasta`_1.fasta" "`basename \$f _2.fasta`_forward.fasta" ; done && | |
102 for f in *_1.fasta; do mv "\$f" "`basename \$f _1.fasta`__single.fasta"; done | |
103 | |
104 #else: | |
105 | |
106 for f in *_2.fastq ; do mv "\$f" "`basename \$f _2.fastq`_reverse.fastq" ; mv "`basename \$f _2.fastq`_1.fastq" "`basename \$f _2.fastq`_forward.fastq" ; done && | |
107 for f in *_1.fastq; do mv "\$f" "`basename \$f _1.fastq`__single.fastq"; done | |
108 | |
109 #end if | |
110 | |
111 | |
112 | |
113 | |
114 | |
115 #end if | |
116 | |
117 | |
74 ]]> | 118 ]]> |
75 </command> | 119 </command> |
76 <inputs> | 120 <inputs> |
77 <expand macro="input_conditional"/> | 121 <expand macro="input_conditional"/> |
78 <param name="outputformat" type="select" label="select output format"> | 122 <param name="outputformat" type="select" label="select output format"> |
103 </param> | 147 </param> |
104 <param name="skip_technical" type="boolean" truevalue="--skip-technical" falsevalue="" checked="False" label="Dump only biological reads"/> | 148 <param name="skip_technical" type="boolean" truevalue="--skip-technical" falsevalue="" checked="False" label="Dump only biological reads"/> |
105 </section> | 149 </section> |
106 </inputs> | 150 </inputs> |
107 <outputs> | 151 <outputs> |
108 <data format="fastq" name="output_accession" label="${input.accession}.${outputformat}"> | 152 <collection name="list_paired" type="list:paired" label="Pair-end Fast(q|a)"> |
109 <filter>input['input_select'] == "accession_number"</filter> | 153 <filter>input['input_select'] == "file_list"</filter> |
110 <change_format> | 154 <!-- Use named regex group to grab pattern |
111 <when input="outputformat" value="fasta" format="fasta"/> | 155 <identifier_0>_<identifier_1>.fq. Here identifier_0 is the list |
112 </change_format> | 156 identifier in the nested collection and identifier_1 is either |
113 </data> | 157 forward or reverse (for instance samp1_forward.fq). |
114 <data format="fastq" name="output_file" label="${input.file.name}.${outputformat}"> | 158 --> |
115 <filter>input['input_select'] == "file"</filter> | 159 <discover_datasets pattern="(?P<identifier_0>[^_]+)_(?P<identifier_1>[^_]+)\.fastq" ext="fastqsanger" visible="false" /> |
116 <change_format> | 160 <discover_datasets pattern="(?P<identifier_0>[^_]+)_(?P<identifier_1>[^_]+)\.fasta" ext="fasta" visible="false" /> |
117 <when input="outputformat" value="fasta" format="fasta"/> | 161 </collection> |
118 </change_format> | 162 <collection name="output_collection" type='list' label="Single-end Fast(q|a)"> |
119 </data> | 163 <filter>input['input_select'] == "file_list"</filter> |
164 <discover_datasets pattern="(?P<designation>.+)__single\.fastq" directory="." ext='fastqsanger'/> | |
165 <discover_datasets pattern="(?P<designation>.+)__single\.fasta" directory="." ext='fasta'/> | |
166 </collection> | |
167 <data format="fastqsanger" name="output_accession" > | |
168 <filter>input['input_select'] == "accession_number"</filter> | |
169 <change_format> | |
170 <when input="outputformat" value="fasta" format="fasta"/> | |
171 </change_format> | |
172 </data> | |
173 <data format="fastqsanger" name="output_file" label="${input.file.name}.${outputformat}"> | |
174 <filter>input['input_select'] == "file"</filter> | |
175 <change_format> | |
176 <when input="outputformat" value="fasta" format="fasta"/> | |
177 </change_format> | |
178 </data> | |
120 </outputs> | 179 </outputs> |
121 <tests> | 180 <tests> |
122 <test> | 181 <test> |
123 <param name="input_select" value="accession_number"/> | 182 <param name="input_select" value="accession_number"/> |
124 <param name="outputformat" value="fastqsanger"/> | 183 <param name="outputformat" value="fastqsanger"/> |
125 <param name="accession" value="SRR044777"/> | 184 <param name="accession" value="SRR044777"/> |
126 <param name="skip_technical" value="True"/> | 185 <param name="skip_technical" value="True"/> |
127 <output name="output_accession"> | 186 <output name="output_accession"> |
128 <assert_contents> | 187 <assert_contents> |
129 <not_has_text text="rRNA_primer"/> | 188 <not_has_text text="rRNA_primer"/> |
130 <has_text text="F47USSH02GNP1D" /> | 189 <has_text text="F47USSH02GNP1D" /> |
131 </assert_contents> | 190 </assert_contents> |
132 </output> | 191 </output> |
133 </test> | 192 </test> |
134 <test> | 193 <test> |
135 <param name="input_select" value="accession_number"/> | 194 <param name="input_select" value="accession_number"/> |
136 <param name="outputformat" value="fastqsanger"/> | 195 <param name="outputformat" value="fastqsanger"/> |
137 <param name="accession" value="SRR925743"/> | 196 <param name="accession" value="SRR925743"/> |
138 <param name="maxID" value="5"/> | 197 <param name="maxID" value="5"/> |
139 <output name="output_accession" file="fastq_dump_result.fastq" ftype="fastq"/> | 198 <output name="output_accession" file="fastq_dump_result.fastq" ftype="fastqsanger"/> |
140 </test> | 199 </test> |
141 </tests> | 200 </tests> |
142 <help> | 201 <help> |
143 This tool extracts reads from SRA archives using fastq-dump. | 202 This tool extracts reads from SRA archives using fastq-dump. |
144 The fastq-dump program is developed at NCBI, and is available at | 203 The fastq-dump program is developed at NCBI, and is available at |
145 http://www.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=software. | 204 http://www.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=software. |
205 | |
206 NB: Single-end or pair-end collections may be empty if given SRRs LibraryLayout contains only either SINGLE or PAIRED respectively | |
146 @SRATOOLS_ATTRRIBUTION@ | 207 @SRATOOLS_ATTRRIBUTION@ |
147 </help> | 208 </help> |
148 <expand macro="citation"/> | 209 <expand macro="citation"/> |
149 </tool> | 210 </tool> |