Mercurial > repos > bgruening > cp_convert_objects_to_image
annotate track_objects.py @ 4:df3ad3ba5c6f draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
| author | bgruening | 
|---|---|
| date | Sat, 06 Feb 2021 09:55:05 +0000 | 
| parents | |
| children | cdf8e3c57dae | 
| rev | line source | 
|---|---|
| 
4
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
1 #!/usr/bin/env python | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
2 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
3 import argparse | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
4 import json | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
5 | 
| 
 
df3ad3ba5c6f
"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 | 
| 
 
df3ad3ba5c6f
"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 | 
| 
 
df3ad3ba5c6f
"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 | 
| 
 
df3ad3ba5c6f
"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 | 
| 
 
df3ad3ba5c6f
"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 | 
| 
 
df3ad3ba5c6f
"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 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
12 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
13 MODULE_NAME = "TrackObjects" | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
14 OUTPUT_FILENAME = "output.cppipe" | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
15 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
16 | 
| 
 
df3ad3ba5c6f
"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): | 
| 
 
df3ad3ba5c6f
"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}", | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
19 "svn_version:\\'Unknown\\'", | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
20 "variable_revision_number:7", | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
21 "show_window:True", | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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)", | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
24 "enabled:True", | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
25 "wants_pause:False]\n"]) | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
26 return result | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
27 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
28 | 
| 
 
df3ad3ba5c6f
"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): | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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" | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
32 ]) | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
33 | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
35 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
36 obj_measurement = "None" # default value | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
37 if tracking_method == "Measurements": | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
40 | 
| 
 
df3ad3ba5c6f
"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": | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"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}" | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
44 else: | 
| 
 
df3ad3ba5c6f
"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}" | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
46 | 
| 
 
df3ad3ba5c6f
"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"]) | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
48 | 
| 
 
df3ad3ba5c6f
"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 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
50 max_distance = 50 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
51 else: | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
53 | 
| 
 
df3ad3ba5c6f
"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"]) | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
55 | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
57 | 
| 
 
df3ad3ba5c6f
"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 | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
60 if save == "Yes": | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
62 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
63 result += INDENTATION.join( | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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" | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
67 ]) | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
68 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
69 # LAP method default values | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
70 movement_model = "Both" | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
71 no_std = 3.0 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
72 radius_limit_max = 10.0 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
73 radius_limit_min = 2.0 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
74 radius = "2.0,10.0" | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
75 run_second = "Yes" | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
76 gap_closing = 40 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
77 split_alt = 40 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
78 merge_alt = 40 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
79 max_gap_displacement = 5 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
80 max_split = 50 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
81 max_merge = 50 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
82 max_temporal = 5 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
83 max_mitosis_dist = 40 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
84 mitosis_alt = 80 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
85 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
86 # LAP method | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
87 if tracking_method == "LAP": | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"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}" | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
93 | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
95 if run_second == "Yes": | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
105 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
106 result += INDENTATION.join( | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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" | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
118 ]) | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
119 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
120 # common section | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
122 use_min = "Yes" # default | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
123 min_life = 1 # default | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
124 use_max = "No" # default | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
125 max_life = 100 # default | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
126 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
127 if filter_by_lifetime == "Yes": | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
129 if use_min == "Yes": | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
131 | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
133 if use_max == "Yes": | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
135 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
136 result += INDENTATION.join( | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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" | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
142 ]) | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
143 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
144 # print 2 leftover from LAP | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
145 result += INDENTATION.join( | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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" | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
148 ]) | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
149 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
150 # Follow Neighbors | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
151 # defaults | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
152 avg_cell_diameter = 35.0 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
153 use_adv = "No" | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
154 cost_of_cell = 15.0 | 
| 
 
df3ad3ba5c6f
"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 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
156 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
157 if tracking_method == "Follow Neighbors": | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
160 if use_adv == "Yes": | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"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') | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
163 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
164 result += INDENTATION.join( | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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", | 
| 
 
df3ad3ba5c6f
"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" | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
169 ]) | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
170 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
171 return result | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
172 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
173 | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
174 if __name__ == "__main__": | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
175 parser = argparse.ArgumentParser() | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
176 parser.add_argument( | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
177 '-p', '--pipeline', | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
178 help='CellProfiler pipeline' | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
179 ) | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
180 parser.add_argument( | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
181 '-i', '--inputs', | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
182 help='JSON inputs from Galaxy' | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
183 ) | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
184 args = parser.parse_args() | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
185 | 
| 
 
df3ad3ba5c6f
"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) | 
| 
 
df3ad3ba5c6f
"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")) | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
188 | 
| 
 
df3ad3ba5c6f
"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) | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
190 current_module_num += 1 | 
| 
 
df3ad3ba5c6f
"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) | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
192 | 
| 
 
df3ad3ba5c6f
"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) | 
| 
 
df3ad3ba5c6f
"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) | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
195 | 
| 
 
df3ad3ba5c6f
"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" | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
197 pipeline_lines.append(module_pipeline) | 
| 
 
df3ad3ba5c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
 
bgruening 
parents:  
diff
changeset
 | 
198 | 
| 
 
df3ad3ba5c6f
"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) | 
