Skip to content

Commit

Permalink
check var index names
Browse files Browse the repository at this point in the history
  • Loading branch information
SarahOuologuem committed Apr 11, 2024
1 parent b3d366b commit 1550212
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions panpipes/python_scripts/run_cell2location.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@
cell2loc_plot_QC_reference(model_ref, figdir + "/QC_reference_reconstruction_accuracy.png", figdir + "/QC_reference_expression signatures_vs_avg_expression.png")

# save model and update mudata
if adata_sc.var.index.names[0] in adata_sc.var.columns:
adata_sc.var.index.names = [None]
mdata_singlecell.mod["rna"] = adata_sc
mdata_singlecell.update()
if save_models is True:
Expand Down Expand Up @@ -301,6 +303,8 @@


# save model and update mudata
if adata_st.var.index.names[0] in adata_st.var.columns:
adata_st.var.index.names = [None]
mdata_spatial.mod["spatial"] = adata_st
mdata_spatial.update()
if save_models is True:
Expand Down

0 comments on commit 1550212

Please sign in to comment.