Mercurial > repos > bgruening > cp_enhance_or_suppress_features
annotate tile.py @ 4:f2ed92b011a9 draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
| author | bgruening | 
|---|---|
| date | Sat, 06 Feb 2021 10:06:59 +0000 | 
| parents | |
| children | 11f177b1a59e | 
| rev | line source | 
|---|---|
| 
4
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
1 #!/usr/bin/env python | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
2 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
3 import argparse | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
4 import json | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
5 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
6 from cp_common_functions import get_json_value | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
7 from cp_common_functions import get_pipeline_lines | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
8 from cp_common_functions import get_total_number_of_modules | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
9 from cp_common_functions import INDENTATION | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
10 from cp_common_functions import update_module_count | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
11 from cp_common_functions import write_pipeline | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
12 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
13 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
14 MODULE_NAME = "Tile" | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
15 OUTPUT_FILENAME = "output.cppipe" | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
16 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
17 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
18 def build_header(module_name, module_number): | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
19 result = "|".join([f"{module_name}:[module_num:{module_number}", | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
20 "svn_version:\\'Unknown\\'", | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
21 "variable_revision_number:1", | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
22 "show_window:True", | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
23 "notes:\\x5B\\'Tile the original color image, the outlined image and the image of tracked labels together.\\'\\x5D", | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
24 "batch_state:array(\\x5B\\x5D, dtype=uint8)", | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
25 "enabled:True", | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
26 "wants_pause:False]\n"]) | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
27 return result | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
28 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
29 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
30 def build_main_block(input_params): | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
31 result = INDENTATION.join([f"{INDENTATION}Select an input image:{get_json_value(input_params,'input_image')}\n", | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
32 f"Name the output image:{get_json_value(input_params,'output_image_name')}\n", | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
33 f"Tile assembly method:{get_json_value(input_params,'con_assembly_method.assembly_method')}\n" | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
34 ]) | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
35 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
36 calc_rows = get_json_value(input_params, 'con_assembly_method.con_calc_no_row.calc_no_row') | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
37 no_of_rows = 8 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
38 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
39 calc_cols = get_json_value(input_params, 'con_assembly_method.con_calc_no_cols.calc_no_cols') | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
40 no_of_cols = 12 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
41 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
42 if calc_rows == "No": | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
43 no_of_rows = get_json_value(input_params, 'con_assembly_method.con_calc_no_row.no_of_row') | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
44 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
45 if calc_cols == "No": | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
46 no_of_cols = get_json_value(input_params, 'con_assembly_method.con_calc_no_cols.no_of_cols') | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
47 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
48 corner_to_begin = get_json_value(input_params, 'con_assembly_method.corner_to_begin') | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
49 direction_tiling = get_json_value(input_params, 'con_assembly_method.direction') | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
50 meander = get_json_value(input_params, 'con_assembly_method.meander_mode') | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
51 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
52 assembly_method = get_json_value(input_params, 'con_assembly_method.assembly_method') | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
53 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
54 result += INDENTATION.join( | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
55 [f"{INDENTATION}Final number of rows:{str(no_of_rows)}\n", | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
56 f"Final number of columns:{str(no_of_cols)}\n", | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
57 f"Image corner to begin tiling:{corner_to_begin}\n", | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
58 f"Direction to begin tiling:{direction_tiling}\n", | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
59 f"Use meander mode?:{meander}\n", | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
60 f"Automatically calculate number of rows?:{calc_rows}\n", | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
61 f"Automatically calculate number of columns?:{calc_cols}\n" | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
62 ]) | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
63 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
64 if assembly_method == "Within cycles": | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
65 additionals = input_params['con_assembly_method']['rpt_additional_image'] | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
66 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
67 for img in additionals: | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
68 result += INDENTATION.join( | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
69 [f"{INDENTATION}Select an additional image to tile:{get_json_value(img, 'additional_img')}\n" | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
70 ]) | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
71 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
72 return result | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
73 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
74 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
75 if __name__ == "__main__": | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
76 parser = argparse.ArgumentParser() | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
77 parser.add_argument( | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
78 '-p', '--pipeline', | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
79 help='CellProfiler pipeline' | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
80 ) | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
81 parser.add_argument( | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
82 '-i', '--inputs', | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
83 help='JSON inputs from Galaxy' | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
84 ) | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
85 args = parser.parse_args() | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
86 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
87 pipeline_lines = get_pipeline_lines(args.pipeline) | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
88 inputs_galaxy = json.load(open(args.inputs, "r")) | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
89 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
90 current_module_num = get_total_number_of_modules(pipeline_lines) | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
91 current_module_num += 1 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
92 pipeline_lines = update_module_count(pipeline_lines, current_module_num) | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
93 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
94 header_block = build_header(MODULE_NAME, current_module_num) | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
95 main_block = build_main_block(inputs_galaxy) | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
96 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
97 module_pipeline = f"\n{header_block}{main_block}\n" | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
98 pipeline_lines.append(module_pipeline) | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
99 | 
| 
 
f2ed92b011a9
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
100 write_pipeline(OUTPUT_FILENAME, pipeline_lines) | 
