-
Notifications
You must be signed in to change notification settings - Fork 265
Expand file tree
/
Copy pathidentify_tertiary_objects.xml
More file actions
109 lines (82 loc) · 3.5 KB
/
identify_tertiary_objects.xml
File metadata and controls
109 lines (82 loc) · 3.5 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<tool id="cp_identify_tertiary_objects" name="IdentifyTertiarxObjects" version="@CP_VERSION@+galaxy@VERSION_SUFFIX@">
<description>with CellProfiler</description>
<macros>
<import>macros.xml</import>
<token name="@VERSION_SUFFIX@">2</token>
</macros>
<edam_operations>
<edam_operation>operation_3443</edam_operation>
</edam_operations>
<xrefs>
<xref type="bio.tools">CellProfiler</xref>
<xref type="biii">cellprofiler</xref>
</xrefs>
<expand macro="py_requirements"/>
<expand macro="cmd_modules" />
<configfiles>
<inputs name="inputs" />
<configfile name="script_file">
import json
import sys
import os
FOURSPACES=@SPACES@
input_json_path = sys.argv[1]
input_pipeline= sys.argv[2]
params = json.load(open(input_json_path, "r"))
def writemoi():
_str = "\nIdentifyTertiaryObjects:[module_num:%d|svn_version:\\'Unknown\\'|variable_revision_number:3|show_window:False|notes:\\x5B\\x5D|batch_state:array(\\x5B\\x5D, dtype=uint8)|enabled:True|wants_pause:False]\n" % new_count
_str += FOURSPACES + "Select the larger identified objects:%s\n" % params['larger_identify_object']
_str += FOURSPACES + "Select the smaller identified objects:%s\n" % params['smaller_identify_object']
_str += FOURSPACES + "Name the tertiary objects to be identified:%s\n" % params['tertiary_object']
_str += FOURSPACES + "Shrink smaller object prior to subtraction?%s\n" % params['shrink_objects']
return _str
with open(input_pipeline) as fin:
lines = fin.readlines()
k, v = lines[4].strip().split(':')
module_count = int(v)
new_count = module_count + 1
lines[4] = k + ":%d\n" % new_count
with open("output.cppipe", "w") as f:
f.writelines(lines)
f.write(writemoi())
f.close()
</configfile>
</configfiles>
<inputs>
<expand macro="input_pipeline_param" />
<param name="larger_identify_object" label="Select the larger identified objects" type="text">
<expand macro="text_validator" />
</param>
<param name="smaller_identify_object" label="Select the smaller identified objects" type="text">
<expand macro="text_validator" />
</param>
<param name="tertiary_object" label="Name the tertiary objects to be identified" type="text">
<expand macro="text_validator" />
</param>
<param name="shrink_objects" label=" Shrink smaller object prior to subtraction?" type="select">
<option value="Yes">Yes</option>
<option value="No">No</option>
</param>
</inputs>
<outputs>
<expand macro="output_pipeline_param" />
</outputs>
<tests>
<test>
<expand macro="test_input_pipeline_param" />
<param name="larger_identify_object" value="Cells" />
<param name="smaller_identify_object" value="Nuclei" />
<param name="tertiary_object" value="Cytoplasm" />
<param name="shrink_objects" value="Yes" />
<expand macro="test_out_file" file="measure_object_intensity.cppipe" />
</test>
</tests>
<help>
<![CDATA[
.. class:: infomark
**What it does**
identifies tertiary objects (e.g., cytoplasm) by removing smaller primary objects (e.g. nuclei) from larger secondary objects (e.g., cells), leaving a ring shape.
]]>
</help>
<expand macro="citations" />
</tool>