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