diff unmicst.xml @ 1:74fe58ff55a5 draft default tip

planemo upload for repository https://github.com/HMS-IDAC/UnMicst commit e14f76a8803cab0013c6dbe809bc81d7667f2ab9
author goeckslab
date Wed, 07 Sep 2022 23:10:14 +0000
parents 6bec4fef6b2e
children
line wrap: on
line diff
--- a/unmicst.xml	Fri Mar 12 00:17:29 2021 +0000
+++ b/unmicst.xml	Wed Sep 07 23:10:14 2022 +0000
@@ -1,53 +1,71 @@
-<tool id="unmicst" name="UnMicst" version="@VERSION@.1" profile="17.09">
-    <description>UNet Model for Identifying Cells and Segmenting Tissue</description>
+<tool id="unmicst" name="UnMicst" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="19.01">
+    <description>Image segmentation - probability map generation</description>
+
     <macros>
         <import>macros.xml</import>
     </macros>
  
     <expand macro="requirements"/>
-    @VERSION_CMD@
+    <expand macro="version_cmd"/>
 
     <command detect_errors="exit_code"><![CDATA[
-    #set $typeCorrected = str($image.name).replace('.ome.tiff','').replace('.ome.tif','').replace('.tiff','').replace('.tif','')+'.ome.tif'
+    #set $ext = str($image.file_ext)
+    #if $ext == 'tiff'
+        #set $ext = 'tif'
+    #end if
+    #set $input = 'image.' + str($ext) 
 
-    ln -s $image '$typeCorrected';
+    ln -s '$image' '$input' &&
+    
+    @CMD_BEGIN@ '$input'
 
-    @CMD_BEGIN@ '$typeCorrected'
+    --tool $tool
     
     #if $stackoutput
-    --stackOutput
+        --stackOutput
     #end if
 
-    --outputPath `pwd`
+    --outputPath '.'
     --channel $channel
     --model $model
     --mean $mean
     --std $stdev
-    --scalingFactor $scalingfactor;
+    --scalingFactor $scalingfactor
+    --outlier $outlier &&
 
     ## Move files to different files for from_work_dir differentiation
     #if $stackoutput
-    mv *Probabilities*.tif Probabilities.tif;
-    mv *Preview*.tif Preview.tif
+        mv *Probabilities*.tif Probabilities.tif &&
+        mv qc/*Preview*.tif Preview.tif
     #else
-    mv *ContoursPM*.tif ContoursPM.tif;
-    mv *NucleiPM*.tif NucleiPM.tif
+        mv *ContoursPM*.tif ContoursPM.tif &&
+        mv *NucleiPM*.tif NucleiPM.tif 
     #end if
     ]]></command>
 
     <inputs>
+        <param name="tool" type="select" label="UnMicst Tool">
+            <option selected="true" value="unmicst-solo">unmicst-solo</option>
+            <option value="unmicst-duo">unmicst-duo</option>
+            <option value="unmicst-legacy">unmicst-legacy</option>
+            <option value="UnMicstCyto2">UnMicstCyto2</option>
+        </param>
         <param name="image" type="data" format="tiff" label="Registered TIFF"/>
         <param name="model" type="select" label="Model">
             <option value="nucleiDAPI">nucleiDAPI</option>
+            <option value="CytoplasmIncell">CytoplasmIncell</option>
+            <option value="CytoplasmIncell2">CytoplasmIncell2</option>
+            <option value="CytoplasmZeissNikon">CytoplasmZeissNikon</option>
             <option value="mousenucleiDAPI">mousenucleiDAPI</option>
-            <option value="CytoplasmIncell">CytoplasmIncell</option>
-            <option value="CytoplasmZeissNikon">CytoplasmZeissNikon</option>
+            <option value="nucleiDAPI1-5">nucleiDAPI1-5</option>
+            <option value="nucleiDAPILAMIN">nucleiDAPILAMIN</option>
         </param>
         <param name="mean" type="float" value="-1" label="Mean (-1 for model default)"/>
         <param name="stdev" type="float" value="-1" label="Standard Deviation (-1 for model default)"/>
         <param name="channel" type="integer" value="0" label="Channel to perform inference on"/>
         <param name="stackoutput" type="boolean"  label="Stack probability map outputs"/>
         <param name="scalingfactor" type="float" value="1.0" label="Factor to scale by"/>
+        <param name="outlier" type="float" value="-1.0" label="Map percentile intensity to max when rescaling intensity values"/>
     </inputs>
 
     <outputs>
@@ -64,41 +82,28 @@
             <filter>not stackoutput</filter>
         </data>
     </outputs>
+    <tests>
+        <test expect_num_outputs="2">
+            <param name="image" value="105.tif" ftype="tiff" />
+            <param name="model" value="nucleiDAPI" />
+            <param name="tool" value="unmicst-legacy"/>
+            <param name="channel" value="1"/>
+            <output name="nuclei" file="105_NucleiPM_1.tif" compare="sim_size" delta="10" />
+            <output name="contours" file="105_ContoursPM_1.tif" compare="sim_size" delta="10" />
+        </test>
+    </tests>
     <help><![CDATA[
-UnMicst - UNet Model for Identifying Cells and Segmenting Tissue
-Image Preprocessing
-Images can be preprocessed by inferring nuclei contours via a pretrained UNet model. The model is trained on 3 classes : background, nuclei contours and nuclei centers. The resulting probability maps can then be loaded into any modular segmentation pipeline that may use (but not limited to) a marker controlled watershed algorithm.
-
-The only input file is: an .ome.tif or .tif (preferably flat field corrected, minimal saturated pixels, and in focus. The model is trained on images acquired at 20x with binning 2x2 or a pixel size of 0.65 microns/px. If your settings differ, you can upsample/downsample to some extent.
-
-Running as a Docker container
-
-The docker image is distributed through Dockerhub and includes UnMicst with all of its dependencies. Parallel images with and without gpu support are available.
-
-docker pull labsyspharm/unmicst:latest
-docker pull labsyspharm/unmicst:latest-gpu
-Instatiate a container and mount the input directory containing your image.
-
-docker run -it --runtime=nvidia -v /path/to/data:/data labsyspharm/unmicst:latest-gpu bash
-When using the CPU-only image, --runtime=nvidia can be omitted:
+-------
+UNMICST
+-------
 
-docker run -it -v /path/to/data:/data labsyspharm/unmicst:latest bash
-UnMicst resides in the /app directory inside the container:
-
-root@0ea0cdc46c8f:/# python app/UnMicst.py /data/input/my.tif --outputPath /data/results
-Running in a Conda environment
-
-If Docker is not available on your system, you can run the tool locally by creating a Conda environment. Ensure conda is installed on your system, then clone the repo and use conda.yml to create the environment.
-
-git clone https://github.com/HMS-IDAC/UnMicst.git
-cd UnMicst
-conda env create -f conda.yml
-conda activate unmicst
-python UnMicst.py /path/to/input.tif --outputPath /path/to/results/directory
-References:
-S Saka, Y Wang, J Kishi, A Zhu, Y Zeng, W Xie, K Kirli, C Yapp, M Cicconet, BJ Beliveau, SW Lapan, S Yin, M Lin, E Boyde, PS Kaeser, G Pihan, GM Church, P Yin, Highly multiplexed in situ protein imaging with signal amplification by Immuno-SABER, Nat Biotechnology (accepted)
-
-OHSU Wrapper Repo: https://github.com/ohsu-comp-bio/UnMicst
+**UnMICST** uses a convolutional neural network to annotate each pixel with the probability that it belongs to a given subcellular component (nucleus, cytoplasm, cell boundary). Check the UnMICST website for the most up-to-date documentation.
+**Input**
+An .ome.tif, preferably flat field corrected. The model is trained on images acquired at a pixelsize of 0.65 microns/px. If your settings differ, you can upsample/downsample to some extent.
+**Output**
+1. a .tif stack where the different probability maps for each class are concatenated in the Z-axis in the order: nuclei foreground, nuclei contours, and background.
+2. a QC image with the DNA image concatenated with the nuclei contour probability map with suffix Preview
+More infortion available at: https://labsyspharm.github.io/UnMICST-info/.
     ]]></help>
     <expand macro="citations" />
 </tool>