view starting_modules.xml @ 3:27396311a314 draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
author bgruening
date Mon, 11 May 2020 07:45:07 -0400
parents 3c3cd68d6d5a
children 670975e92458
line wrap: on
line source

<tool id="cp_common" name="Starting Modules" version="@CP_VERSION@">
    <description>load images and metadata into CellProfiler (Images, Metadata, NamesAndTypes, Groups)</description>
    <macros>
        <import>macros.xml</import>
        <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>

    <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>