diff idr_download_by_ids.xml @ 7:f067504aa92a draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/idr_download commit 6b9df5f3cf2518e48eced93a2904a89776bde02d"
author iuc
date Thu, 05 Nov 2020 23:29:40 +0000
parents 5c743356df83
children 97f70f7ed077
line wrap: on
line diff
--- a/idr_download_by_ids.xml	Mon Jul 06 19:33:59 2020 -0400
+++ b/idr_download_by_ids.xml	Thu Nov 05 23:29:40 2020 +0000
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<tool id="idr_download_by_ids" name="IDR Download" version="0.42" profile="18.09">
+<tool id="idr_download_by_ids" name="IDR Download" version="0.43" profile="18.09">
     <description>- download images from the Image Data Resource using image IDs</description>
     <macros>
         <xml name="region_spec" token_pos="upper-left corner">
@@ -16,10 +16,21 @@
         </xml>
     </macros>
     <requirements>
-        <requirement type="package" version="5.6.0">python-omero</requirement>
+        <requirement type="package" version="5.7.1">python-omero</requirement>
         <requirement type="package" version="0.4.2">pylibtiff</requirement>
     </requirements>
     <command detect_errors="exit_code"><![CDATA[
+        
+        #if $omero_instance_type.omero_instance == "priv":
+            #set $username = $__user__.extra_preferences.get('omero_account|username', "")
+            #set $password = $__user__.extra_preferences.get('omero_account|password', "")
+
+            #if $username == "" or $password =="":
+                echo "OMERO connection credentials are empty. Set your credentials via: User -> Preferences -> Manage Information"  &&
+                exit 1
+            #end if
+        #end if
+        
         mkdir downloads && cd downloads &&
         #if str($image_ids.source) == 'link':
             python -c 'print("${image_ids.id_spec}".replace(",", "|").split("?show=")[-1].replace("|", "\n"))'
@@ -39,10 +50,35 @@
         #end if
         $skip_failed
         $download_tar
-
+        #if $omero_instance_type.omero_instance =='priv':
+            -h '$omero_host'
+            $omero_secured
+            -u '$username'
+            -p '$password'
+        #end if
         2> >(tee -a $out_log >&2)
     ]]></command>
 <inputs>
+        <conditional name="omero_instance_type">
+            <param name="omero_instance" type="select" label="Which OMERO instance to connect?"
+                   help="By default, the tool will download a tarball containing individual images from IDR into your Galaxy history. If you 
+                   need to connect to your own instance, set your connection username and password from User->Preference->Manage Information" >
+                <option value="idr">IDR</option>
+                <option value="priv">other OMERO instance</option>
+            </param>
+            <when value="priv">
+                <param name="omero_host" type="text" label="OMERO host URL">
+                    <validator type="regex" message="Enter a valid host location, for example, your.omero.server">
+                        [.A-Za-z0-9_-]
+                    </validator>
+                </param>
+                <param name="omero_secured" type="boolean" label="Seured connection?" checked="true" truevalue="--omero-secured" falsevalue=""
+                        help="Select Yes if your OMERO instance is running with SSL, otherwise select No">
+                </param>
+            </when>
+            <when value="idr" />
+        </conditional>
+
         <conditional name="image_ids">
             <param name="source" type="select" label="How would you like to specify the IDs of images to download?">
                 <option value="link">As text (comma-separated list of IDs or a valid IDR link)</option>
@@ -104,9 +140,32 @@
     </outputs>
     <tests>
         <test>
+            <conditional name="omero_instance_type">
+                 <param name="omero_instance" value="idr" />
+            </conditional>
             <param name="source" value="dataset" />
             <param name="id_spec" value="ids.txt" />
-            <param name="channel" value="615.0" />
+            <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" />
+            <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"/>
+            </output_collection>
+        </test>
+        <test>
+            <conditional name="omero_instance_type">
+                 <param name="omero_instance" value="idr" />
+            </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" />
@@ -121,26 +180,12 @@
             </output_collection>
         </test>
         <test>
+            <conditional name="omero_instance_type">
+                 <param name="omero_instance" value="idr" />
+            </conditional>
             <param name="source" value="link" />
             <param name="id_spec" value="1884807" />
-            <param name="channel" value="615.0" />
-            <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" />
-            <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="test1.tiff"/>
-            </output_collection>
-        </test>
-        <test>
-            <param name="source" value="link" />
-            <param name="id_spec" value="1884807" />
-            <param name="channel" value="615.0" />
+            <param name="channel" value="PCNT" />
             <conditional name="clip_image">
                 <param name="select" value="--center" />
                 <param name="x_coord" value="5" />
@@ -155,6 +200,9 @@
             </output_collection>
         </test>
         <test>
+            <conditional name="omero_instance_type">
+                 <param name="omero_instance" value="idr" />
+            </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)" />
@@ -179,6 +227,9 @@
             </output>
         </test>
         <test expect_failure="true">
+            <conditional name="omero_instance_type">
+                 <param name="omero_instance" value="idr" />
+            </conditional>
             <!-- 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" />
@@ -193,6 +244,9 @@
         <test>
             <!-- Repeat test with non-existing image-ID 9036708999,
             but use skip-failed option -->
+            <conditional name="omero_instance_type">
+                 <param name="omero_instance" value="idr" />
+            </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)" />
@@ -219,6 +273,9 @@
             </output>
         </test>
         <test>
+            <conditional name="omero_instance_type">
+                 <param name="omero_instance" value="idr" />
+            </conditional>
             <!-- Test for download images in a tarball -->
             <param name="source" value="dataset" />
             <param name="id_spec" value="ids_tar.txt" />