diff idr_download_by_ids.xml @ 11:cbd605a24336 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/idr_download commit b68715960d1107593db13dd9e1dbd8d4b905cc6f"
author iuc
date Sat, 15 Jan 2022 12:25:29 +0000
parents 4aed70472589
children 4b794652dcdc
line wrap: on
line diff
--- a/idr_download_by_ids.xml	Wed Nov 24 21:01:02 2021 +0000
+++ b/idr_download_by_ids.xml	Sat Jan 15 12:25:29 2022 +0000
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<tool id="idr_download_by_ids" name="IDR/OMERO Download" version="0.43" profile="18.09">
+<tool id="idr_download_by_ids" name="IDR/OMERO Download" version="0.44" profile="18.09">
     <description>- download images from any OMERO instance using image IDs</description>
     <macros>
         <xml name="region_spec" token_pos="upper-left corner">
@@ -46,14 +46,18 @@
         #if str($image_ids.source) == 'omeroDatasetID':
             --dataset
         #end if
-        #set $channel = str($channel).strip()
-        #if $channel:
-            -c '$channel'
-        #end if
-        -f $frame
-        -z $z_section
-        #if str($clip_image.select):
-            ${clip_image.select} ${clip_image.x_coord} ${clip_image.y_coord} ${clip_image.width} ${clip_image.height}
+        #if $image_region.original == "original":
+            --download-original
+        #else:
+            #set $channel = str($image_region.channel).strip()
+            #if $channel:
+                -c '$channel'
+            #end if
+            -f $image_region.frame
+            -z $image_region.z_section
+            #if str($image_region.clip_image.select):
+                ${image_region.clip_image.select} ${image_region.clip_image.x_coord} ${image_region.clip_image.y_coord} ${image_region.clip_image.width} ${image_region.clip_image.height}
+            #end if
         #end if
         $skip_failed
         $download_tar
@@ -124,26 +128,36 @@
                 <param name="id_dataset_omero" type="integer" min = "0" value = "9059" label="Dataset ID"/>
             </when>
         </conditional>
-        <param name="channel" type="text"
-        label="Name of the channel to download"
-        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." />
-        <param name="z_section" type="integer" value="0" min="0"
-        label="z-plane of images to download" />
-        <param name="frame" type="integer" value="0" min="0"
-        label="Image frame to download" />
-        <conditional name="clip_image">
-            <param name="select" type="select"
-            label="Limit the download to a selected region of the image?">
-                <option value="">No, download the entire image plane</option>
-                <option value="--rectangle">Specify a region using its upper-left corner</option>
-                <option value="--center">Specify a width x height region around a central point</option>
+
+        <conditional name="image_region">
+            <param name="original" type="select" label="Which images do you want to download?">
+                <option value="TIFF" selected="true">Exported TIFF (single channel, single stack)</option>
+                <option value="original">Original file (file uploaded to omero, only available for private instances)</option>
             </param>
-            <when value="" />
-            <when value="--rectangle">
-                <expand macro="region_spec" />
-            </when>
-            <when value="--center">
-                <expand macro="region_spec" pos="center" />
+            <when value="original"/>
+            <when value="TIFF">
+                <param name="channel" type="text"
+                    label="Name of the channel to download"
+                    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." />
+                <param name="z_section" type="integer" value="0" min="0"
+                    label="z-plane of images to download" />
+                <param name="frame" type="integer" value="0" min="0"
+                    label="Image frame to download" />
+                <conditional name="clip_image">
+                    <param name="select" type="select"
+                        label="Limit the download to a selected region of the image?">
+                            <option value="">No, download the entire image plane</option>
+                            <option value="--rectangle">Specify a region using its upper-left corner</option>
+                            <option value="--center">Specify a width x height region around a central point</option>
+                    </param>
+                    <when value="" />
+                    <when value="--rectangle">
+                        <expand macro="region_spec" />
+                    </when>
+                    <when value="--center">
+                        <expand macro="region_spec" pos="center" />
+                    </when>
+                </conditional>
             </when>
         </conditional>
         <param name="skip_failed" type="boolean" checked="false" truevalue="--skip-failed" falsevalue=""
@@ -171,15 +185,18 @@
             </conditional>
             <param name="source" value="dataset" />
             <param name="id_spec" value="ids.txt" />
-            <param name="channel" value="PCNT" />
-            <conditional name="clip_image">
-                <param name="select" value="--rectangle" />
-                <param name="x_coord" value="3" />
-                <param name="y_coord" value="3" />
-                <param name="width" value="5" />
-                <param name="height" value="5" />
+            <conditional name="image_region">
+                <param name="original" value="TIFF"/>
+                <param name="channel" value="PCNT" />
+                <conditional name="clip_image">
+                    <param name="select" value="--rectangle" />
+                    <param name="x_coord" value="3" />
+                    <param name="y_coord" value="3" />
+                    <param name="width" value="5" />
+                    <param name="height" value="5" />
+                </conditional>
+                <param name="frame" value="0" />
             </conditional>
