diff qupath_roi_splitter.xml @ 2:3282b4920a34 draft

planemo upload for repository hhttps://github.com/npinter/ROIsplitter commit 918ae25f84e7042ed36461219ff068633c1c2427
author galaxyp
date Fri, 19 Jul 2024 14:33:33 +0000
parents f955895aed01
children 180b6dc5735a
line wrap: on
line diff
--- a/qupath_roi_splitter.xml	Wed Jun 14 16:36:48 2023 +0000
+++ b/qupath_roi_splitter.xml	Fri Jul 19 14:33:33 2024 +0000
@@ -1,24 +1,42 @@
-<tool id="qupath_roi_splitter" name="QuPath ROI Splitter" version="0.1.0+galaxy1">
+<tool id="qupath_roi_splitter" name="QuPath ROI Splitter" version="@VERSION@+galaxy@VERSION_SUFFIX@">
     <description>Split ROI coordinates of QuPath TMA annotation by cell type (classification)</description>
+    <macros>
+        <token name="@VERSION@">0.3.0</token>
+        <token name="@VERSION_SUFFIX@">0</token>
+    </macros>
     <requirements>
         <requirement type="package" version="3.0.1">geojson</requirement>
         <requirement type="package" version="1.24.2">numpy</requirement>
         <requirement type="package" version="4.7.0">opencv</requirement>
-        <requirement type="package" version="2.0.0">pandas</requirement>        
+        <requirement type="package" version="2.0.0">pandas</requirement>
     </requirements>
      <command detect_errors="exit_code"><![CDATA[
         #for $input in $input_collection
-            python3 '$__tool_directory__/qupath_roi_splitter.py' --qupath_roi '$input' &&
+            python3 '$__tool_directory__/qupath_roi_splitter.py'
+                --qupath_roi '$input'
+                $optional.fill
+                $optional.all
+                $optional.img
+             &&
         #end for
-        mkdir out &&
-        mv *.txt out/
+        mkdir out
+        && mv *.txt out/
+        && mv *.png out/
     ]]></command>
     <inputs>
         <param name="input_collection" type="data_collection" format="geojson" label="Input QuPath annotation" help="Collection containing GeoJSON files"/>
+        <section name="optional" title="Optional">
+            <param name="fill" type="boolean" truevalue="--fill" falsevalue="" checked="false" label="Fill ROIs" help="Fill pixels in ROIs"/>
+            <param name="all" type="boolean" truevalue="--all" falsevalue="" checked="false" label="Extract all" help="Extracts all ROIs"/>
+            <param name="img" type="boolean" truevalue="--img" falsevalue="" checked="false" label="Generate image" help="Generates image from ROIs"/>
+        </section>
     </inputs>
     <outputs>
         <collection name="output_txts" type="list" label="${tool.name} on ${on_string}: ROI data">
-            <discover_datasets pattern="__name_and_ext__" directory="out" visible="false" format="txt"/>
+            <discover_datasets pattern="(?P&lt;name&gt;.*\.txt)" directory="out" visible="false" ext="txt"/>
+        </collection>
+        <collection name="output_imgs" type="list" label="${tool.name} on ${on_string}: Images of ROIs">
+            <discover_datasets pattern="(?P&lt;name&gt;.*\.png)" directory="out" visible="false" ext="png"/>
         </collection>
     </outputs>
     <tests>
@@ -29,13 +47,24 @@
                     <element name="annotations_TMA_F-5.geojson" value="annotations_TMA_F-5.geojson" />
                 </collection>
             </param>
+            <section name="optional">
+                <param name="fill" value="true"/>
+                <param name="img" value="true"/>
+            </section>
             <output_collection name="output_txts" type="list" count="4">
-                <element name="F-5_Stroma">
+                <element name="F-5_Stroma.txt">
                     <assert_contents>
                         <has_text text="x"/>
                         <has_text text="y"/>
-                        <has_text text="15561"/>
-                        <has_text text="21160"/>
+                        <has_text text="21153"/>
+                        <has_text text="15570"/>
+                    </assert_contents>
+                </element>
+            </output_collection>
+            <output_collection name="output_imgs" type="list" count="4">
+                <element name="E-5_Tumor.png">
+                    <assert_contents>
+                        <has_size value="459919"/>
                     </assert_contents>
                 </element>
             </output_collection>
@@ -52,4 +81,16 @@
 
         https://github.com/npinter/ROIsplitter
     ]]></help>
+    <citations>
+        <citation type="bibtex">
+            @misc{
+                toolsGalaxyP,
+                author = {Pinter, N, Föll, MC },
+                title = {Galaxy Proteomics Tools},
+                publisher = {GitHub}, journal = {GitHub repository},
+                year = {2024},
+                url = {https://github.com/galaxyproteomics/tools-galaxyp}
+            }
+        </citation>
+    </citations>
 </tool>