Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
SarahOuologuem committed Feb 10, 2025
1 parent 4d873f2 commit 39d3c57
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions panpipes/funcs/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,22 +171,23 @@ def gen_load_spatial_jobs(caf, mode_dictionary = {}, load_raw=True):
visium_tissue_positions_file = None
visium_scalefactors_file = None
spatial_filetype = caf['spatial_filetype'][nn]
vpt_cell_by_gene = None
vpt_cell_metadata = None
vpt_cell_boundaries = None
if "vpt_cell_by_gene" in caf.columns:
if pd.notna(caf['vpt_cell_by_gene'][nn]):
vpt_cell_by_gene = caf['vpt_cell_by_gene'][nn]
else:
vpt_cell_by_gene = None
if "vpt_cell_metadata" in caf.columns:
if pd.notna(caf['vpt_cell_metadata'][nn]):
vpt_cell_metadata = caf['vpt_cell_metadata'][nn]
else:
vpt_cell_metadata = None
if "vpt_cell_boundaries" in caf.columns:
if pd.notna(caf['vpt_cell_boundaries'][nn]):
vpt_cell_boundaries = caf['vpt_cell_boundaries'][nn]
else:
vpt_cell_boundaries = None
elif caf['spatial_filetype'][nn]=="visium":
visium_feature_bc_matrix = None
visium_fullres_image_file = None
visium_tissue_positions_file = None
visium_scalefactors_file = None
vpt_cell_by_gene = None
vpt_cell_metadata = None
vpt_cell_boundaries = None
Expand All @@ -195,26 +196,18 @@ def gen_load_spatial_jobs(caf, mode_dictionary = {}, load_raw=True):
if "visium_feature_bc_matrix" in caf.columns:
if pd.notna(caf["visium_feature_bc_matrix"][nn]):
visium_feature_bc_matrix= caf["visium_feature_bc_matrix"][nn]
else:
visium_feature_bc_matrix = None
# fullres image
if "visium_fullres_image_file" in caf.columns:
if pd.notna(caf["visium_fullres_image_file"][nn]):
visium_fullres_image_file= caf["visium_fullres_image_file"][nn]
else:
visium_fullres_image_file = None
# tissue position
if "visium_tissue_positions_file" in caf.columns:
if pd.notna(caf["visium_tissue_positions_file"][nn]):
visium_tissue_positions_file= caf["visium_tissue_positions_file"][nn]
else:
visium_tissue_positions_file = None
# scalefactor
if "visium_scalefactors_file" in caf.columns:
if pd.notna(caf["visium_scalefactors_file"][nn]):
visium_scalefactors_file= caf["visium_scalefactors_file"][nn]
else:
visium_scalefactors_file = None
visium_scalefactors_file= caf["visium_scalefactors_file"][nn]
else:
spatial_path= None
spatial_filetype = None
Expand Down

0 comments on commit 39d3c57

Please sign in to comment.