-            <param name="frame" value="0" />
             <param name="download_tar" value="false" />
             <output_collection name="output_file" type="list">
                 <element name="Centrin_PCNT_Cep215_20110506_Fri-1545_0_SIR_PRJ__1884807__3__3__5__5" ftype="tiff" file="test0.tiff"/>
@@ -191,15 +208,18 @@
             </conditional>
             <param name="source" value="link" />
             <param name="id_spec" value="1884807" />
-            <param name="channel" value="PCNT" />
-            <conditional name="clip_image">
-                <param name="select" value="--rectangle" />
-                <param name="x_coord" value="3" />
-                <param name="y_coord" value="3" />
-                <param name="width" value="5" />
-                <param name="height" value="5" />
+            <conditional name="image_region">
+                <param name="original" value="TIFF"/> 
+                <param name="channel" value="PCNT" />
+                <conditional name="clip_image">
+                    <param name="select" value="--rectangle" />
+                    <param name="x_coord" value="3" />
+                    <param name="y_coord" value="3" />
+                    <param name="width" value="5" />
+                    <param name="height" value="5" />
+                </conditional>
+                <param name="frame" value="2" />
             </conditional>
-            <param name="frame" value="2" />
             <param name="download_tar" value="false" />
             <output_collection name="output_file" type="list">
                 <element name="Centrin_PCNT_Cep215_20110506_Fri-1545_0_SIR_PRJ__1884807__3__3__5__5" ftype="tiff" file="test1.tiff"/>
@@ -211,15 +231,18 @@
             </conditional>
             <param name="source" value="link" />
             <param name="id_spec" value="1884807" />
-            <param name="channel" value="PCNT" />
-            <conditional name="clip_image">
-                <param name="select" value="--center" />
-                <param name="x_coord" value="5" />
-                <param name="y_coord" value="5" />
-                <param name="width" value="5" />
-                <param name="height" value="5" />
+            <conditional name="image_region">
+                <param name="original" value="TIFF"/> 
+                <param name="channel" value="PCNT" />
+                <conditional name="clip_image">
+                    <param name="select" value="--center" />
+                    <param name="x_coord" value="5" />
+                    <param name="y_coord" value="5" />
+                    <param name="width" value="5" />
+                    <param name="height" value="5" />
+                </conditional>
+                <param name="frame" value="2" />
             </conditional>
-            <param name="frame" value="2" />
             <param name="download_tar" value="false" />
             <output_collection name="output_file" type="list">
                 <element name="Centrin_PCNT_Cep215_20110506_Fri-1545_0_SIR_PRJ__1884807__3__3__5__5" ftype="tiff" file="test2.tiff"/>
@@ -231,12 +254,15 @@
             </conditional>
             <param name="source" value="link" />
             <param name="id_spec" value="https://idr.openmicroscopy.org/webclient/?show=image-9036708|image-9036710|image-9036711" />
-            <param name="channel" value="Spo20(51-91)" />
-            <param name="z_section" value="4" />
-            <conditional name="clip_image">
-                <param name="select" value="" />
+            <conditional name="image_region">
+                <param name="original" value="TIFF"/> 
+                <param name="channel" value="Spo20(51-91)" />
+                <param name="z_section" value="4" />
+                <conditional name="clip_image">
+                    <param name="select" value="" />
+                </conditional>
+                <param name="frame" value="20" />
             </conditional>
-            <param name="frame" value="20" />
             <param name="download_tar" value="false" />
             <output_collection name="output_file" type="list" count="3">
                 <element name="171101_LeadingEdgeDeletionPSMMovies01_15_R3D__9036711__0__0__1024__1024">
@@ -259,12 +285,15 @@
             <!-- Test behavior with non-existing image-ID 9036708999 -->
             <param name="source" value="link" />
             <param name="id_spec" value="https://idr.openmicroscopy.org/webclient/?show=image-9036708999|image-9036710|image-9036711" />
-            <param name="channel" value="Spo20(51-91)" />
-            <param name="z_section" value="4" />
-            <conditional name="clip_image">
-                <param name="select" value="" />
+            <conditional name="image_region">
+                <param name="original" value="TIFF"/> 
+                <param name="channel" value="Spo20(51-91)" />
+                <param name="z_section" value="4" />
+                <conditional name="clip_image">
+                    <param name="select" value="" />
+                </conditional>
+                <param name="frame" value="20" />
             </conditional>
-            <param name="frame" value="20" />
             <param name="download_tar" value="false" />
         </test>
         <test>
@@ -275,12 +304,15 @@
             </conditional>
             <param name="source" value="link" />
             <param name="id_spec" value="https://idr.openmicroscopy.org/webclient/?show=image-9036708999|image-9036710|image-9036711" />
