-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockstore.wdl
92 lines (81 loc) · 3.46 KB
/
Dockstore.wdl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
## Copyright Parker Institute for Cancer Immunotherapy, 2021
##
## # Mesmer segmentation
##
## Workflow for running mesmer segmentation of tiff images
##
## ### Inputs
## multi_tiff: multi-layer tiff file to be segmented
## nuc_channel_ids: list of channels to combine/collapse for nuclear signal, json string (i.e. "[1, 2, 3]")
## wc_channel_ids: list of channels to combine/collapse for membrane signal, json string (i.e. "[1, 2, 3]")
## run_wc: boolean indicating whether whole cell segmentation should be run (default false)
## NOTE: use of "run_wc" requires a wc_channel_ids argument
## sample_id: ID of the sample
## rename_to_sampleid: resulting mask files are renamed to the provided sample ID (default false)
##
## mem_gb: Gb of memory to provision for the mesmer worker
## mesmer_docker_image: docker image that includes the mesmer tool
## tiff_tools_docker_image: docker image that includes combine/collapse tiff tool
##
## Maintainer: Marshall Thompson ([email protected])
##
## Github: [https://github.com/ParkerICI/mesmer-wdl-workflow](https://github.com/ParkerICI/mesmer-wdl-workflow)
##
## Licensing :
## This script is released under the PICI Informatics License (GPL-3.0) Note however that the programs it calls may
## be subject to different licenses. Users are responsible for checking that they are
## authorized to run all programs before running this script.
import "https://raw.githubusercontent.com/ParkerICI/mesmer-wdl-workflow/master/mesmerSeg.wdl" as mesmer
import "https://raw.githubusercontent.com/ParkerICI/mesmer-wdl-workflow/master/collapseChannels.wdl" as tifftools
workflow segmentation {
File multi_tiff
String nuc_channel_ids
String? wc_channel_ids
Boolean? run_wc = false
Boolean? rename_to_sampleid = false
String? sample_id
Int mem_gb = 4
String mesmer_docker_image = "vanvalenlab/deepcell-applications:0.3.1"
String tiff_tools_docker_image = "gcr.io/pici-internal/tiff-tools"
String nuc_outfile = if !rename_to_sampleid then "combined.tif" else (sample_id + "_combined.tif")
String nuc_mask_name = if !rename_to_sampleid then "nuc_mask.tif" else (sample_id + "_nuc_mask.tif")
call tifftools.collapse as nucCollapse {
input:
multi_tiff=multi_tiff,
mem_gb=mem_gb,
docker_image=tiff_tools_docker_image,
channel_ids=nuc_channel_ids,
outfile=nuc_outfile
}
call mesmer.mesmer_nuc as mesmerNuc {
input:
flat_nuc=nucCollapse.combined_tiff,
mem_gb=mem_gb,
mask_name=nuc_mask_name,
docker_image=mesmer_docker_image
}
if(run_wc == true){
String wc_outfile = if !rename_to_sampleid then "combined.tif" else (sample_id + "_combined.tif")
String wc_mask_name = if !rename_to_sampleid then "wc_mask.tif" else (sample_id + "_wc_mask.tif")
call tifftools.collapse as wcCollapse {
input:
multi_tiff=multi_tiff,
mem_gb=mem_gb,
docker_image=tiff_tools_docker_image,
channel_ids=wc_channel_ids,
outfile=wc_outfile
}
call mesmer.mesmer_wc as mesmerWC {
input:
flat_nuc=nucCollapse.combined_tiff,
flat_cyto=wcCollapse.combined_tiff,
mem_gb=mem_gb,
mask_name=wc_mask_name,
docker_image=mesmer_docker_image
}
}
output {
File nuc_mask = mesmerNuc.cell_mask
File? wc_mask = mesmerWC.cell_mask
}
}