Mercurial > repos > perssond > unmicst
comparison 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 |
comparison
equal
deleted
inserted
replaced
0:6bec4fef6b2e | 1:74fe58ff55a5 |
---|---|
1 <tool id="unmicst" name="UnMicst" version="@VERSION@.1" profile="17.09"> | 1 <tool id="unmicst" name="UnMicst" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="19.01"> |
2 <description>UNet Model for Identifying Cells and Segmenting Tissue</description> | 2 <description>Image segmentation - probability map generation</description> |
3 | |
3 <macros> | 4 <macros> |
4 <import>macros.xml</import> | 5 <import>macros.xml</import> |
5 </macros> | 6 </macros> |
6 | 7 |
7 <expand macro="requirements"/> | 8 <expand macro="requirements"/> |
8 @VERSION_CMD@ | 9 <expand macro="version_cmd"/> |
9 | 10 |
10 <command detect_errors="exit_code"><![CDATA[ | 11 <command detect_errors="exit_code"><![CDATA[ |
11 #set $typeCorrected = str($image.name).replace('.ome.tiff','').replace('.ome.tif','').replace('.tiff','').replace('.tif','')+'.ome.tif' | 12 #set $ext = str($image.file_ext) |
13 #if $ext == 'tiff' | |
14 #set $ext = 'tif' | |
15 #end if | |
16 #set $input = 'image.' + str($ext) | |
12 | 17 |
13 ln -s $image '$typeCorrected'; | 18 ln -s '$image' '$input' && |
19 | |
20 @CMD_BEGIN@ '$input' | |
14 | 21 |
15 @CMD_BEGIN@ '$typeCorrected' | 22 --tool $tool |
16 | 23 |
17 #if $stackoutput | 24 #if $stackoutput |
18 --stackOutput | 25 --stackOutput |
19 #end if | 26 #end if |
20 | 27 |
21 --outputPath `pwd` | 28 --outputPath '.' |
22 --channel $channel | 29 --channel $channel |
23 --model $model | 30 --model $model |
24 --mean $mean | 31 --mean $mean |
25 --std $stdev | 32 --std $stdev |
26 --scalingFactor $scalingfactor; | 33 --scalingFactor $scalingfactor |
34 --outlier $outlier && | |
27 | 35 |
28 ## Move files to different files for from_work_dir differentiation | 36 ## Move files to different files for from_work_dir differentiation |
29 #if $stackoutput | 37 #if $stackoutput |
30 mv *Probabilities*.tif Probabilities.tif; | 38 mv *Probabilities*.tif Probabilities.tif && |
31 mv *Preview*.tif Preview.tif | 39 mv qc/*Preview*.tif Preview.tif |
32 #else | 40 #else |
33 mv *ContoursPM*.tif ContoursPM.tif; | 41 mv *ContoursPM*.tif ContoursPM.tif && |
34 mv *NucleiPM*.tif NucleiPM.tif | 42 mv *NucleiPM*.tif NucleiPM.tif |
35 #end if | 43 #end if |
36 ]]></command> | 44 ]]></command> |
37 | 45 |
38 <inputs> | 46 <inputs> |
47 <param name="tool" type="select" label="UnMicst Tool"> | |
48 <option selected="true" value="unmicst-solo">unmicst-solo</option> | |
49 <option value="unmicst-duo">unmicst-duo</option> | |
50 <option value="unmicst-legacy">unmicst-legacy</option> | |
51 <option value="UnMicstCyto2">UnMicstCyto2</option> | |
52 </param> | |
39 <param name="image" type="data" format="tiff" label="Registered TIFF"/> | 53 <param name="image" type="data" format="tiff" label="Registered TIFF"/> |
40 <param name="model" type="select" label="Model"> | 54 <param name="model" type="select" label="Model"> |
41 <option value="nucleiDAPI">nucleiDAPI</option> | 55 <option value="nucleiDAPI">nucleiDAPI</option> |
56 <option value="CytoplasmIncell">CytoplasmIncell</option> | |
57 <option value="CytoplasmIncell2">CytoplasmIncell2</option> | |
58 <option value="CytoplasmZeissNikon">CytoplasmZeissNikon</option> | |
42 <option value="mousenucleiDAPI">mousenucleiDAPI</option> | 59 <option value="mousenucleiDAPI">mousenucleiDAPI</option> |
43 <option value="CytoplasmIncell">CytoplasmIncell</option> | 60 <option value="nucleiDAPI1-5">nucleiDAPI1-5</option> |
44 <option value="CytoplasmZeissNikon">CytoplasmZeissNikon</option> | 61 <option value="nucleiDAPILAMIN">nucleiDAPILAMIN</option> |
45 </param> | 62 </param> |
46 <param name="mean" type="float" value="-1" label="Mean (-1 for model default)"/> | 63 <param name="mean" type="float" value="-1" label="Mean (-1 for model default)"/> |
47 <param name="stdev" type="float" value="-1" label="Standard Deviation (-1 for model default)"/> | 64 <param name="stdev" type="float" value="-1" label="Standard Deviation (-1 for model default)"/> |
48 <param name="channel" type="integer" value="0" label="Channel to perform inference on"/> | 65 <param name="channel" type="integer" value="0" label="Channel to perform inference on"/> |
49 <param name="stackoutput" type="boolean" label="Stack probability map outputs"/> | 66 <param name="stackoutput" type="boolean" label="Stack probability map outputs"/> |
50 <param name="scalingfactor" type="float" value="1.0" label="Factor to scale by"/> | 67 <param name="scalingfactor" type="float" value="1.0" label="Factor to scale by"/> |
68 <param name="outlier" type="float" value="-1.0" label="Map percentile intensity to max when rescaling intensity values"/> | |
51 </inputs> | 69 </inputs> |
52 | 70 |
53 <outputs> | 71 <outputs> |
54 <data format="tiff" name="previews" from_work_dir="Preview.tif" label="${tool.name} on ${on_string}: Preview"> | 72 <data format="tiff" name="previews" from_work_dir="Preview.tif" label="${tool.name} on ${on_string}: Preview"> |
55 <filter>stackoutput</filter> | 73 <filter>stackoutput</filter> |
62 </data> | 80 </data> |
63 <data format="tiff" name="nuclei" from_work_dir="NucleiPM.tif" label="${tool.name} on ${on_string}: NucleiPM"> | 81 <data format="tiff" name="nuclei" from_work_dir="NucleiPM.tif" label="${tool.name} on ${on_string}: NucleiPM"> |
64 <filter>not stackoutput</filter> | 82 <filter>not stackoutput</filter> |
65 </data> | 83 </data> |
66 </outputs> | 84 </outputs> |
85 <tests> | |
86 <test expect_num_outputs="2"> | |
87 <param name="image" value="105.tif" ftype="tiff" /> | |
88 <param name="model" value="nucleiDAPI" /> | |
89 <param name="tool" value="unmicst-legacy"/> | |
90 <param name="channel" value="1"/> | |
91 <output name="nuclei" file="105_NucleiPM_1.tif" compare="sim_size" delta="10" /> | |
92 <output name="contours" file="105_ContoursPM_1.tif" compare="sim_size" delta="10" /> | |
93 </test> | |
94 </tests> | |
67 <help><![CDATA[ | 95 <help><![CDATA[ |
68 UnMicst - UNet Model for Identifying Cells and Segmenting Tissue | 96 ------- |
69 Image Preprocessing | 97 UNMICST |
70 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. | 98 ------- |
71 | 99 |
72 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. | 100 **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. |
73 | 101 **Input** |
74 Running as a Docker container | 102 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. |
75 | 103 **Output** |
76 The docker image is distributed through Dockerhub and includes UnMicst with all of its dependencies. Parallel images with and without gpu support are available. | 104 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. |
77 | 105 2. a QC image with the DNA image concatenated with the nuclei contour probability map with suffix Preview |
78 docker pull labsyspharm/unmicst:latest | 106 More infortion available at: https://labsyspharm.github.io/UnMICST-info/. |
79 docker pull labsyspharm/unmicst:latest-gpu | |
80 Instatiate a container and mount the input directory containing your image. | |
81 | |
82 docker run -it --runtime=nvidia -v /path/to/data:/data labsyspharm/unmicst:latest-gpu bash | |
83 When using the CPU-only image, --runtime=nvidia can be omitted: | |
84 | |
85 docker run -it -v /path/to/data:/data labsyspharm/unmicst:latest bash | |
86 UnMicst resides in the /app directory inside the container: | |
87 | |
88 root@0ea0cdc46c8f:/# python app/UnMicst.py /data/input/my.tif --outputPath /data/results | |
89 Running in a Conda environment | |
90 | |
91 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. | |
92 | |
93 git clone https://github.com/HMS-IDAC/UnMicst.git | |
94 cd UnMicst | |
95 conda env create -f conda.yml | |
96 conda activate unmicst | |
97 python UnMicst.py /path/to/input.tif --outputPath /path/to/results/directory | |
98 References: | |
99 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) | |
100 | |
101 OHSU Wrapper Repo: https://github.com/ohsu-comp-bio/UnMicst | |
102 ]]></help> | 107 ]]></help> |
103 <expand macro="citations" /> | 108 <expand macro="citations" /> |
104 </tool> | 109 </tool> |