Mercurial > repos > bgruening > cp_mask_image
annotate track_objects.py @ 4:3a05117669cf draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
author | bgruening |
---|---|
date | Sat, 06 Feb 2021 10:02:20 +0000 |
parents | |
children | b178453ea8d1 |
rev | line source |
---|---|
4
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
1 #!/usr/bin/env python |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
2 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
3 import argparse |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
4 import json |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
5 |
3a05117669cf
"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 |
3a05117669cf
"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 |
3a05117669cf
"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 |
3a05117669cf
"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 |
3a05117669cf
"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 |
3a05117669cf
"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 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
12 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
13 MODULE_NAME = "TrackObjects" |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
14 OUTPUT_FILENAME = "output.cppipe" |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
15 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
16 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
17 def build_header(module_name, module_number): |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
18 result = "|".join([f"{module_name}:[module_num:{module_number}", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
19 "svn_version:\\'Unknown\\'", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
20 "variable_revision_number:7", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
21 "show_window:True", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
22 "notes:\\x5B\\'Track the embryos across images using the Overlap method\\x3A tracked objects are identified by the amount of frame-to-frame overlap. Save an image of embryos labeled with a unique number across time.\\'\\x5D", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
23 "batch_state:array(\\x5B\\x5D, dtype=uint8)", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
24 "enabled:True", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
25 "wants_pause:False]\n"]) |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
26 return result |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
27 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
28 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
29 def build_main_block(input_params): |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
30 result = INDENTATION.join([f"{INDENTATION}Choose a tracking method:{get_json_value(input_params,'con_tracking_method.tracking_method')}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
31 f"Select the objects to track:{get_json_value(input_params,'object_to_track')}\n" |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
32 ]) |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
33 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
34 tracking_method = get_json_value(input_params, 'con_tracking_method.tracking_method') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
35 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
36 obj_measurement = "None" # default value |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
37 if tracking_method == "Measurements": |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
38 measurement_category = get_json_value(input_params, 'con_tracking_method.con_measurement_category.measurement_category') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
39 measurement = get_json_value(input_params, 'con_tracking_method.con_measurement_category.measurement') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
40 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
41 if measurement_category == "Intensity" or measurement_category == "Location": |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
42 img_measure = get_json_value(input_params, 'con_tracking_method.con_measurement_category.img_measure') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
43 obj_measurement = f"{measurement_category}_{measurement}_{img_measure}" |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
44 else: |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
45 obj_measurement = f"{measurement_category}_{measurement}" |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
46 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
47 result += INDENTATION.join([f"{INDENTATION}Select object measurement to use for tracking:{obj_measurement}\n"]) |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
48 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
49 if tracking_method == "LAP": # no max distance required, set default for pipeline |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
50 max_distance = 50 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
51 else: |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
52 max_distance = get_json_value(input_params, 'con_tracking_method.max_distance') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
53 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
54 result += INDENTATION.join([f"{INDENTATION}Maximum pixel distance to consider matches:{max_distance}\n"]) |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
55 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
56 display_option = get_json_value(input_params, 'con_tracking_method.display_option') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
57 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
58 output_img_name = "TrackedCells" # default value, required by cppipe regardless of its presence in UI |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
59 save = get_json_value(input_params, 'con_tracking_method.con_save_coded_img.save_coded_img') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
60 if save == "Yes": |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
61 output_img_name = get_json_value(input_params, 'con_tracking_method.con_save_coded_img.name_output_img') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
62 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
63 result += INDENTATION.join( |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
64 [f"{INDENTATION}Select display option:{display_option}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
65 f"Save color-coded image?:{save}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
66 f"Name the output image:{output_img_name}\n" |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
67 ]) |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
68 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
69 # LAP method default values |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
70 movement_model = "Both" |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
71 no_std = 3.0 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
72 radius_limit_max = 10.0 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
73 radius_limit_min = 2.0 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
74 radius = "2.0,10.0" |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
75 run_second = "Yes" |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
76 gap_closing = 40 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
77 split_alt = 40 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
78 merge_alt = 40 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
79 max_gap_displacement = 5 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
80 max_split = 50 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
81 max_merge = 50 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
82 max_temporal = 5 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
83 max_mitosis_dist = 40 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
84 mitosis_alt = 80 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
85 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
86 # LAP method |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
87 if tracking_method == "LAP": |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
88 movement_model = get_json_value(input_params, 'con_tracking_method.movement_method') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
89 no_std = get_json_value(input_params, 'con_tracking_method.no_std_radius') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
90 radius_limit_max = get_json_value(input_params, 'con_tracking_method.max_radius') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
91 radius_limit_min = get_json_value(input_params, 'con_tracking_method.min_radius') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
92 radius = f"{radius_limit_min},{radius_limit_max}" |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
93 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
94 run_second = get_json_value(input_params, 'con_tracking_method.con_second_lap.second_lap') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
95 if run_second == "Yes": |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
96 gap_closing = get_json_value(input_params, 'con_tracking_method.con_second_lap.gap_closing') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
97 split_alt = get_json_value(input_params, 'con_tracking_method.con_second_lap.split_alt') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
98 merge_alt = get_json_value(input_params, 'con_tracking_method.con_second_lap.merge_alt') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
99 max_gap_displacement = get_json_value(input_params, 'con_tracking_method.con_second_lap.max_gap_displacement') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
100 max_split = get_json_value(input_params, 'con_tracking_method.con_second_lap.max_split') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
101 max_merge = get_json_value(input_params, 'con_tracking_method.con_second_lap.max_merge') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
102 max_temporal = get_json_value(input_params, 'con_tracking_method.con_second_lap.max_temporal') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
103 max_mitosis_dist = get_json_value(input_params, 'con_tracking_method.con_second_lap.max_mitosis_distance') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
104 mitosis_alt = get_json_value(input_params, 'con_tracking_method.con_second_lap.mitosis_alt') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
105 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
106 result += INDENTATION.join( |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
107 [f"{INDENTATION}Select the movement model:{movement_model}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
108 f"Number of standard deviations for search radius:{no_std}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
109 f"Search radius limit, in pixel units (Min,Max):{radius}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
110 f"Run the second phase of the LAP algorithm?:{run_second}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
111 f"Gap closing cost:{gap_closing}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
112 f"Split alternative cost:{split_alt}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
113 f"Merge alternative cost:{merge_alt}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
114 f"Maximum gap displacement, in pixel units:{max_gap_displacement}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
115 f"Maximum split score:{max_split}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
116 f"Maximum merge score:{max_merge}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
117 f"Maximum temporal gap, in frames:{max_temporal}\n" |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
118 ]) |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
119 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
120 # common section |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
121 filter_by_lifetime = get_json_value(input_params, 'con_tracking_method.con_filter_by_lifetime.filter_by_lifetime') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
122 use_min = "Yes" # default |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
123 min_life = 1 # default |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
124 use_max = "No" # default |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
125 max_life = 100 # default |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
126 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
127 if filter_by_lifetime == "Yes": |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
128 use_min = get_json_value(input_params, 'con_tracking_method.con_filter_by_lifetime.con_use_min.use_min') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
129 if use_min == "Yes": |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
130 min_life = get_json_value(input_params, 'con_tracking_method.con_filter_by_lifetime.con_use_min.min_lifetime') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
131 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
132 use_max = get_json_value(input_params, 'con_tracking_method.con_filter_by_lifetime.con_use_max.use_max') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
133 if use_max == "Yes": |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
134 max_life = get_json_value(input_params, 'con_tracking_method.con_filter_by_lifetime.con_use_max.max_lifetime') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
135 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
136 result += INDENTATION.join( |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
137 [f"{INDENTATION}Filter objects by lifetime?:{filter_by_lifetime}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
138 f"Filter using a minimum lifetime?:{use_min}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
139 f"Minimum lifetime:{min_life}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
140 f"Filter using a maximum lifetime?:{use_max}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
141 f"Maximum lifetime:{max_life}\n" |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
142 ]) |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
143 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
144 # print 2 leftover from LAP |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
145 result += INDENTATION.join( |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
146 [f"{INDENTATION}Mitosis alternative cost:{mitosis_alt}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
147 f"Maximum mitosis distance, in pixel units:{max_mitosis_dist}\n" |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
148 ]) |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
149 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
150 # Follow Neighbors |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
151 # defaults |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
152 avg_cell_diameter = 35.0 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
153 use_adv = "No" |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
154 cost_of_cell = 15.0 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
155 weight_of_area_diff = 25.0 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
156 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
157 if tracking_method == "Follow Neighbors": |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
158 avg_cell_diameter = get_json_value(input_params, 'con_tracking_method.avg_diameter') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
159 use_adv = get_json_value(input_params, 'con_tracking_method.con_adv_parameter.adv_parameter') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
160 if use_adv == "Yes": |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
161 cost_of_cell = get_json_value(input_params, 'con_tracking_method.con_adv_parameter.cost') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
162 weight_of_area_diff = get_json_value(input_params, 'con_tracking_method.con_adv_parameter.weight') |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
163 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
164 result += INDENTATION.join( |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
165 [f"{INDENTATION}Average cell diameter in pixels:{avg_cell_diameter}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
166 f"Use advanced configuration parameters:{use_adv}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
167 f"Cost of cell to empty matching:{cost_of_cell}\n", |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
168 f"Weight of area difference in function matching cost:{weight_of_area_diff}\n" |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
169 ]) |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
170 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
171 return result |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
172 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
173 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
174 if __name__ == "__main__": |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
175 parser = argparse.ArgumentParser() |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
176 parser.add_argument( |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
177 '-p', '--pipeline', |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
178 help='CellProfiler pipeline' |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
179 ) |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
180 parser.add_argument( |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
181 '-i', '--inputs', |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
182 help='JSON inputs from Galaxy' |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
183 ) |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
184 args = parser.parse_args() |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
185 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
186 pipeline_lines = get_pipeline_lines(args.pipeline) |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
187 inputs_galaxy = json.load(open(args.inputs, "r")) |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
188 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
189 current_module_num = get_total_number_of_modules(pipeline_lines) |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
190 current_module_num += 1 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
191 pipeline_lines = update_module_count(pipeline_lines, current_module_num) |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
192 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
193 header_block = build_header(MODULE_NAME, current_module_num) |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
194 main_block = build_main_block(inputs_galaxy) |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
195 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
196 module_pipeline = f"\n{header_block}{main_block}\n" |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
197 pipeline_lines.append(module_pipeline) |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
198 |
3a05117669cf
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
bgruening
parents:
diff
changeset
|
199 write_pipeline(OUTPUT_FILENAME, pipeline_lines) |