From 15502128ce61708b0a82f7553e888befb4efcb33 Mon Sep 17 00:00:00 2001 From: SarahOuologuem Date: Thu, 11 Apr 2024 10:22:28 +0000 Subject: [PATCH] check var index names --- panpipes/python_scripts/run_cell2location.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/panpipes/python_scripts/run_cell2location.py b/panpipes/python_scripts/run_cell2location.py index f1e470c7..52495ee7 100644 --- a/panpipes/python_scripts/run_cell2location.py +++ b/panpipes/python_scripts/run_cell2location.py @@ -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: @@ -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: