view starting_modules.xml @ 6:6070780813d9 draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
author bgruening
date Sun, 05 Nov 2023 09:36:34 +0000
parents 670975e92458
children
line wrap: on
line source

<tool id="cp_common" name="Starting Modules" version="@CP_VERSION@+galaxy@VERSION_SUFFIX@">
    <description>Load images and metadata</description>
    <macros>
        <import>macros.xml</import>
        <token name="@VERSION_SUFFIX@">2</token>
        <import>starting_modules_images.xml</import>
        <import>starting_modules_metadata.xml</import>
        <import>starting_modules_nameandtypes.xml</import>
        <import>starting_modules_groups.xml</import>
    </macros>

    <edam_operations>
        <edam_operation>operation_3443</edam_operation>
    </edam_operations>
    <xrefs>
        <xref type="bio.tools">CellProfiler</xref>
        <xref type="biii">cellprofiler</xref>
    </xrefs>

    <expand macro="py_requirements"/>

    <command detect_errors="aggressive"><![CDATA[
        python '$__tool_directory__/starting_modules.py' '$inputs'
    ]]></command>

    <configfiles>
        <inputs name="inputs"/>
    </configfiles>

    <inputs>    
        <!-- Images module-->
        <expand macro="starting_modules_images" />
        <!-- Metadata module-->
        <expand macro="starting_modules_metadata" />
        <!-- NamesAndTypes-->
        <expand macro="starting_modules_nameandtypes" />
        <!-- Groups -->
        <expand macro="starting_modules_groups" />
    </inputs>
    <outputs>
        <expand macro="output_pipeline_param" />
    </outputs>
    <tests>
        <test>
            <!-- one big test case for various inputs scenarios -->
            <param name="filter_images" value="Images only"/>
            <conditional name="con_metadata_extraction">
                <param name="extract" value="Yes"/>
                <repeat name="extraction_method">
                    <param name="metadata_extraction_method" value="Extract from file/folder names"/>
                    <conditional name="con_metadata_extract_from">
                        <param name="match_all_any" value="and" />
                        <repeat name="r_match">
                            <conditional name="con_match">
                                <param name="operator" value="does"/>
                                <param name="rule_type" value="file"/>
                                <param name="match_value" value="im"/>
                                <param name="contain" value="contain"/>
                            </conditional>
                        </repeat>
                        <repeat name="r_match">
                            <conditional name="con_match">
                                <param name="operator" value="does"/>
                                <param name="rule_type" value="extension"/>
                                <param name="match_type" value="istif"/>
                            </conditional>
                        </repeat>
                        <param name="extract_metadata_from" value="Images matching a rule" />
                    </conditional>
                    <conditional name="con_metadata_source">
                        <param name="metadata_source" value="File name" />
                        <param name="file_name_regex" value="(?P&lt;field1>.*)_(?P&lt;field2>[a-zA-Z0-9]+)_(?P&lt;field3>[a-zA-Z0-9]+)_(?P&lt;field4>[a-zA-Z0-9]+)" />
                    </conditional>
                </repeat>
                <repeat name="extraction_method">
                    <param name="metadata_extraction_method" value="Extract from file/folder names"/>
                    <conditional name="con_metadata_extract_from">
                        <param name="extract_metadata_from" value="All images" />
                    </conditional>
                    <conditional name="con_metadata_source">
                        <param name="metadata_source" value="Folder name" />
                        <param name="folder_name_regex" value="(?P&lt;folderField1>.*)_(?P&lt;folderField2>[a-zA-Z0-9]+)" />
                    </conditional>
                </repeat>
            </conditional>
            <conditional name="pixel_space">
                <param name="process_3d" value="No"/>
            </conditional>
            <conditional name="con_assign_a_name_to">
                <param name="assign_a_name_to" value="Images matching rules"/>
                <repeat name="r_match_rule">
                    <param name="match_all_any" value="and" />
                    <repeat name="r_match">
                        <conditional name="con_match">
                            <param name="rule_type" value="file" />
                            <param name="operator" value="does" />
                            <param name="contain" value="contain" />
                            <param name="match_value" value="im" />
                        </conditional>
                    </repeat>
                    <repeat name="r_match">
                        <conditional name="con_match">
                            <param name="rule_type" value="image" />
                            <param name="operator" value="doesnot" />
                            <param name="match_type" value="ismonochrome" />
                        </conditional>
                    </repeat>
                    <conditional name="con_select_image_type">
                        <param name="name_to_assign" value="Cell" />
                        <param name="select_image_type" value="Objects" />
                    </conditional>
                </repeat>

                <repeat name="r_match_rule">
                    <param name="match_all_any" value="and" />
                    <repeat name="r_match" />
                    <conditional name="con_select_image_type">
                        <param name="name_to_assign" value="GFP" />
                        <param name="select_image_type" value="Illumination function" />
                    </conditional>
                </repeat>

                <repeat name="r_match_rule">
                    <param name="match_all_any" value="or" />
                    <repeat name="r_match">
                        <conditional name="con_match">
                            <param name="rule_type" value="extension" />
                            <param name="operator" value="does" />
                            <param name="match_type" value="istif" />
                        </conditional>
                    </repeat>
                    <conditional name="con_select_image_type">
                        <param name="name_to_assign" value="Actin" />
                        <param name="select_image_type" value="Grayscale image" />
                        <conditional name="con_set_intensity">
                            <param name="set_intensity_range_from" value="Image metadata" />
                        </conditional>
                    </conditional>
                </repeat>
                <param name="matching_method" value="Order" />
            </conditional>
            <conditional name="con_groups">
                <param name="group_images" value="Yes" />
                <param name="group_category" value="field1" />
            </conditional>
            <expand macro="test_out_file" file="common-complicated.cppipe"/>
        </test>
        <test>
            <!-- Repeat test for no grouping -->
            <param name="filter_images" value="Images only"/>
            <conditional name="con_metadata_extraction">
                <param name="extract" value="Yes"/>
                <repeat name="extraction_method">
                    <param name="metadata_extraction_method" value="Extract from file/folder names"/>
                    <conditional name="con_metadata_extract_from">
                        <param name="match_all_any" value="and" />
                        <repeat name="r_match">
                            <conditional name="con_match">
                                <param name="operator" value="does"/>
                                <param name="rule_type" value="file"/>
                                <param name="match_value" value="im"/>
                                <param name="contain" value="contain"/>
                            </conditional>
                        </repeat>
                        <repeat name="r_match">
                            <conditional name="con_match">
                                <param name="operator" value="does"/>
                                <param name="rule_type" value="extension"/>
                                <param name="match_type" value="istif"/>
                            </conditional>
                        </repeat>
                        <param name="extract_metadata_from" value="Images matching a rule" />
                    </conditional>
                    <conditional name="con_metadata_source">
                        <param name="metadata_source" value="File name" />
                        <param name="file_name_regex" value="(?P&lt;field1>.*)_(?P&lt;field2>[a-zA-Z0-9]+)_(?P&lt;field3>[a-zA-Z0-9]+)_(?P&lt;field4>[a-zA-Z0-9]+)" />
                    </conditional>
                </repeat>
                <repeat name="extraction_method">
                    <param name="metadata_extraction_method" value="Extract from file/folder names"/>
                    <conditional name="con_metadata_extract_from">
                        <param name="extract_metadata_from" value="All images" />
                    </conditional>
                    <conditional name="con_metadata_source">
                        <param name="metadata_source" value="Folder name" />
                        <param name="folder_name_regex" value="(?P&lt;folderField1>.*)_(?P&lt;folderField2>[a-zA-Z0-9]+)" />
                    </conditional>
                </repeat>
            </conditional>
            <conditional name="pixel_space">
                <param name="process_3d" value="No"/>
            </conditional>
            <conditional name="con_assign_a_name_to">
                <param name="assign_a_name_to" value="Images matching rules"/>
                <repeat name="r_match_rule">
                    <param name="match_all_any" value="and" />
                    <repeat name="r_match">
                        <conditional name="con_match">
                            <param name="rule_type" value="file" />
                            <param name="operator" value="does" />
                            <param name="contain" value="contain" />
                            <param name="match_value" value="im" />
                        </conditional>
                    </repeat>
                    <repeat name="r_match">
                        <conditional name="con_match">
                            <param name="rule_type" value="image" />
                            <param name="operator" value="doesnot" />
                            <param name="match_type" value="ismonochrome" />
                        </conditional>
                    </repeat>
                    <conditional name="con_select_image_type">
                        <param name="name_to_assign" value="Cell" />
                        <param name="select_image_type" value="Objects" />
                    </conditional>
                </repeat>

                <repeat name="r_match_rule">
                    <param name="match_all_any" value="and" />
                    <repeat name="r_match" />
                    <conditional name="con_select_image_type">
                        <param name="name_to_assign" value="GFP" />
                        <param name="select_image_type" value="Illumination function" />
                    </conditional>
                </repeat>

                <repeat name="r_match_rule">
                    <param name="match_all_any" value="or" />
                    <repeat name="r_match">
                        <conditional name="con_match">
                            <param name="rule_type" value="extension" />
                            <param name="operator" value="does" />
                            <param name="match_type" value="istif" />
                        </conditional>
                    </repeat>
                    <conditional name="con_select_image_type">
                        <param name="name_to_assign" value="Actin" />
                        <param name="select_image_type" value="Grayscale image" />
                        <conditional name="con_set_intensity">
                            <param name="set_intensity_range_from" value="Image metadata" />
                        </conditional>
                    </conditional>
                </repeat>
                <param name="matching_method" value="Order" />
            </conditional>
            <conditional name="con_groups">
                <param name="group_images" value="No" />
            </conditional>
            <expand macro="test_out_file" file="common-nogroup.cppipe" />
        </test>
    </tests>

    <help>
        <![CDATA[

        .. class:: infomark

        **What it does**

        This tool is the first in a CellProfiler pipeline and includes the first four modules:

        *Images*: use the Images module to compile a list of files that you want to analyze. 

        *Metadata*: optionally allows you to extract information describing your images (i.e., metadata) which will be stored along with your measurements. 

        *NamesAndTypes*: allows you to assign a meaningful name to each image by which other modules will refer to it.

        *Groups*: optionally allows you to split your list of images into image subsets (groups) which will be processed independently of each other. Examples of groupings include screening batches, microtiter plates, time-lapse movies, etc.

        .. class:: infomark

        **Input**

        No input parameters are needed for this tool. 

        .. class:: infomark

        **Output**

        A CellProfiler pipeline file *(.cppipe)* with the settings of the 4 modules.

        .. class:: warningmark

        **IMPORTANT**

        This tool has to be the first one in a CellProfiler workflow and the last one **CellProfiler**.

        ]]>    
    </help>
    <expand macro="citations" />
</tool>