Mercurial > repos > bgruening > cp_common
annotate overlay_outlines.py @ 6:6070780813d9 draft default tip
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
author | bgruening |
---|---|
date | Sun, 05 Nov 2023 09:36:34 +0000 |
parents | e7273daa5ae2 |
children |
rev | line source |
---|---|
4
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
1 #!/usr/bin/env python |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
2 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
3 import argparse |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
4 import json |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
5 |
6
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
6 from cp_common_functions import (get_json_value, |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
7 get_pipeline_lines, |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
8 get_total_number_of_modules, |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
9 INDENTATION, update_module_count, |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
10 write_pipeline) |
4
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
11 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
12 MODULE_NAME = "OverlayOutlines" |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
13 OUTPUT_FILENAME = "output.cppipe" |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
14 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
15 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
16 def build_ctg_header(module_name, module_number): |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
17 """Creates the first line of a module given the name and module number""" |
6
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
18 result = "|".join( |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
19 [ |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
20 f"{module_name}:[module_num:{module_number}", |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
21 "svn_version:\\'Unknown\\'", |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
22 "variable_revision_number:4", |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
23 "show_window:True", |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
24 "notes:\\x5B\\'Overlay the embryo outlines on the grayscale image.\\'\\x5D", |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
25 "batch_state:array(\\x5B\\x5D, dtype=uint8)", |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
26 "enabled:True", |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
27 "wants_pause:False]\n", |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
28 ] |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
29 ) |
4
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
30 return result |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
31 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
32 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
33 def build_main_block(input_params): |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
34 result = f"{INDENTATION}Display outlines on a blank image?:{get_json_value(input_params,'con_blank_img.blank_img')}\n" |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
35 |
6
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
36 on_blank = get_json_value(input_params, "con_blank_img.blank_img") |
4
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
37 # defaults |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
38 img_to_display = "None" |
6
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
39 display_mode = get_json_value( |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
40 input_params, "con_blank_img.con_display_mode.display_mode" |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
41 ) |
4
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
42 method_brightness = "Max of image" |
6
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
43 howto = get_json_value(input_params, "howto_outline") |
4
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
44 outline_color = "#FF0000" |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
45 obj_to_display = "None" |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
46 |
6
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
47 name_output_img = get_json_value(input_params, "name_output_image") |
4
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
48 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
49 if on_blank == "No": |
6
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
50 img_to_display = get_json_value(input_params, "con_blank_img.image_to_outline") |
4
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
51 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
52 result += INDENTATION.join( |
6
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
53 [ |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
54 f"{INDENTATION}Select image on which to display outlines:{img_to_display}\n", |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
55 f"Name the output image:{name_output_img}\n", |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
56 f"Outline display mode:{display_mode}\n", |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
57 ] |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
58 ) |
4
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
59 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
60 if on_blank == "No" and display_mode == "Grayscale": |
6
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
61 method_brightness = get_json_value( |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
62 input_params, "con_blank_img.con_display_mode.method_brightness" |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
63 ) |
4
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
64 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
65 result += INDENTATION.join( |
6
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
66 [ |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
67 f"{INDENTATION}Select method to determine brightness of outlines:{method_brightness}\n", |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
68 f"How to outline:{howto}\n", |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
69 ] |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
70 ) |
4
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
71 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
72 obj_outline_str = "" |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
73 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
74 if display_mode == "Color": |
6
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
75 for obj in input_params["con_blank_img"]["con_display_mode"][ |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
76 "rpt_obj_to_display" |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
77 ]: |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
78 outline_color = get_json_value(obj, "outline_color") |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
79 obj_to_display = get_json_value(obj, "obj_to_display") |
4
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
80 obj_outline_str += INDENTATION.join( |
6
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
81 [ |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
82 f"{INDENTATION}Select outline color:{outline_color}\n", |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
83 f"Select objects to display:{obj_to_display}\n", |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
84 ] |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
85 ) |
4
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
86 else: # grayscale |
6
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
87 for obj in input_params["con_blank_img"]["con_display_mode"][ |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
88 "rpt_obj_to_display" |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
89 ]: |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
90 obj_to_display = get_json_value(obj, "obj_to_display") |
4
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
91 obj_outline_str += INDENTATION.join( |
6
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
92 [ |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
93 f"{INDENTATION}Select outline color:{outline_color}\n", |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
94 f"Select objects to display:{obj_to_display}\n", |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
95 ] |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
96 ) |
4
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
97 obj_outline_str = obj_outline_str.rstrip("\n") |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
98 result += f"{obj_outline_str}" |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
99 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
100 return result |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
101 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
102 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
103 if __name__ == "__main__": |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
104 parser = argparse.ArgumentParser() |
6
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
105 parser.add_argument("-p", "--pipeline", help="CellProfiler pipeline") |
6070780813d9
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
bgruening
parents:
4
diff
changeset
|
106 parser.add_argument("-i", "--inputs", help="JSON inputs from Galaxy") |
4
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
107 args = parser.parse_args() |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
108 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
109 pipeline_lines = get_pipeline_lines(args.pipeline) |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
110 inputs_galaxy = json.load(open(args.inputs, "r")) |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
111 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
112 current_module_num = get_total_number_of_modules(pipeline_lines) |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
113 current_module_num += 1 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
114 pipeline_lines = update_module_count(pipeline_lines, current_module_num) |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
115 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
116 header_block = build_ctg_header(MODULE_NAME, current_module_num) |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
117 main_block = build_main_block(inputs_galaxy) |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
118 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
119 module_pipeline = f"\n{header_block}{main_block}\n" |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
120 pipeline_lines.append(module_pipeline) |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
121 |
e7273daa5ae2
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
122 write_pipeline(OUTPUT_FILENAME, pipeline_lines) |