diff --git a/panpipes/python_scripts/plot_qc_spatial.py b/panpipes/python_scripts/plot_qc_spatial.py index 7bdfbe7a..4009b1a7 100644 --- a/panpipes/python_scripts/plot_qc_spatial.py +++ b/panpipes/python_scripts/plot_qc_spatial.py @@ -144,7 +144,7 @@ axs[2].set_title("Transcripts per FOV") sns.histplot( - spatial.obs.groupby("fov").sum()["total_counts"], + spatial.obs.groupby('fov')[['total_counts']].sum(), kde=False, ax=axs[2], ) @@ -160,8 +160,8 @@ #plt.savefig("merfish_histo.png", dpi=300) plt.savefig(figdir + "/histograms."+sprefix +".png", dpi=300) # Adjust dpi as needed plt.close() # Close the figure to free up memory - - + + L.info("Done") 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: diff --git a/pyproject.toml b/pyproject.toml index 127430a0..64a2638e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ dependencies = [ "pyyaml", "ruffus", "scanorama", - "scanpy>=1.9.1", + "scanpy", "leidenalg", "louvain", "scib", @@ -62,6 +62,7 @@ spatial = [ "jax==0.4.23", "jaxlib==0.4.23", "scvi-tools==1.0.4", + "scipy==1.12.0", "squidpy", "cell2location", "tangram-sc"