@@ -171,22 +171,23 @@ def gen_load_spatial_jobs(caf, mode_dictionary = {}, load_raw=True):
171
171
visium_tissue_positions_file = None
172
172
visium_scalefactors_file = None
173
173
spatial_filetype = caf ['spatial_filetype' ][nn ]
174
+ vpt_cell_by_gene = None
175
+ vpt_cell_metadata = None
176
+ vpt_cell_boundaries = None
174
177
if "vpt_cell_by_gene" in caf .columns :
175
178
if pd .notna (caf ['vpt_cell_by_gene' ][nn ]):
176
179
vpt_cell_by_gene = caf ['vpt_cell_by_gene' ][nn ]
177
- else :
178
- vpt_cell_by_gene = None
179
180
if "vpt_cell_metadata" in caf .columns :
180
181
if pd .notna (caf ['vpt_cell_metadata' ][nn ]):
181
182
vpt_cell_metadata = caf ['vpt_cell_metadata' ][nn ]
182
- else :
183
- vpt_cell_metadata = None
184
183
if "vpt_cell_boundaries" in caf .columns :
185
184
if pd .notna (caf ['vpt_cell_boundaries' ][nn ]):
186
185
vpt_cell_boundaries = caf ['vpt_cell_boundaries' ][nn ]
187
- else :
188
- vpt_cell_boundaries = None
189
186
elif caf ['spatial_filetype' ][nn ]== "visium" :
187
+ visium_feature_bc_matrix = None
188
+ visium_fullres_image_file = None
189
+ visium_tissue_positions_file = None
190
+ visium_scalefactors_file = None
190
191
vpt_cell_by_gene = None
191
192
vpt_cell_metadata = None
192
193
vpt_cell_boundaries = None
@@ -195,26 +196,18 @@ def gen_load_spatial_jobs(caf, mode_dictionary = {}, load_raw=True):
195
196
if "visium_feature_bc_matrix" in caf .columns :
196
197
if pd .notna (caf ["visium_feature_bc_matrix" ][nn ]):
197
198
visium_feature_bc_matrix = caf ["visium_feature_bc_matrix" ][nn ]
198
- else :
199
- visium_feature_bc_matrix = None
200
199
# fullres image
201
200
if "visium_fullres_image_file" in caf .columns :
202
201
if pd .notna (caf ["visium_fullres_image_file" ][nn ]):
203
202
visium_fullres_image_file = caf ["visium_fullres_image_file" ][nn ]
204
- else :
205
- visium_fullres_image_file = None
206
203
# tissue position
207
204
if "visium_tissue_positions_file" in caf .columns :
208
205
if pd .notna (caf ["visium_tissue_positions_file" ][nn ]):
209
206
visium_tissue_positions_file = caf ["visium_tissue_positions_file" ][nn ]
210
- else :
211
- visium_tissue_positions_file = None
212
207
# scalefactor
213
208
if "visium_scalefactors_file" in caf .columns :
214
209
if pd .notna (caf ["visium_scalefactors_file" ][nn ]):
215
- visium_scalefactors_file = caf ["visium_scalefactors_file" ][nn ]
216
- else :
217
- visium_scalefactors_file = None
210
+ visium_scalefactors_file = caf ["visium_scalefactors_file" ][nn ]
218
211
else :
219
212
spatial_path = None
220
213
spatial_filetype = None
0 commit comments