comparison pyega3.xml @ 4:9564758e8638 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/pyega3 commit a7400d366495a3e2bd6e0cb120834a59327537ec
author iuc
date Wed, 07 Dec 2022 15:26:17 +0000
parents 8bbe09a52904
children f9db47f68e5e
comparison
equal deleted inserted replaced
3:8bbe09a52904 4:9564758e8638
1 <tool id="pyega3" name="EGA Download Client" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.01" > 1 <tool id="pyega3" name="EGA Download Client" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.01" >
2 <macros> 2 <macros>
3 <token name="@TOOL_VERSION@">4.0.5</token> 3 <token name="@TOOL_VERSION@">4.0.5</token>
4 <token name="@VERSION_SUFFIX@">1</token> 4 <token name="@VERSION_SUFFIX@">2</token>
5 </macros> 5 </macros>
6 <requirements> 6 <requirements>
7 <requirement type="package" version="@TOOL_VERSION@">pyega3</requirement> 7 <requirement type="package" version="@TOOL_VERSION@">pyega3</requirement>
8 </requirements> 8 </requirements>
9 <version_command><![CDATA[ 9 <version_command><![CDATA[
47 && rm -f downloads/*.md5 ## checksum validation already performed by pyEGA, cleanup downloads folder 47 && rm -f downloads/*.md5 ## checksum validation already performed by pyEGA, cleanup downloads folder
48 48
49 #elif $action.action_type == "download_files" 49 #elif $action.action_type == "download_files"
50 #import re 50 #import re
51 #set file_ids=[x.split('\t')[int(str($action.id_column))-1] for x in open(str($id_table)).readlines()] 51 #set file_ids=[x.split('\t')[int(str($action.id_column))-1] for x in open(str($id_table)).readlines()]
52 #set outfiles=[x.split('\t')[int(str($action.file_column))-1].replace('\n', '') for x in open(str($id_table)).readlines()]
53 mkdir downloads 52 mkdir downloads
54 #for f, o in zip($file_ids, $outfiles) 53 #for f in $file_ids
55 #if not f.startswith("EGAF") 54 #if not f.startswith("EGAF")
56 && >&2 echo "Ignoring \"$f\": no EGA file ID" 55 && >&2 echo "Ignoring \"$f\": no EGA file ID"
57 #continue 56 #continue
58 #end if 57 #end if
59 && 58 &&
60 echo 'Downloading $f: $o' 59 echo 'Downloading $f'
61 && 60 &&
62 pyega3 -c \${PYEGA_CONNECTIONS:-30} -cf '$credentials' 61 pyega3 -c \${PYEGA_CONNECTIONS:-30} -cf '$credentials'
63 fetch '$f' 62 fetch '$f'
64 --max-retries 10 63 --max-retries 10
65 #if $action.range.reference_name 64 #if $action.range.reference_name
70 #if $action.range.end 69 #if $action.range.end
71 --end $action.range.end 70 --end $action.range.end
72 #end if 71 #end if
73 #end if 72 #end if
74 --output-dir downloads 73 --output-dir downloads
75 #if re.match(".*vcf(_genomic_range_.*|).gz$", o)
76 #if $action.range.reference_name or ($action.range.start or $action.range.end)
77 && mv 'downloads/$f/'$o[:-3]'_genomic_range_'\$([ -z "$action.range.reference_name" ] && printf "None" || printf "$action.range.reference_name")'_'\$([ -z "$action.range.start" ] && printf "None" || printf "$action.range.reference_name")'_'\$([ -z "$action.range.reference_name" ] && printf "None" || printf "$action.range.end")'.gz' 'downloads/$f/'$o'.vcf_bgzip'
78 #else
79 && mv 'downloads/$f/$o' 'downloads/$f/'$o'.vcf_bgzip'
80 #end if
81 #end if
82 #if re.match(".*ped$", o)
83 && mv 'downloads/$f/$o' 'downloads/$f/'$o'.tabular'
84 #end if
85 #end for 74 #end for
75 && for vcf in \$(ls downloads/**/*vcf.gz); do mv "\${vcf}" "\${vcf:0:-6}vcf_bgzip"; done ## renaming vcf.gz files to vcf_bgzip to recognize format
86 && rm -f downloads/**/*.md5 ## checksum validation already performed by pyEGA, clean up downloads folder 76 && rm -f downloads/**/*.md5 ## checksum validation already performed by pyEGA, clean up downloads folder
87 77
88 #end if 78 #end if
89 ]]></command> 79 ]]></command>
90 <configfiles> 80 <configfiles>
126 </section> 116 </section>
127 </when> 117 </when>
128 <when value="download_files"> 118 <when value="download_files">
129 <param name="id_table" type="data" format="tabular" label="Table with IDs to download" help="A tabular file where one column contains the set of file IDs. This will output a collection. Please select files that are all the same format (e.g. all BAM or all VCF)."/> 119 <param name="id_table" type="data" format="tabular" label="Table with IDs to download" help="A tabular file where one column contains the set of file IDs. This will output a collection. Please select files that are all the same format (e.g. all BAM or all VCF)."/>
130 <param name="id_column" type="data_column" data_ref="id_table" label="Column containing the file IDs" help="File Identifiers starting with 'EGAF'. For example: EGAF00001753735" /> 120 <param name="id_column" type="data_column" data_ref="id_table" label="Column containing the file IDs" help="File Identifiers starting with 'EGAF'. For example: EGAF00001753735" />
131 <param name="file_column" type="data_column" data_ref="id_table" label="Column containing the file names" />
132 <section name="range" title="Request a specific Genomic range? (will be applied to ALL requested files)" expanded="false"> 121 <section name="range" title="Request a specific Genomic range? (will be applied to ALL requested files)" expanded="false">
133 <param argument="--reference-name" type="text" optional="true" label="Reference Sequence Name" help="For example 'chr1', '1', or 'chrX'. If unspecified, all data is returned." /> 122 <param argument="--reference-name" type="text" optional="true" label="Reference Sequence Name" help="For example 'chr1', '1', or 'chrX'. If unspecified, all data is returned." />
134 <param argument="--start" type="integer" optional="true" min="0" label="Start Position" help="0-based, inclusive. Only used if a reference sequence name was specified"/> 123 <param argument="--start" type="integer" optional="true" min="0" label="Start Position" help="0-based, inclusive. Only used if a reference sequence name was specified"/>
135 <param argument="--end" type="integer" optional="true" min="0" label="End Position" help="0-based, exclusive. Only used if a reference sequence name was specified"/> 124 <param argument="--end" type="integer" optional="true" min="0" label="End Position" help="0-based, exclusive. Only used if a reference sequence name was specified"/>
136 </section> 125 </section>
151 <data name="logfile" format="txt" from_work_dir="pyega3_output.log" label="${tool.name}: log"> 140 <data name="logfile" format="txt" from_work_dir="pyega3_output.log" label="${tool.name}: log">
152 <filter> output_log </filter> 141 <filter> output_log </filter>
153 </data> 142 </data>
154 <collection name="downloaded_file_collection" type="list" label="${tool.name} on ${on_string}: Downloaded datasets"> 143 <collection name="downloaded_file_collection" type="list" label="${tool.name} on ${on_string}: Downloaded datasets">
155 <filter> action['action_type'] == 'download_files' </filter> 144 <filter> action['action_type'] == 'download_files' </filter>
156 <discover_datasets pattern="__designation_and_ext__" recurse="true" directory="downloads" /> 145 <discover_datasets pattern="__name_and_ext__" recurse="true" directory="downloads" />
157 </collection> 146 </collection>
158 </outputs> 147 </outputs>
159 <tests> 148 <tests>
160 <!-- list datasets with default credentials --> 149 <!-- list datasets with default credentials -->
161 <test expect_num_outputs="1"> 150 <test expect_num_outputs="1">
185 <test expect_num_outputs="1"> 174 <test expect_num_outputs="1">
186 <param name="action_type" value="download_file"/> 175 <param name="action_type" value="download_file"/>
187 <param name="file_id" value="EGAF00001775036"/> 176 <param name="file_id" value="EGAF00001775036"/>
188 <output name="downloaded_file" md5="3b89b96387db5199fef6ba613f70e27c"/> 177 <output name="downloaded_file" md5="3b89b96387db5199fef6ba613f70e27c"/>
189 </test> 178 </test>
190 <!-- download a single file, with genomic range specified --> 179 <!-- download a single vcf.gz -->
180 <test expect_num_outputs="1">
181 <param name="action_type" value="download_file"/>
182 <param name="file_id" value="EGAF00007243775"/>
183 <output name="downloaded_file" md5="51cfb69bf3b9416ff425381a58c18a2b" ftype="vcf_bgzip" />
184 </test>
185 <!-- download a single bam, with genomic range specified -->
191 <test expect_num_outputs="1"> 186 <test expect_num_outputs="1">
192 <param name="action_type" value="download_file"/> 187 <param name="action_type" value="download_file"/>
193 <param name="file_id" value="EGAF00001753756"/> 188 <param name="file_id" value="EGAF00001753756"/>
194 <param name="reference_name" value="1"/> 189 <param name="reference_name" value="1"/>
195 <param name="start" value="0"/> 190 <param name="start" value="0"/>
199 <!-- download multiple files --> 194 <!-- download multiple files -->
200 <test expect_num_outputs="1"> 195 <test expect_num_outputs="1">
201 <param name="action_type" value="download_files"/> 196 <param name="action_type" value="download_files"/>
202 <param name="id_table" value="filelist.tabular"/> 197 <param name="id_table" value="filelist.tabular"/>
203 <param name="id_column" value="1"/> 198 <param name="id_column" value="1"/>
204 <param name="file_column" value="5"/>
205 <output_collection name="downloaded_file_collection" type="list" count="2"> 199 <output_collection name="downloaded_file_collection" type="list" count="2">
206 <element name="ENCFF000VWO.bam" md5="b8ae14d5d1f717ab17d45e8fc36946a0" /> 200 <element name="ENCFF000VWO.bam" md5="b8ae14d5d1f717ab17d45e8fc36946a0" />
207 <element name="ENCFF284YOU.bam" md5="3b89b96387db5199fef6ba613f70e27c" /> 201 <element name="ENCFF284YOU.bam" md5="3b89b96387db5199fef6ba613f70e27c" />
208 </output_collection> 202 </output_collection>
209 <assert_stderr> 203 <assert_stderr>
213 <!-- download multiple files, in combination with a genomic range --> 207 <!-- download multiple files, in combination with a genomic range -->
214 <test expect_num_outputs="1"> 208 <test expect_num_outputs="1">
215 <param name="action_type" value="download_files"/> 209 <param name="action_type" value="download_files"/>
216 <param name="id_table" value="filelist2.tabular"/> 210 <param name="id_table" value="filelist2.tabular"/>
217 <param name="id_column" value="1"/> 211 <param name="id_column" value="1"/>
218 <param name="file_column" value="5"/>
219 <param name="reference_name" value="1"/> 212 <param name="reference_name" value="1"/>
220 <param name="start" value="0"/> 213 <param name="start" value="0"/>
221 <param name="end" value="10000"/> 214 <param name="end" value="10000"/>
222 <output_collection name="downloaded_file_collection" count="2"> 215 <output_collection name="downloaded_file_collection" count="2">
223 <element name="NA19239_genomic_range_1_0_10000" md5="bcdcf18846233cbe5cc8afd95168552c" /> 216 <element name="NA19239_genomic_range_1_0_10000" md5="bcdcf18846233cbe5cc8afd95168552c" />
230 <!-- download multiple vcf.gz files --> 223 <!-- download multiple vcf.gz files -->
231 <test expect_num_outputs="1"> 224 <test expect_num_outputs="1">
232 <param name="action_type" value="download_files"/> 225 <param name="action_type" value="download_files"/>
233 <param name="id_table" value="filelist3.tabular"/> 226 <param name="id_table" value="filelist3.tabular"/>
234 <param name="id_column" value="1"/> 227 <param name="id_column" value="1"/>
235 <param name="file_column" value="5"/>
236 <output_collection name="downloaded_file_collection" type="list" count="2"> 228 <output_collection name="downloaded_file_collection" type="list" count="2">
237 <element name="HG00408.novoBreak__256r__4.100100-10100100__7.200100-9000100.vcf.gz" md5="51cfb69bf3b9416ff425381a58c18a2b" /> 229 <element name="HG00408.novoBreak__256r__4.100100-10100100__7.200100-9000100" md5="51cfb69bf3b9416ff425381a58c18a2b" ftype="vcf_bgzip" />
238 <element name="HG01890.HGSVC__145r__1.900100-10001000__18.2001000-90001000.vcf.gz" md5="ebad4425191a89d3e970c02190a87175" /> 230 <element name="HG01890.HGSVC__145r__1.900100-10001000__18.2001000-90001000" md5="ebad4425191a89d3e970c02190a87175" ftype="vcf_bgzip" />
239 </output_collection> 231 </output_collection>
240 </test> 232 </test>
241 </tests> 233 </tests>
242 <help><![CDATA[ 234 <help><![CDATA[
243 The pyEGA3 download client is a python-based tool for viewing and downloading files from authorized EGA datasets. 235 The pyEGA3 download client is a python-based tool for viewing and downloading files from authorized EGA datasets.