Mercurial > repos > bgruening > cp_cellprofiler
comparison cp_common_functions.py @ 5:e917a2424690 draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 35da2dcd86747c9bff138e100dbe08c6106f3780"
| author | bgruening |
|---|---|
| date | Sat, 06 Feb 2021 09:58:14 +0000 |
| parents | 78a16d8c8d5e |
| children | eb6c08714244 |
comparison
equal
deleted
inserted
replaced
| 4:fca368c99299 | 5:e917a2424690 |
|---|---|
| 1 INDENTATION = " " | 1 INDENTATION = " " |
| 2 LINE_NUM_MODULES = 4 | 2 LINE_NUM_MODULES = 4 |
| 3 | |
| 3 | 4 |
| 4 def get_json_value(json_input, keys_path): | 5 def get_json_value(json_input, keys_path): |
| 5 """Returns the value specified in keys_path (using dot notation) or an empty string if the key doesn't exist""" | 6 """Returns the value specified in keys_path (using dot notation) or an empty string if the key doesn't exist""" |
| 6 if not isinstance(json_input, dict): | 7 if not isinstance(json_input, dict): |
| 7 return "" | 8 return "" |
| 19 if a == "" or b == "": | 20 if a == "" or b == "": |
| 20 return "" | 21 return "" |
| 21 else: | 22 else: |
| 22 return f"{a}_{b}" | 23 return f"{a}_{b}" |
| 23 | 24 |
| 24 | 25 |
| 25 def get_total_number_of_modules(pipeline_lines): | 26 def get_total_number_of_modules(pipeline_lines): |
| 26 """Gets the number of modules from the header of the previous pipeline""" | 27 """Gets the number of modules from the header of the previous pipeline""" |
| 27 number_of_modules = pipeline_lines[LINE_NUM_MODULES].strip().split(':')[1] | 28 number_of_modules = pipeline_lines[LINE_NUM_MODULES].strip().split(':')[1] |
| 28 return int(number_of_modules) | 29 return int(number_of_modules) |
| 29 | 30 |