-            <param name="channel" value="Spo20(51-91)" />
-            <param name="z_section" value="4" />
-            <conditional name="clip_image">
-                <param name="select" value="" />
+            <conditional name="image_region">
+                <param name="original" value="TIFF"/> 
+                <param name="channel" value="Spo20(51-91)" />
+                <param name="z_section" value="4" />
+                <conditional name="clip_image">
+                    <param name="select" value="" />
+                </conditional>
+                <param name="frame" value="20" />
             </conditional>
-            <param name="frame" value="20" />
             <param name="skip_failed" value="true" />
             <param name="download_tar" value="false" />
             <output_collection name="output_file" type="list" count="2">
@@ -305,15 +337,18 @@
             <!-- Test for download images in a tarball -->
             <param name="source" value="dataset" />
             <param name="id_spec" value="ids_tar.txt" />
-            <param name="channel" value="Hoechst" />
-            <conditional name="clip_image">
-                <param name="select" value="--rectangle" />
-                <param name="x_coord" value="0" />
-                <param name="y_coord" value="0" />
-                <param name="width" value="671" />
-                <param name="height" value="511" />
+            <conditional name="image_region">
+                <param name="original" value="TIFF"/> 
+                <param name="channel" value="Hoechst" />
+                <conditional name="clip_image">
+                    <param name="select" value="--rectangle" />
+                    <param name="x_coord" value="0" />
+                    <param name="y_coord" value="0" />
+                    <param name="width" value="671" />
+                    <param name="height" value="511" />
+                </conditional>
+                <param name="frame" value="0" />
             </conditional>
-            <param name="frame" value="0" />
             <output name="output_tar">
                     <assert_contents>
                         <has_size value="1382400" />
@@ -335,15 +370,18 @@
             </conditional>
             <param name="source" value="dataset" />
             <param name="id_spec" value="ids.txt" />
-            <param name="channel" value="PCNT" />
-            <conditional name="clip_image">
-                <param name="select" value="--rectangle" />
-                <param name="x_coord" value="3" />
-                <param name="y_coord" value="3" />
-                <param name="width" value="5" />
-                <param name="height" value="5" />
+            <conditional name="image_region">
+                <param name="original" value="TIFF"/> 
+                <param name="channel" value="PCNT" />
+                <conditional name="clip_image">
+                    <param name="select" value="--rectangle" />
+                    <param name="x_coord" value="3" />
+                    <param name="y_coord" value="3" />
+                    <param name="width" value="5" />
+                    <param name="height" value="5" />
+                </conditional>
+                <param name="frame" value="0" />
             </conditional>
-            <param name="frame" value="0" />
             <param name="download_tar" value="false" />
             <output_collection name="output_file" type="list">
                 <element name="Centrin_PCNT_Cep215_20110506_Fri-1545_0_SIR_PRJ__1884807__3__3__5__5" file="test0.tiff"/>
@@ -357,15 +395,18 @@
             </conditional>
             <param name="source" value="dataset" />
             <param name="id_spec" value="ids.txt" />
-            <param name="channel" value="PCNT" />
-            <conditional name="clip_image">
-                <param name="select" value="--rectangle" />
-                <param name="x_coord" value="3" />
-                <param name="y_coord" value="3" />
-                <param name="width" value="5" />
-                <param name="height" value="5" />
+            <conditional name="image_region">
+                <param name="original" value="TIFF"/> 
+                <param name="channel" value="PCNT" />
+                <conditional name="clip_image">
+                    <param name="select" value="--rectangle" />
+                    <param name="x_coord" value="3" />
+                    <param name="y_coord" value="3" />
+                    <param name="width" value="5" />
+                    <param name="height" value="5" />
+                </conditional>
+                <param name="frame" value="0" />
             </conditional>
-            <param name="frame" value="0" />
             <param name="download_tar" value="false" />
             <assert_stderr>
                 <has_text text="OMERO connection credentials are empty. Set your credentials via: User -> Preferences -> Manage Information" />
@@ -402,6 +443,22 @@
                 </element>
             </output_collection>
         </test>
+        <test>
+            <conditional name="omero_instance_type">
+                 <param name="omero_instance" value="idr" />
+            </conditional>
+            <!-- Test for download all original files from a dataset -->
+            <!-- Impossible in idr: -->
+            <param name="source" value="omeroDatasetID" />
+            <param name="id_dataset_omero" value="9059" />
+            <param name="skip_failed" value="true" />
+            <param name="download_tar" value="false" />
+            <conditional name="image_region">
+                <param name="original" value="original"/> 
+            </conditional>
+            <output_collection name="output_file" type="list" count="0">
+            </output_collection>
+        </test>
     </tests>
     <help><![CDATA[
 Download image data from the IDR_ (Image Data Resource) - a public repository