changeset 0:e08b21abb96d draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/vpt commit 16e04b2423dc0380a47243fb15bfd120dd95dedc
author bgruening
date Sun, 22 Jun 2025 12:25:39 +0000
parents
children
files macros.xml vpt_extract.xml
diffstat 2 files changed, 232 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml	Sun Jun 22 12:25:39 2025 +0000
@@ -0,0 +1,147 @@
+<macros>
+    <token name="@TOOL_VERSION@">1.3.0</token>
+    <token name="@VERSION_SUFFIX@">2</token>
+    <token name="@PROFILE@">23.0</token>
+    <xml name="requirements">
+        <requirements>
+            <container type="docker">quay.io/bgruening/vpt:1.3.0-1</container>
+            <yield/>
+        </requirements>
+    </xml>
+    <xml name="creator">
+        <creator>
+            <organization name="European Galaxy Team" url="https://galaxyproject.org/eu/" />
+            <person givenName="Amirhossein" familyName="Naghsh Nilchi" email="nilchia@informatik.uni-freiburg.de" />
+            <person givenName="Pavan" familyName="Videm" email="videmp@informatik.uni-freiburg.de" />
+            <person givenName="Björn" familyName="Grüning" email="gruening@informatik.uni-freiburg.de" />
+        </creator>
+    </xml>
+    <token name="@CMD@"><![CDATA[
+        mkdir -p 'input/images' 'output/' &&
+        #for $image in $input_images:
+            ln -s '$image' 'input/images/${image.element_identifier}.${image.ext}' &&
+        #end for
+        ln -s '$input_micron_to_mosaic' 'input/micron_to_mosaic_pixel_transform.csv' &&
+        ]]></token>
+    <token name="@COMMON_ARGS@"><![CDATA[
+        --processes \${GALAXY_SLOTS:-10}
+        --verbose
+        --log-file 'output/log'
+    ]]>
+    </token>
+    <xml name="common_input">
+        <param argument="--input_images" type="data" format="tiff" multiple="true" label="MEROSCOPE tiff images"/>
+        <param argument="--input_micron_to_mosaic" type="data" format="csv" label="Micron to mosaic mapping file"/>
+    </xml>
+    <xml name="normalization_param" token_label="Normalization">
+        <param name="normalization" type="select" label="@LABEL@">
+            <option value="default">default (min-max range normalization)</option>
+            <option value="CLAHE">CLAHE (Contrast Limited Adaptive Histogram Equalization)</option>
+        </param>
+    </xml>
+    <xml name="channel_options_basic">
+            <yield/>
+            <option value="Cellbound1">Cellbound1</option>
+            <option value="Cellbound2">Cellbound2</option>
+            <option value="Cellbound3">Cellbound3</option>
+        </xml>
+    <xml name="channel_options_none">
+        <expand macro="channel_options_basic">
+            <option value="None" selected="true">None</option>
+            <option value="DAPI">DAPI</option>
+            <option value="PolyT">PolyT</option>
+            <yield/>
+        </expand>
+</xml>
+    <xml name="advanced_output">
+        <section name="advanced_output" title="Advanced output options">
+            <param name="log" type="boolean" truevalue="True" falsevalue="False" checked="true" label="Output log?"/>
+        </section>
+    </xml>
+    <xml name="common_output">
+        <data name="vpt_log" format="txt" from_work_dir="output/log" label="${tool.name} on ${on_string}: VPT log">
+            <filter>advanced_output['log']</filter>
+        </data>
+    </xml>
+    <xml name="task_input_data">
+        <conditional name="normalize_conditional">
+            <param name="normalize_select" type="select" label="Perform Normalization?">
+                <option value="Yes" selected="true">Yes</option>
+                <option value="No">No</option>
+            </param>
+            <when value="Yes">
+                <conditional name="normalize_type_conditional" label="Select normalization method">
+                    <expand macro="normalization_param"/>
+                    <when value="default"/>
+                    <when value="CLAHE">
+                        <param name="clip_limit" type="float" min="0" max="1" value="0.01" label="Clip limit" help="higher values give more contrast"/>
+                        <param name="filter_size" type="integer" min="1" value="100" label="Tile grid size"/>
+                    </when>
+                </conditional>
+            </when>
+            <when value="No"/>
+        </conditional>
+        <conditional name="blur_conditional">
+            <param name="blur_select" type="select" label="Perform Blur?">
+                <option value="Yes">Yes</option>
+                <option value="No" selected="true">No</option>
+            </param>
+            <when value="Yes">
+                <param name="blur_options" type="select" label="Blur options">
+                    <option value="average">average</option>
+                    <option value="median">median</option>
+                    <option value="gaussian">gaussian</option>
+                </param>
+                <param name="kernel_size" type="integer" min="0" value="5" label="Kernel size in pixel"/>
+            </when>
+            <when value="No"/>
+        </conditional>
+        <conditional name="downsample_conditional">
+            <param name="downsample_select" type="select" label="Perform downsample?">
+                <option value="Yes">Yes</option>
+                <option value="No" selected="true">No</option>
+            </param>
+            <when value="Yes">
+                <param name="scale" type="float" min="0" value="2.0" label="Downsample" help="Reduces the size of the images during segmentation to decrease processing time" />
+            </when>
+            <when value="No"/>
+        </conditional>
+    </xml>
+    <xml name="channel_map_conditional_childs">
+        <when value="None"/>
+        <when value="DAPI">
+            <expand macro="task_input_data"/>
+        </when>
+        <when value="PolyT">
+            <expand macro="task_input_data"/>
+        </when>
+        <when value="Cellbound1">
+            <expand macro="task_input_data"/>
+        </when>
+        <when value="Cellbound2">
+            <expand macro="task_input_data"/>
+        </when>
+        <when value="Cellbound3">
+            <expand macro="task_input_data"/>
+        </when>
+    </xml>
+    <xml name="sanitize_digits">
+        <sanitizer invalid_char="">
+            <valid initial="string.digits">
+                <add value=","/>
+                <add value="."/>
+            </valid>
+       </sanitizer>
+    </xml>
+    <xml name="citations">
+        <citations>
+            <citation type="bibtex">@Manual{github,
+                title = {Vizgen Post-processing Tool},
+                author = {Vizgen},
+                organization = {Vizgen},
+                year = {2022},
+                url = {https://github.com/Vizgen/vizgen-postprocessing}}
+            </citation>
+        </citations>
+    </xml>
+</macros>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vpt_extract.xml	Sun Jun 22 12:25:39 2025 +0000
@@ -0,0 +1,85 @@
+<tool id="vpt_extract" name="Vizgen VPT - Extract" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
+    <description>image patches</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements" />
+    <expand macro="creator" />
+    <command detect_errors="exit_code"><![CDATA[
+        @CMD@
+        vpt
+            @COMMON_ARGS@
+            extract-image-patch
+            --input-images 'input/images/'
+            --input-micron-to-mosaic 'input/micron_to_mosaic_pixel_transform.csv'
+            --output-patch 'output/patch1.png'
+            --center-x $center_x
+            --center-y $center_y
+            --size-x $size_x
+            --size-y $size_y
+            --input-z-index $input_z_index
+            #if $red_stain_name != "None":
+                --red-stain-name $red_stain_name
+            #end if
+            #if $green_stain_name != "None":
+                --green-stain-name $green_stain_name
+            #end if
+            #if $blue_stain_name != "None":
+                --blue-stain-name $blue_stain_name
+            #end if
+            --normalization $normalization
+    ]]></command>
+    <inputs>
+        <expand macro="common_input"/>
+        <param argument="--center-x" type="integer" value="0" label="X coordinate in micron space"/>
+        <param argument="--center-y" type="integer" value="0" label="Y coordinate in micron space"/>
+        <param argument="--size-x" type="integer" min="1" value="108" label="Width of the patch in micron space"/>
+        <param argument="--size-y" type="integer" min="1" value="108" label="Height of the patch in micron space"/>
+        <param argument="--input_z_index" type="integer" min="0" value="2" label="The Z plane of the mosaic tiff images to use for the patch"/>
+        <param argument="--red-stain-name" type="select" label="The stain that will be used for red channel of the patch">
+            <expand macro="channel_options_none"/>
+        </param>
+        <param argument="--green-stain-name" type="select" label="The stain that will be used for green channel of the patch">
+            <expand macro="channel_options_none"/>
+        </param>
+        <param argument="--blue-stain-name" type="select" label="The stain that will be used for blue channel of the patch">
+            <expand macro="channel_options_none"/>
+        </param>
+        <expand macro="normalization_param" label="Normalization method that will be used on each channel of the patch"/>
+        <expand macro="advanced_output"/>
+    </inputs>
+    <outputs>
+        <data name="patch_image" format="png" from_work_dir="output/patch1.png" label="${tool.name} on ${on_string}: Patched image"/>
+        <expand macro="common_output"/>
+    </outputs>
+    <tests>
+        <test expect_num_outputs="2">
+            <param name="input_images" location="https://zenodo.org/records/15319018/files/mosaic_Cellbound1_z0.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound1_z1.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound1_z2.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound1_z3.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound1_z4.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound1_z5.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound1_z6.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound2_z0.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound2_z1.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound2_z2.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound2_z3.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound2_z4.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound2_z5.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound2_z6.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound3_z0.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound3_z1.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound3_z2.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound3_z3.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound3_z4.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound3_z5.tif,https://zenodo.org/records/15319018/files/mosaic_Cellbound3_z6.tif,https://zenodo.org/records/15319018/files/mosaic_DAPI_z0.tif,https://zenodo.org/records/15319018/files/mosaic_DAPI_z1.tif,https://zenodo.org/records/15319018/files/mosaic_DAPI_z2.tif,https://zenodo.org/records/15319018/files/mosaic_DAPI_z3.tif,https://zenodo.org/records/15319018/files/mosaic_DAPI_z4.tif,https://zenodo.org/records/15319018/files/mosaic_DAPI_z5.tif,https://zenodo.org/records/15319018/files/mosaic_DAPI_z6.tif,https://zenodo.org/records/15319018/files/mosaic_PolyT_z0.tif,https://zenodo.org/records/15319018/files/mosaic_PolyT_z1.tif,https://zenodo.org/records/15319018/files/mosaic_PolyT_z2.tif,https://zenodo.org/records/15319018/files/mosaic_PolyT_z3.tif,https://zenodo.org/records/15319018/files/mosaic_PolyT_z4.tif,https://zenodo.org/records/15319018/files/mosaic_PolyT_z5.tif,https://zenodo.org/records/15319018/files/mosaic_PolyT_z6.tif"/>
+            <param name="input_micron_to_mosaic" location="https://zenodo.org/records/15319018/files/micron_to_mosaic_pixel_transform.csv"/>
+            <param name="center_x" value="200"/>
+            <param name="center_y" value="200"/>
+            <param name="size_x" value="208"/>
+            <param name="size_y" value="208"/>
+            <param name="input_z_index" value="2"/>
+            <param name="red_stain_name" value="Cellbound1"/>
+            <param name="green_stain_name" value="Cellbound3"/>
+            <param name="blue_stain_name" value="DAPI"/>
+            <param name="normalization" value="CLAHE"/>
+            <section name="advanced_output">
+                <param name="log" value="true"/>
+            </section>
+            <output name="patch_image" location="https://zenodo.org/records/15319018/files/patch1.png" ftype="png" compare="image_diff"/>
+            <output name="vpt_log">
+                <assert_contents>
+                    <has_text_matching expression="Extract image patch finished"/>
+                </assert_contents>
+            </output>
+        </test>
+    </tests>
+    <help>
+The Vizgen Post-processing Tool (VPT) is a scalable and reproducible tool which enables users to reprocess and refine the single-cell results of MERSCOPE experiments.
+
+The extract-image-patch tool extracts a patch from the mosaic image at the specified coordinates and size. The patch is saved as a PNG image. It can be used for manual segmentation or for training machine learning models.
+    </help>
+    <expand macro="citations" />
+</tool>
\ No newline at end of file