comparison idr_download_by_ids.xml @ 0:57aa9597cd31 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/idr_download commit 253efabdfea3a1fecc4c0f2c54c0e97a7d7960ab"
author iuc
date Sat, 08 Feb 2020 13:24:39 -0500
parents
children 9340cbc7796c
comparison
equal deleted inserted replaced
-1:000000000000 0:57aa9597cd31
1 <?xml version="1.0"?>
2 <tool id="idr_download_by_ids" name="IDR Download" version="0.9" profile="18.09">
3 <description>- download images from the Image Data Resource using image IDs</description>
4 <macros>
5 <xml name="region_spec" token_pos="upper-left corner">
6 <param name="x_coord" type="integer" value="0" min="0"
7 label="x-coordinate of region @POS@" />
8 <param name="y_coord" type="integer" value="0" min="0"
9 label="y-coordinate of region @POS@" />
10 <param name="width" type="integer" value="0" min="0"
11 label="Region width"
12 help="Set to zero to extend the rectangle maximally along the x-axis of the image" />
13 <param name="height" type="integer" value="0" min="0"
14 label="Region height"
15 help="Set to zero to extend the rectangle maximally along the y-axis of the image" />
16 </xml>
17 </macros>
18 <requirements>
19 <requirement type="package" version="5.6.0">python-omero</requirement>
20 <requirement type="package" version="3.1.3">matplotlib</requirement>
21 </requirements>
22 <command detect_errors="exit_code"><![CDATA[
23 mkdir downloads && cd downloads &&
24 #if str($image_ids.source) == 'link':
25 python -c 'print("${image_ids.id_spec}".replace(",", "|").split("?show=")[-1].replace("|", "\n"))'
26 ## https://idr.openmicroscopy.org/webclient/?show=image-3426274|image-3426275|image-3426276|image-3426277
27 #else:
28 cat '${image_ids.id_spec}'
29 #end if
30 | python '$__tool_directory__/idr_download_by_ids.py'
31 #set $channel = str($channel).strip()
32 #if $channel:
33 -c '$channel'
34 #end if
35 -f $frame
36 -z $z_section
37 #if str($clip_image.select):
38 ${clip_image.select} ${clip_image.x_coord} ${clip_image.y_coord} ${clip_image.width} ${clip_image.height}
39 #end if
40 $skip_failed
41
42 2> >(tee -a $out_log >&2)
43 ]]></command>
44 <inputs>
45 <conditional name="image_ids">
46 <param name="source" type="select" label="How would you like to specify the IDs of images to download?">
47 <option value="link">As text (comma-separated list of IDs or a valid IDR link)</option>
48 <option value="dataset">As a dataset (one image ID per line)</option>
49 </param>
50 <when value="link">
51 <param name="id_spec" type="text"
52 label="Image IDs to download"
53 help="You can enter a single image-id, or a comma (or '|')-separated list of IDs. Alternatively, you can paste here a link to an image selection obtained through the IDR webclient.">
54 <sanitizer>
55 <valid><add value="|" /></valid>
56 </sanitizer>
57 </param>
58 </when>
59 <when value="dataset">
60 <param name="id_spec" type="data" format="txt"
61 label="Select a dataset with image IDs (one per line)" />
62 </when>
63 </conditional>
64 <param name="channel" type="text"
65 label="Name of the channel to download"
66 help="For all image IDs only the specified channel will be downloaded. If left empty, the first channel (whatever this is) will be downloaded by default." />
67 <param name="z_section" type="integer" value="0" min="0"
68 label="z-plane of images to download" />
69 <param name="frame" type="integer" value="0" min="0"
70 label="Image frame to download" />
71 <conditional name="clip_image">
72 <param name="select" type="select"
73 label="Limit the download to a selected region of the image?">
74 <option value="">No, download the entire image plane</option>
75 <option value="--rectangle">Specify a region using its upper-left corner</option>
76 <option value="--center">Specify a width x height region around a central point</option>
77 </param>
78 <when value="" />
79 <when value="--rectangle">
80 <expand macro="region_spec" />
81 </when>
82 <when value="--center">
83 <expand macro="region_spec" pos="center" />
84 </when>
85 </conditional>
86 <param name="skip_failed" type="boolean" checked="false" truevalue="--skip-failed" falsevalue=""
87 label="Skip failed retrievals?"
88 help="By default the tool will fail with an error on the first non-retrievable image ID. Here, you can choose to skip non-retrievable image IDs and continue downloading the available ones instead. The error log will contain warnings about failed IDs in this case." />
89 </inputs>
90 <outputs>
91 <data name="out_log" format="txt" label="${tool.name} error log" />
92 <collection name="output_file" type="list">
93 <discover_datasets pattern="__name_and_ext__" directory="downloads" />
94 </collection>
95 </outputs>
96 <tests>
97 <test>
98 <param name="source" value="dataset" />
99 <param name="id_spec" value="ids.txt" />
100 <param name="channel" value="615.0" />
101 <conditional name="clip_image">
102 <param name="select" value="--rectangle" />
103 <param name="x_coord" value="3" />
104 <param name="y_coord" value="3" />
105 <param name="width" value="5" />
106 <param name="height" value="5" />
107 </conditional>
108 <param name="frame" value="2" />
109 <output_collection name="output_file" type="list">
110 <element name="Centrin_PCNT_Cep215_20110506_Fri-1545_0_SIR_PRJ_1884807_3_3_5_5" file="test1.tiff"/>
111 </output_collection>
112 </test>
113 <test>
114 <param name="source" value="link" />
115 <param name="id_spec" value="1884807" />
116 <param name="channel" value="615.0" />
117 <conditional name="clip_image">
118 <param name="select" value="--rectangle" />
119 <param name="x_coord" value="3" />
120 <param name="y_coord" value="3" />
121 <param name="width" value="5" />
122 <param name="height" value="5" />
123 </conditional>
124 <param name="frame" value="2" />
125 <output_collection name="output_file" type="list">
126 <element name="Centrin_PCNT_Cep215_20110506_Fri-1545_0_SIR_PRJ_1884807_3_3_5_5" file="test1.tiff"/>
127 </output_collection>
128 </test>
129 <test>
130 <param name="source" value="link" />
131 <param name="id_spec" value="1884807" />
132 <param name="channel" value="615.0" />
133 <conditional name="clip_image">
134 <param name="select" value="--center" />
135 <param name="x_coord" value="5" />
136 <param name="y_coord" value="5" />
137 <param name="width" value="5" />
138 <param name="height" value="5" />
139 </conditional>
140 <param name="frame" value="2" />
141 <output_collection name="output_file" type="list">
142 <element name="Centrin_PCNT_Cep215_20110506_Fri-1545_0_SIR_PRJ_1884807_3_3_5_5" file="test1.tiff"/>
143 </output_collection>
144 </test>
145 <test>
146 <param name="source" value="link" />
147 <param name="id_spec" value="https://idr.openmicroscopy.org/webclient/?show=image-9036708|image-9036710|image-9036711" />
148 <param name="channel" value="Spo20(51-91)" />
149 <param name="z_section" value="4" />
150 <conditional name="clip_image">
151 <param name="select" value="" />
152 </conditional>
153 <param name="frame" value="20" />
154 <output_collection name="output_file" type="list" count="3">
155 <element name="171101_LeadingEdgeDeletionPSMMovies01_15_R3D_9036711_0_0_1024_1024">
156 <assert_contents>
157 <has_size value="4194510" />
158 </assert_contents>
159 </element>
160 </output_collection>
161 <output name="out_log">
162 <assert_contents>
163 <has_text text="(ID: 9036710): Specified image plane (4) is out of bounds"/>
164 <has_n_lines n="1"/>
165 </assert_contents>
166 </output>
167 </test>
168 <test expect_failure="true">
169 <!-- Test behavior with non-existing image-ID 9036708999 -->
170 <param name="source" value="link" />
171 <param name="id_spec" value="https://idr.openmicroscopy.org/webclient/?show=image-9036708999|image-9036710|image-9036711" />
172 <param name="channel" value="Spo20(51-91)" />
173 <param name="z_section" value="4" />
174 <conditional name="clip_image">
175 <param name="select" value="" />
176 </conditional>
177 <param name="frame" value="20" />
178 </test>
179 <test>
180 <!-- Repeat test with non-existing image-ID 9036708999,
181 but use skip-failed option -->
182 <param name="source" value="link" />
183 <param name="id_spec" value="https://idr.openmicroscopy.org/webclient/?show=image-9036708999|image-9036710|image-9036711" />
184 <param name="channel" value="Spo20(51-91)" />
185 <param name="z_section" value="4" />
186 <conditional name="clip_image">
187 <param name="select" value="" />
188 </conditional>
189 <param name="frame" value="20" />
190 <param name="skip_failed" value="true" />
191 <output_collection name="output_file" type="list" count="2">
192 <element name="171101_LeadingEdgeDeletionPSMMovies01_15_R3D_9036711_0_0_1024_1024">
193 <assert_contents>
194 <has_size value="4194510" />
195 </assert_contents>
196 </element>
197 </output_collection>
198 <output name="out_log">
199 <assert_contents>
200 <has_text text="9036708999: Unable to find an image with this ID in the database. Skipping download!" />
201 <has_text text="(ID: 9036710): Specified image plane (4) is out of bounds" />
202 <has_n_lines n="2"/>
203 </assert_contents>
204 </output>
205 </test>
206 </tests>
207 <help><![CDATA[
208 Download image data from the IDR_ (Image Data Resource) - a public repository
209 of reference image datasets from published scientific studies.
210
211 .. _IDR: https://idr.openmicroscopy.org/about/
212
213 -----
214
215 .. class:: infomark
216
217 **Input**
218
219 A set of image IDs as can be obtained from the IDR webclient_ like this:
220
221 1. select the images you want to download
222 2. click on the 'Link' button on the top right of the page and copy the provided
223 URL
224 3. paste the URL into the input field of this tool, for example: ::
225
226 https://idr.openmicroscopy.org/webclient/?show=image-9036708|image-9036710|image-9036711
227
228 Alternatively, you can simply provide a list of known image IDs in the text
229 input field (comma or '|'-separated ), or as an input file (each ID on a
230 separate line).
231
232 Most images in the IDR have more than two dimensions. Thus, there are
233 parameters available which allow you to select a particular recording channel,
234 z-plane or time frame to download.
235 You can also select a region which will be used to crop the images, rather
236 than downloading the entire file.
237
238 .. _webclient: https://idr.openmicroscopy.org/
239
240
241 -----
242
243 .. class:: infomark
244
245 **Output**
246
247 Downloaded images will be saved in TIFF format. If you selected multiple image
248 IDs to download, these will be saved as elements of a collection.
249
250 The accompanying error log dataset may hold valuable information about requests
251 that could not be fulfilled exactly as specified, or that were found to be
252 ambiguous.
253 ]]></help>
254 <citations>
255 <citation type="doi">10.1038/nmeth.4326</citation>
256 </citations>
257 </tool>