Mercurial > repos > perssond > unmicst
comparison unmicst.xml @ 0:6bec4fef6b2e draft
"planemo upload for repository https://github.com/ohsu-comp-bio/unmicst commit 73e4cae15f2d7cdc86719e77470eb00af4b6ebb7-dirty"
author | perssond |
---|---|
date | Fri, 12 Mar 2021 00:17:29 +0000 |
parents | |
children | 74fe58ff55a5 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:6bec4fef6b2e |
---|---|
1 <tool id="unmicst" name="UnMicst" version="@VERSION@.1" profile="17.09"> | |
2 <description>UNet Model for Identifying Cells and Segmenting Tissue</description> | |
3 <macros> | |
4 <import>macros.xml</import> | |
5 </macros> | |
6 | |
7 <expand macro="requirements"/> | |
8 @VERSION_CMD@ | |
9 | |
10 <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 | |
13 ln -s $image '$typeCorrected'; | |
14 | |
15 @CMD_BEGIN@ '$typeCorrected' | |
16 | |
17 #if $stackoutput | |
18 --stackOutput | |
19 #end if | |
20 | |
21 --outputPath `pwd` | |
22 --channel $channel | |
23 --model $model | |
24 --mean $mean | |
25 --std $stdev | |
26 --scalingFactor $scalingfactor; | |
27 | |
28 ## Move files to different files for from_work_dir differentiation | |
29 #if $stackoutput | |
30 mv *Probabilities*.tif Probabilities.tif; | |
31 mv *Preview*.tif Preview.tif | |
32 #else | |
33 mv *ContoursPM*.tif ContoursPM.tif; | |
34 mv *NucleiPM*.tif NucleiPM.tif | |
35 #end if | |
36 ]]></command> | |
37 | |
38 <inputs> | |
39 <param name="image" type="data" format="tiff" label="Registered TIFF"/> | |
40 <param name="model" type="select" label="Model"> | |
41 <option value="nucleiDAPI">nucleiDAPI</option> | |
42 <option value="mousenucleiDAPI">mousenucleiDAPI</option> | |
43 <option value="CytoplasmIncell">CytoplasmIncell</option> | |
44 <option value="CytoplasmZeissNikon">CytoplasmZeissNikon</option> | |
45 </param> | |
46 <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)"/> | |
48 <param name="channel" type="integer" value="0" label="Channel to perform inference on"/> | |
49 <param name="stackoutput" type="boolean" label="Stack probability map outputs"/> | |
50 <param name="scalingfactor" type="float" value="1.0" label="Factor to scale by"/> | |
51 </inputs> | |
52 | |
53 <outputs> | |
54 <data format="tiff" name="previews" from_work_dir="Preview.tif" label="${tool.name} on ${on_string}: Preview"> | |
55 <filter>stackoutput</filter> | |
56 </data> | |
57 <data format="tiff" name="probabilities" from_work_dir="Probabilities.tif" label="${tool.name} on ${on_string}: Probabilities"> | |
58 <filter>stackoutput</filter> | |
59 </data> | |
60 <data format="tiff" name="contours" from_work_dir="ContoursPM.tif" label="${tool.name} on ${on_string}: ContoursPM"> | |
61 <filter>not stackoutput</filter> | |
62 </data> | |
63 <data format="tiff" name="nuclei" from_work_dir="NucleiPM.tif" label="${tool.name} on ${on_string}: NucleiPM"> | |
64 <filter>not stackoutput</filter> | |
65 </data> | |
66 </outputs> | |
67 <help><![CDATA[ | |
68 UnMicst - UNet Model for Identifying Cells and Segmenting Tissue | |
69 Image Preprocessing | |
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. | |
71 | |
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. | |
73 | |
74 Running as a Docker container | |
75 | |
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. | |
77 | |
78 docker pull labsyspharm/unmicst:latest | |
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> | |
103 <expand macro="citations" /> | |
104 </tool> |