Mercurial > repos > bgruening > cp_measure_object_size_shape
comparison measure_object_size_shape.xml @ 0:eba2ec72f967 draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 6d73056a625002d0275b5a9a90a9fae329ce47f1"
author | bgruening |
---|---|
date | Thu, 26 Mar 2020 17:45:13 -0400 |
parents | |
children | 5ef26243a4a5 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:eba2ec72f967 |
---|---|
1 <tool id="cp_measure_object_size_shape" name="MeasureObjectSizeShape" version="@CP_VERSION@"> | |
2 <description>measures several area and shape features of identified objects</description> | |
3 | |
4 <macros> | |
5 <import>macros.xml</import> | |
6 </macros> | |
7 | |
8 <expand macro="py_requirements"/> | |
9 <expand macro="cmd_modules" /> | |
10 | |
11 <configfiles> | |
12 <inputs name="inputs" /> | |
13 <configfile name="script_file"> | |
14 import json | |
15 import sys | |
16 import os | |
17 | |
18 FOURSPACES=@SPACES@ | |
19 | |
20 input_json_path = sys.argv[1] | |
21 input_pipeline= sys.argv[2] | |
22 | |
23 params = json.load(open(input_json_path, "r")) | |
24 | |
25 | |
26 def writemoss(): | |
27 _str = "\nMeasureObjectSizeShape:[module_num:%d|svn_version:\\'Unknown\\'|variable_revision_number:1|show_window:False|notes:\\x5B\\x5D|batch_state:array(\\x5B\\x5D, dtype=uint8)|enabled:True|wants_pause:False]\n" % new_count | |
28 | |
29 for obj in params['rpt_object']: | |
30 _str += FOURSPACES + "Select objects to measure:%s\n" % obj['objects_to_measure'] | |
31 | |
32 _str += FOURSPACES + "Calculate the Zernike features?:%s\n" % params['zernike_feature'] | |
33 | |
34 return _str | |
35 | |
36 with open(input_pipeline) as fin: | |
37 lines = fin.readlines() | |
38 | |
39 k, v = lines[4].strip().split(':') | |
40 | |
41 module_count = int(v) | |
42 new_count = module_count + 1 | |
43 lines[4] = k + ":%d\n" % new_count | |
44 with open("output", "w") as f: | |
45 f.writelines(lines) | |
46 f.write(writemoss()) | |
47 | |
48 f.close() | |
49 </configfile> | |
50 </configfiles> | |
51 | |
52 <inputs> | |
53 <expand macro="input_pipeline_macro" /> | |
54 <repeat name="rpt_object" title="Add another object"> | |
55 <param name="objects_to_measure" label="Select objects to measure" type="text" > | |
56 <expand macro="text_validator" /> | |
57 </param> | |
58 </repeat> | |
59 <param name="zernike_feature" type="select" display="radio" label="Calculate the Zernike features?"> | |
60 <option value="Yes">Yes</option> | |
61 <option value="No">No</option> | |
62 </param> | |
63 </inputs> | |
64 | |
65 <outputs> | |
66 <expand macro="output_pipeline_macro" /> | |
67 </outputs> | |
68 | |
69 <tests> | |
70 <test> | |
71 <expand macro="test_input_pipeline_param" /> | |
72 <repeat name="rpt_object"> | |
73 <param name="objects_to_measure" value="Nuclei" /> | |
74 </repeat> | |
75 <repeat name="rpt_object"> | |
76 <param name="objects_to_measure" value="Nucleoli" /> | |
77 </repeat> | |
78 <param name="zernike_feature" value="Yes" /> | |
79 <expand macro="test_out_file" file="measure_object_size_shape.txt" /> | |
80 </test> | |
81 </tests> | |
82 | |
83 <expand macro="help" module="MeasureObjectSizeShape" /> | |
84 <expand macro="citations" /> | |
85 | |
86 </tool> |