view omero_get_value.xml @ 5:f5c4f523432d draft default tip

planemo upload for repository https://github.com/Helmholtz-UFZ/galaxy-tools/tree/main/tools/omero commit 3f4e79a4e8350481f3c8d70bc64f01b4cb0a4bf0
author ufz
date Fri, 13 Jun 2025 20:47:38 +0000
parents 7a94eb8c345d
children
line wrap: on
line source

<tool id="omero_get_value" name="OMERO get Object" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@" license="MIT">
    <description> with ezomero </description>
    <macros>
        <import>macros.xml</import>
        <token name="@VERSION_SUFFIX@">2</token>
    </macros>
    <xrefs>
        <xref type="bio.tools">omero</xref>
    </xrefs>
    <expand macro="ezomero_requirements"/>
    <command detect_errors="exit_code"><![CDATA[
        mkdir output;
        python '$__tool_directory__/omero_get_value.py'
        --credential-file '$credentials'
        @HOST_PORT@
        --obj_type '$obj_type'
        #if $ids_input.ids_format == "values"
            --ids ${str($ids_input.ids).replace(',', ' ')}
        #else
            --ids_path '$ids_input.ids_path'
        #end if
        --out_dir ./output/
    ]]></command>
    <configfiles>
        <expand macro="credentials"/>
    </configfiles>
    <inputs>
        <expand macro="host_port"/>
        <param argument="obj_type" type="select" optional="false" label="Type of object to fetch:">
            <option value="Annotation">Annotation</option>
            <option value="Tag">Tag</option>
            <option value="Table">Table</option>
            <option value="Attachment">Attachment</option>
        </param>
        <conditional name="ids_input">
            <param name="ids_format" type="select" label="How do you provide the ID(s) of the OMERO object?">
                <option value="values">Comma separated values</option>
                <option value="file">From a dataset (one per line)</option>
            </param>
            <when value="values">
                <param argument="--ids" type="text" value="" label="ID(s) of the object(s) to fetch on OMERO separated by comma">
                    <validator type="regex" message="Enter a valid list of IDs (i.e. 2,45,56,67)">^(\d+)(,\d+)*$</validator>
                </param>
            </when>
            <when value="file">
                <param argument="--ids_path" type="data" format="txt,tabular" label="Dataset with ID(s) of the object(s) to fetch on OMERO (one per line)"/>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <collection name="split_output" type="list">
            <discover_datasets pattern="__name_and_ext__" directory="output"/>
            <filter> not (obj_type=="Tag" or obj_type=="Annotation")</filter>
        </collection>
        <data name="tsv" from_work_dir="output.tsv" format="tabular">
            <filter> obj_type=="Tag" or obj_type=="Annotation"</filter>
        </data>
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <param name="omero_host" value="host.docker.internal"/>
            <param name="omero_port" value="6064"/>
            <param name="obj_type" value="Tag"/>
            <conditional name="ids_input">
                <param name="ids_format" value="values"/>
                <param name="ids" value="1"/>
            </conditional>
            <param name="test_username" value="root"/>
            <param name="test_password" value="omero"/>
            <output name="tsv" ftype="tabular">
                <assert_contents>
                    <has_text text="test_tag"/>
                    <has_n_lines n="2"/>
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <param name="omero_host" value="host.docker.internal"/>
            <param name="omero_port" value="6064"/>
            <param name="obj_type" value="Annotation"/>
            <conditional name="ids_input">
                <param name="ids_format" value="values"/>
                <param name="ids" value="7"/>
            </conditional>
            <param name="test_username" value="root"/>
            <param name="test_password" value="omero"/>
            <output name="tsv" ftype="tabular">
                <assert_contents>
                    <has_n_lines n="4"/>
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <param name="omero_host" value="host.docker.internal"/>
            <param name="omero_port" value="6064"/>
            <param name="obj_type" value="Attachment"/>
            <conditional name="ids_input">
                <param name="ids_format" value="values"/>
                <param name="ids" value="2,3,4"/>
            </conditional>
            <param name="test_username" value="root"/>
            <param name="test_password" value="omero"/>
            <output_collection name="split_output" type="list" count="3">
                <element name="ID_2_attachment">
                    <assert_contents>
                        <has_text text="col1"/>
                    </assert_contents>
                </element>
                <element name="ID_3_attachment">
                    <assert_contents>
                         <has_text text="col1"/>
                    </assert_contents>
                 </element>
                <element name="ID_4_attachment">
                    <assert_contents>
                         <has_text text="col1"/>
                    </assert_contents>
                 </element>
            </output_collection>
        </test>
        <test expect_num_outputs="1">
            <param name="omero_host" value="host.docker.internal"/>
            <param name="omero_port" value="6064"/>
            <param name="obj_type" value="Table"/>
            <conditional name="ids_input">
                <param name="ids_format" value="values"/>
                <param name="ids" value="5,6"/>
            </conditional>
            <param name="test_username" value="root"/>
            <param name="test_password" value="omero"/>
            <output_collection name="split_output" type="list" count="2">
                <element name="ID_5_table">
                    <assert_contents>
                        <has_n_lines n="5"/>
                    </assert_contents>
                </element>
                <element name="ID_6_table">
                    <assert_contents>
                         <has_n_lines n="5"/>
                    </assert_contents>
                 </element>
            </output_collection>
        </test>
    </tests>
    <help>
Description
-----------

Tool to fetch Annotation, Tag, Tables and Attachments from IDs.

The IDs can be obtained with the tool OMERO get IDs with ezomero

@SECURITY_DISCLAIMER@
    </help>
    <citations>
        <citation type="doi">10.1038/nmeth.1896</citation>
    </citations>
</tool>