comparison measure_object_intensity.xml @ 0:1373b765c8f9 draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 6d73056a625002d0275b5a9a90a9fae329ce47f1"
author bgruening
date Thu, 26 Mar 2020 17:07:39 -0400
parents
children ae299f107121
comparison
equal deleted inserted replaced
-1:000000000000 0:1373b765c8f9
1 <tool id="cp_measure_object_intensity" name="MeasureObjectIntensity" version="@CP_VERSION@">
2 <description>measures several intensity features for identified objects</description>
3
4 <macros><import>macros.xml</import></macros>
5
6 <expand macro="py_requirements"/>
7 <expand macro="cmd_modules" />
8
9 <configfiles>
10 <inputs name="inputs" />
11 <configfile name="script_file">
12 import json
13 import sys
14 import os
15
16 FOURSPACES=@SPACES@
17
18 input_json_path = sys.argv[1]
19 input_pipeline= sys.argv[2]
20
21 params = json.load(open(input_json_path, "r"))
22
23 def writemoi():
24 _str = "\nMeasureObjectIntensity:[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
25
26 hidden = len(params['rpt_image'])
27
28 _str += FOURSPACES + "Hidden:%d\n" % hidden
29
30 for img in params['rpt_image']:
31 _str += FOURSPACES + "Select an image to measure:%s\n" % img['image_to_measure']
32
33 for obj in params['rpt_object']:
34 _str += FOURSPACES + "Select objects to measure:%s\n" % obj['objects_to_measure']
35
36 return _str
37
38
39 with open(input_pipeline) as fin:
40 lines = fin.readlines()
41
42 k, v = lines[4].strip().split(':')
43
44 module_count = int(v)
45 new_count = module_count + 1
46 lines[4] = k + ":%d\n" % new_count
47 with open("output", "w") as f:
48 f.writelines(lines)
49 f.write(writemoi())
50
51 f.close()
52 </configfile>
53 </configfiles>
54
55 <inputs>
56 <expand macro="input_pipeline_macro" />
57 <repeat name="rpt_image" title="Add another image">
58 <param name="image_to_measure" label="Select an image to measure" type="text">
59 <expand macro="text_validator" />
60 </param>
61 </repeat>
62
63 <repeat name="rpt_object" title="Add another object">
64 <param name="objects_to_measure" label="Select objects to measure" type="text" >
65 <expand macro="text_validator" />
66 </param>
67 </repeat>
68 </inputs>
69
70 <outputs>
71 <expand macro="output_pipeline_macro" />
72 </outputs>
73
74 <tests>
75 <test>
76 <expand macro="test_input_pipeline_param" />
77 <repeat name="rpt_image">
78 <param name="image_to_measure" value="DNA"/>
79 </repeat>
80 <repeat name="rpt_object" >
81 <param name="objects_to_measure" value="Nuclei" />
82 </repeat>
83 <expand macro="test_out_file" file="measure_object_intensity.txt" />
84 </test>
85 </tests>
86
87 <expand macro="help" module="MeasureObjectIntensity" />
88 <expand macro="citations" />
89
90 </tool>