32
32
parse_spacing ,
33
33
summary_csv_path ,
34
34
spacing_anisotropy_tuple ,
35
+ str2bool
35
36
)
36
37
from scmultiplex .features .FeatureExtraction import (
37
38
extract_organoid_features ,
@@ -58,10 +59,10 @@ def load_task(exp_path: str, excluded_plates: List[str], excluded_wells: List[st
58
59
59
60
60
61
@task ()
61
- def well_feature_extraction_ovr_task (well : WellRecord , ovr_channel : str , name_ovr : str ):
62
+ def well_feature_extraction_ovr_task (well : WellRecord , org_seg_ch : str ):
62
63
extract_well_features (
63
64
well = well ,
64
- ovr_channel = ovr_channel ,
65
+ ovr_channel = org_seg_ch ,
65
66
)
66
67
return
67
68
@@ -92,8 +93,8 @@ def get_organoids(
92
93
93
94
@task ()
94
95
def organoid_feature_extraction_and_linking_task (
95
- organoid , nuc_ending : str , mem_ending : str , mask_ending : str , spacing : List [float ],
96
- org_seg_ch , nuc_seg_ch , mem_seg_ch , ovr_channel , iop_cutoff ):
96
+ organoid , nuc_ending : str , mem_ending : str , mask_ending : str , spacing : List [float ], measure_morphology ,
97
+ org_seg_ch , nuc_seg_ch , mem_seg_ch , iop_cutoff ):
97
98
98
99
set_spacing (spacing )
99
100
extract_organoid_features (
@@ -102,14 +103,14 @@ def organoid_feature_extraction_and_linking_task(
102
103
mem_ending = mem_ending ,
103
104
mask_ending = mask_ending ,
104
105
spacing = tuple (spacing ),
105
- measure_morphology = True ,
106
+ measure_morphology = measure_morphology ,
106
107
organoid_seg_channel = org_seg_ch ,
107
108
nuclear_seg_channel = nuc_seg_ch ,
108
109
membrane_seg_channel = mem_seg_ch ,
109
110
)
110
111
link_nuc_to_membrane (
111
112
organoid = organoid ,
112
- ovr_channel = ovr_channel ,
113
+ ovr_channel = org_seg_ch ,
113
114
nuc_ending = nuc_ending ,
114
115
mask_ending = mask_ending ,
115
116
mem_ending = mem_ending ,
@@ -128,21 +129,20 @@ def run_flow(r_params, cpus):
128
129
exp_path = Parameter ("exp_path" )
129
130
excluded_plates = Parameter ("excluded_plates" )
130
131
excluded_wells = Parameter ("excluded_wells" )
131
- ovr_channel = Parameter ("ovr_channel" )
132
132
mask_ending = Parameter ("mask_ending" )
133
133
nuc_ending = Parameter ("nuc_ending" )
134
134
mem_ending = Parameter ("mem_ending" )
135
- name_ovr = Parameter ("name_ovr" )
136
135
iop_cutoff = Parameter ("iop_cutoff" )
137
136
spacing = Parameter ("spacing" )
137
+ measure_morphology = Parameter ("measure_morphology" )
138
138
org_seg_ch = Parameter ("org_seg_ch" )
139
139
nuc_seg_ch = Parameter ("nuc_seg_ch" )
140
140
mem_seg_ch = Parameter ("mem_seg_ch" )
141
141
142
142
exp , wells = load_task (exp_path , excluded_plates , excluded_wells )
143
143
144
144
wfeo_t = well_feature_extraction_ovr_task .map (
145
- wells , unmapped (ovr_channel ), unmapped ( name_ovr )
145
+ wells , unmapped (org_seg_ch )
146
146
)
147
147
148
148
organoids = get_organoids (exp , mask_ending , excluded_plates , excluded_wells , upstream_tasks = [wfeo_t ])
@@ -153,10 +153,10 @@ def run_flow(r_params, cpus):
153
153
unmapped (mem_ending ),
154
154
unmapped (mask_ending ),
155
155
unmapped (spacing ),
156
+ unmapped (measure_morphology ),
156
157
unmapped (org_seg_ch ),
157
158
unmapped (nuc_seg_ch ),
158
159
unmapped (mem_seg_ch ),
159
- unmapped (ovr_channel ),
160
160
unmapped (iop_cutoff ),
161
161
upstream_tasks = [organoids ],
162
162
)
@@ -174,12 +174,11 @@ def get_config_params(config_file_path):
174
174
175
175
round_names = get_round_names (config_file_path )
176
176
config_params = {
177
- 'ovr_channel' : ('01FeatureExtraction' , 'ovr_channel' ),
178
- 'name_ovr' : ('01FeatureExtraction' , 'name_ovr' ),
179
177
'mask_ending' : ('00BuildExperiment' , 'mask_ending' ),
178
+ 'measure_morphology' : ('01FeatureExtraction' , 'measure_morphology' ),
180
179
}
181
180
common_params = get_workflow_params (config_file_path , config_params )
182
-
181
+
183
182
compute_param = {
184
183
'excluded_plates' : (
185
184
commasplit ,[
@@ -196,11 +195,17 @@ def get_config_params(config_file_path):
196
195
('01FeatureExtraction' , 'iop_cutoff' )
197
196
]
198
197
),
198
+ 'measure_morphology' : (
199
+ str2bool ,[
200
+ ('01FeatureExtraction' , 'measure_morphology' )
201
+ ]
202
+ ),
199
203
'spacing' : (
200
204
parse_spacing ,[
201
205
('00BuildExperiment' , 'spacing' )
202
206
]
203
207
),
208
+
204
209
}
205
210
common_params .update (compute_workflow_params (config_file_path , compute_param ))
206
211
0 commit comments