From 6ff9120f69edb9444ef14d425ceaaed8da9cc1b0 Mon Sep 17 00:00:00 2001 From: Lukas Heumos Date: Sat, 21 Sep 2024 10:56:22 +0200 Subject: [PATCH] Fix comp syntax (#300) * New mamba action Signed-off-by: zethson * Fix comp syntax --------- Signed-off-by: zethson --- jupyter-book/conditions/compositional.ipynb | 47 +++++++++++-------- .../conditions/perturbation_modeling.ipynb | 2 +- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/jupyter-book/conditions/compositional.ipynb b/jupyter-book/conditions/compositional.ipynb index 01fdc806..69b5a1b1 100644 --- a/jupyter-book/conditions/compositional.ipynb +++ b/jupyter-book/conditions/compositional.ipynb @@ -804,7 +804,7 @@ } ], "source": [ - "pt.pl.coda.boxplots(\n", + "sccoda_model.plot_boxplots(\n", " sccoda_data,\n", " modality_key=\"coda\",\n", " feature_name=\"condition\",\n", @@ -855,7 +855,7 @@ } ], "source": [ - "pt.pl.coda.stacked_barplot(\n", + "sccoda_model.plot_stacked_barplot(\n", " sccoda_data, modality_key=\"coda\", feature_name=\"condition\", figsize=(4, 2)\n", ")\n", "plt.show()" @@ -1265,7 +1265,7 @@ } ], "source": [ - "pt.pl.coda.effects_barplot(sccoda_data, \"coda\", \"condition\")\n", + "sccoda_model.plot_effects_barplot(sccoda_data, \"coda\", \"condition\")\n", "plt.show()" ] }, @@ -1386,8 +1386,6 @@ "adata.layers[\"logcounts\"] = sc.pp.log1p(adata.layers[\"counts\"]).copy()\n", "adata.X = adata.layers[\"logcounts\"].copy()\n", "sc.pp.neighbors(adata, n_neighbors=10, n_pcs=30, random_state=1234)\n", - "\n", - "# Calculate UMAP for visualization purposes\n", "sc.tl.umap(adata)" ] }, @@ -1414,7 +1412,10 @@ }, "pycharm": { "name": "#%%\n" - } + }, + "tags": [ + "hide-output" + ] }, "outputs": [ { @@ -1895,7 +1896,7 @@ } ], "source": [ - "pt.pl.coda.draw_tree(tasccoda_data)" + "tasccoda_model.plot_draw_tree(tasccoda_data)" ] }, { @@ -2002,7 +2003,11 @@ "cell_type": "code", "execution_count": 26, "id": "68cca84d", - "metadata": {}, + "metadata": { + "tags": [ + "hide-output" + ] + }, "outputs": [ { "data": { @@ -2839,7 +2844,7 @@ } ], "source": [ - "pt.pl.coda.draw_effects(\n", + "tasccoda_model.plot_draw_effects(\n", " tasccoda_data,\n", " modality_key=\"coda\",\n", " tree=\"tree\",\n", @@ -2868,7 +2873,7 @@ } ], "source": [ - "pt.pl.coda.draw_effects(\n", + "tasccoda_model.plot_draw_effects(\n", " tasccoda_data,\n", " modality_key=\"coda\",\n", " tree=\"tree\",\n", @@ -2897,7 +2902,7 @@ } ], "source": [ - "pt.pl.coda.draw_effects(\n", + "tasccoda_model.plot_draw_effects(\n", " tasccoda_data,\n", " modality_key=\"coda\",\n", " tree=\"tree\",\n", @@ -2948,7 +2953,9 @@ } ], "source": [ - "pt.pl.coda.effects_barplot(tasccoda_data, modality_key=\"coda\", covariates=\"condition\")" + "tasccoda_model.plot_effects_barplot(\n", + " tasccoda_data, modality_key=\"coda\", covariates=\"condition\"\n", + ")" ] }, { @@ -2992,7 +2999,7 @@ ], "source": [ "kwargs = {\"ncols\": 3, \"wspace\": 0.25, \"vcenter\": 0, \"vmax\": 1.5, \"vmin\": -1.5}\n", - "pt.pl.coda.effects_umap(\n", + "tasccoda_model.plot_effects_umap(\n", " tasccoda_data,\n", " effect_name=[\n", " \"effect_df_condition[T.Salmonella]\",\n", @@ -4022,7 +4029,7 @@ "source": [ "milo.build_nhood_graph(mdata)\n", "with matplotlib.rc_context({\"figure.figsize\": [10, 10]}):\n", - " pt.pl.milo.nhood_graph(mdata, alpha=0.1, min_size=5, plot_edges=False)\n", + " milo.plot_nhood_graph(mdata, alpha=0.1, min_size=5, plot_edges=False)\n", " sc.pl.umap(mdata[\"rna\"], color=\"cell_label\", legend_loc=\"on data\")" ] }, @@ -4087,7 +4094,7 @@ } ], "source": [ - "pt.pl.milo.da_beeswarm(mdata)\n", + "milo.plot_da_beeswarm(mdata)\n", "plt.show()" ] }, @@ -4207,7 +4214,7 @@ ], "source": [ "with matplotlib.rc_context({\"figure.figsize\": [10, 10]}):\n", - " pt.pl.milo.nhood_graph(mdata, alpha=0.1, min_size=5, plot_edges=False)" + " milo.plot_nhood_graph(mdata, alpha=0.1, min_size=5, plot_edges=False)" ] }, { @@ -4236,7 +4243,7 @@ } ], "source": [ - "pt.pl.milo.da_beeswarm(mdata)\n", + "milo.plot_da_beeswarm(mdata)\n", "plt.show()" ] }, @@ -4287,7 +4294,7 @@ "]\n", "\n", "plt.title(\"Enterocyte\")\n", - "pt.pl.milo.nhood_counts_by_cond(\n", + "milo.plot_nhood_counts_by_cond(\n", " mdata, test_var=\"Hpoly_timecourse\", subset_nhoods=entero_ixs\n", ")\n", "plt.show()\n", @@ -4299,7 +4306,7 @@ " & (mdata[\"milo\"].var[\"nhood_annotation\"] == \"Tuft\")\n", "]\n", "plt.title(\"Tuft cells\")\n", - "pt.pl.milo.nhood_counts_by_cond(\n", + "milo.plot_nhood_counts_by_cond(\n", " mdata, test_var=\"Hpoly_timecourse\", subset_nhoods=tuft_ixs\n", ")\n", "plt.show()" @@ -4811,7 +4818,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.12.2" }, "vscode": { "interpreter": { diff --git a/jupyter-book/conditions/perturbation_modeling.ipynb b/jupyter-book/conditions/perturbation_modeling.ipynb index 015ed6bd..fc098291 100644 --- a/jupyter-book/conditions/perturbation_modeling.ipynb +++ b/jupyter-book/conditions/perturbation_modeling.ipynb @@ -2685,7 +2685,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.12.2" }, "vscode": { "interpreter": {