From 7caabcc9b0be24ffb5c2c83c202ecfdc73bcc582 Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Fri, 9 Oct 2026 14:26:16 +0200 Subject: [PATCH 1/4] :art: start using differential regulation plots - needs a vuecore update --- .../diff_regulation_ancova.ipynb | 21 +++++++++++ .../diff_regulation_ancova.py | 8 ++++ ...ff_regulation_anova_ttest_two_groups.ipynb | 37 +++++-------------- .../diff_regulation_anova_ttest_two_groups.py | 29 ++------------- pyproject.toml | 2 +- 5 files changed, 44 insertions(+), 53 deletions(-) diff --git a/docs/examples_single_analysis/diff_regulation_ancova.ipynb b/docs/examples_single_analysis/diff_regulation_ancova.ipynb index 1afdc933..a230e81c 100644 --- a/docs/examples_single_analysis/diff_regulation_ancova.ipynb +++ b/docs/examples_single_analysis/diff_regulation_ancova.ipynb @@ -50,6 +50,7 @@ "import pandas as pd\n", "import sklearn.impute\n", "import vuecore.plots.basic.scatter\n", + "from vuecore.interactive import get_differential_regulation_plot\n", "\n", "import acore.differential_regulation as ad\n", "\n", @@ -350,6 +351,26 @@ ")\n", "scatter_plot_adv" ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0fdb7bd6", + "metadata": {}, + "outputs": [], + "source": [ + "get_differential_regulation_plot(\n", + " data=ancova,\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1af558dc", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/docs/examples_single_analysis/diff_regulation_ancova.py b/docs/examples_single_analysis/diff_regulation_ancova.py index a175b4ec..b4864988 100644 --- a/docs/examples_single_analysis/diff_regulation_ancova.py +++ b/docs/examples_single_analysis/diff_regulation_ancova.py @@ -34,6 +34,7 @@ import pandas as pd import sklearn.impute import vuecore.plots.basic.scatter +from vuecore.interactive import get_differential_regulation_plot import acore.differential_regulation as ad @@ -193,3 +194,10 @@ height=600, ) scatter_plot_adv + +# %% +get_differential_regulation_plot( + data=ancova, +) + +# %% diff --git a/docs/examples_single_analysis/diff_regulation_anova_ttest_two_groups.ipynb b/docs/examples_single_analysis/diff_regulation_anova_ttest_two_groups.ipynb index 57ac5834..a9164904 100644 --- a/docs/examples_single_analysis/diff_regulation_anova_ttest_two_groups.ipynb +++ b/docs/examples_single_analysis/diff_regulation_anova_ttest_two_groups.ipynb @@ -44,7 +44,7 @@ "source": [ "import dsp_pandas\n", "import pandas as pd\n", - "import vuecore.plots.basic.scatter\n", + "import vuecore.interactive\n", "\n", "import acore.differential_regulation as ad\n", "\n", @@ -315,7 +315,9 @@ { "cell_type": "markdown", "id": "5fb1bebd", - "metadata": {}, + "metadata": { + "lines_to_next_cell": 2 + }, "source": [ "## View Volcano plot for the ANOVA results\n", "- p-value (unadjusted) using the -log10 transformation on the y-axis, using\n", @@ -332,33 +334,14 @@ "cell_type": "code", "execution_count": null, "id": "37085bf1", - "metadata": {}, + "metadata": { + "lines_to_next_cell": 0 + }, "outputs": [], "source": [ - "scatter_plot_adv = vuecore.plots.basic.scatter.create_scatter_plot(\n", - " data=anova.reset_index(),\n", - " x=\"log2FC\",\n", - " y=\"-log10 pvalue\",\n", - " color=\"rejected\",\n", - " title=\"Simple Volcano Plot\",\n", - " subtitle=\"Visualizing ANOVA results\",\n", - " labels={\n", - " \"log2FC\": \"Log2 Fold Change\",\n", - " \"-log10 pvalue\": \"-log10(p-value)\",\n", - " \"rejected\": \"FDR corrected Significant\",\n", - " \"identifier\": \"Protein Identifier\",\n", - " },\n", - " hover_data=[\"identifier\"],\n", - " # currently does not work:\n", - " # color_discrete_map={False: \"#2166AC\", True: \"#B2182B\"}, # Blue # Red\n", - " color_discrete_sequence=[\"red\", \"blue\"],\n", - " opacity=1,\n", - " marker_line_width=1,\n", - " marker_line_color=\"darkgray\",\n", - " width=800,\n", - " height=600,\n", - ")\n", - "scatter_plot_adv" + "vuecore.interactive.get_differential_regulation_plot(\n", + " data=anova,\n", + ")" ] }, { diff --git a/docs/examples_single_analysis/diff_regulation_anova_ttest_two_groups.py b/docs/examples_single_analysis/diff_regulation_anova_ttest_two_groups.py index ba0b817b..5f9057d1 100644 --- a/docs/examples_single_analysis/diff_regulation_anova_ttest_two_groups.py +++ b/docs/examples_single_analysis/diff_regulation_anova_ttest_two_groups.py @@ -34,7 +34,7 @@ # %% tags=["hide-input"] import dsp_pandas import pandas as pd -import vuecore.plots.basic.scatter +import vuecore.interactive import acore.differential_regulation as ad @@ -167,31 +167,10 @@ # which is True for significant features and False for non-significant features, and # is calculated based on the `padj` column and a significance threshold (default 0.05) + # %% -scatter_plot_adv = vuecore.plots.basic.scatter.create_scatter_plot( - data=anova.reset_index(), - x="log2FC", - y="-log10 pvalue", - color="rejected", - title="Simple Volcano Plot", - subtitle="Visualizing ANOVA results", - labels={ - "log2FC": "Log2 Fold Change", - "-log10 pvalue": "-log10(p-value)", - "rejected": "FDR corrected Significant", - "identifier": "Protein Identifier", - }, - hover_data=["identifier"], - # currently does not work: - # color_discrete_map={False: "#2166AC", True: "#B2182B"}, # Blue # Red - color_discrete_sequence=["red", "blue"], - opacity=1, - marker_line_width=1, - marker_line_color="darkgray", - width=800, - height=600, +vuecore.interactive.get_differential_regulation_plot( + data=anova, ) -scatter_plot_adv - # %% [markdown] # Done. diff --git a/pyproject.toml b/pyproject.toml index a50b68d1..91b5234b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,7 @@ docs = [ "sphinx-copybutton", "sphinx-llms-txt", # Multi-Omics-Analysis group package for visualisation of results in the documentation - "vuecore", + "vuecore>=0.2.1", ] dev = [ "black[jupyter]", From 1d6a3ef7157d34efe3cf3ec41cc87d8e1be31137 Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Fri, 9 Oct 2026 14:27:36 +0200 Subject: [PATCH 2/4] :art: fix docstrings and highlight similarities and differences between Ancova and multigroup Anova --- src/acore/types/differential_analysis.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/acore/types/differential_analysis.py b/src/acore/types/differential_analysis.py index 0abb1156..61edf450 100644 --- a/src/acore/types/differential_analysis.py +++ b/src/acore/types/differential_analysis.py @@ -3,7 +3,7 @@ class AnovaSchema(DataFrameModel): """ - Schema for the enrichment analysis results DataFrame. + Schema for the differential regulation analysis results DataFrame. """ group1: str = Field(nullable=False) @@ -57,16 +57,18 @@ class AnovaSchemaMultiGroup(AnovaSchema): class AncovaSchema(DataFrameModel): """ - Schema for the enrichment analysis results DataFrame. + Schema for the differential regulation analysis results DataFrame. """ + # same as in AnovaSchemaMultiGroup posthoc_comparison: str = Field(alias="posthoc comparison", nullable=False) t_statistics: float = Field(alias="posthoc T-Statistics") posthoc_pvalue: float = Field(alias="posthoc pvalue") + f_statistics: float = Field(alias="F-statistics") + posthoc_padj: float = Field(alias="posthoc pvalue adj", ge=0, le=1) posthoc_rejected: bool = Field(alias="posthoc rejected", nullable=False) + coef: float = Field() std_err: float = Field(alias="std err") conf_int_low: float = Field(alias="Conf. Int. Low") conf_int_upp: float = Field(alias="Conf. Int. Upp.") - f_statistics: float = Field(alias="F-statistics") - posthoc_padj: float = Field(alias="posthoc pvalue adj", ge=0, le=1) From 7f58f0f31f5e4197288d41ef452a5a33fe7eeb9c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 9 Oct 2026 13:56:13 +0000 Subject: [PATCH 3/4] docs: update markdown reference --- docs/markdown_ref/acore.md | 4 ++-- docs/markdown_ref/acore.types.md | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/markdown_ref/acore.md b/docs/markdown_ref/acore.md index 24d33e2f..66272687 100644 --- a/docs/markdown_ref/acore.md +++ b/docs/markdown_ref/acore.md @@ -265,13 +265,13 @@ * [`AncovaSchema.posthoc_comparison`](acore.types.md#acore.types.differential_analysis.AncovaSchema.posthoc_comparison) * [`AncovaSchema.t_statistics`](acore.types.md#acore.types.differential_analysis.AncovaSchema.t_statistics) * [`AncovaSchema.posthoc_pvalue`](acore.types.md#acore.types.differential_analysis.AncovaSchema.posthoc_pvalue) + * [`AncovaSchema.f_statistics`](acore.types.md#acore.types.differential_analysis.AncovaSchema.f_statistics) + * [`AncovaSchema.posthoc_padj`](acore.types.md#acore.types.differential_analysis.AncovaSchema.posthoc_padj) * [`AncovaSchema.posthoc_rejected`](acore.types.md#acore.types.differential_analysis.AncovaSchema.posthoc_rejected) * [`AncovaSchema.coef`](acore.types.md#acore.types.differential_analysis.AncovaSchema.coef) * [`AncovaSchema.std_err`](acore.types.md#acore.types.differential_analysis.AncovaSchema.std_err) * [`AncovaSchema.conf_int_low`](acore.types.md#acore.types.differential_analysis.AncovaSchema.conf_int_low) * [`AncovaSchema.conf_int_upp`](acore.types.md#acore.types.differential_analysis.AncovaSchema.conf_int_upp) - * [`AncovaSchema.f_statistics`](acore.types.md#acore.types.differential_analysis.AncovaSchema.f_statistics) - * [`AncovaSchema.posthoc_padj`](acore.types.md#acore.types.differential_analysis.AncovaSchema.posthoc_padj) * [`AncovaSchema.Config`](acore.types.md#acore.types.differential_analysis.AncovaSchema.Config) * [`AncovaSchema.build_schema_()`](acore.types.md#acore.types.differential_analysis.AncovaSchema.build_schema_) * [`AncovaSchema.empty()`](acore.types.md#acore.types.differential_analysis.AncovaSchema.empty) diff --git a/docs/markdown_ref/acore.types.md b/docs/markdown_ref/acore.types.md index ab3af0e6..d488d3d2 100644 --- a/docs/markdown_ref/acore.types.md +++ b/docs/markdown_ref/acore.types.md @@ -27,7 +27,7 @@ containing NaN values. Bases: [`DataFrameModel`](https://pandera.readthedocs.io/en/stable/reference/generated/pandera.api.pandas.model.DataFrameModel.html#pandera.api.pandas.model.DataFrameModel) -Schema for the enrichment analysis results DataFrame. +Schema for the differential regulation analysis results DataFrame. #### group1 *: [str](https://docs.python.org/3/builtins/stdtypes.html#str)* *= 'group1'* @@ -527,7 +527,7 @@ Validate a DataFrame based on the schema specification. Bases: [`DataFrameModel`](https://pandera.readthedocs.io/en/stable/reference/generated/pandera.api.pandas.model.DataFrameModel.html#pandera.api.pandas.model.DataFrameModel) -Schema for the enrichment analysis results DataFrame. +Schema for the differential regulation analysis results DataFrame. #### posthoc_comparison *: [str](https://docs.python.org/3/builtins/stdtypes.html#str)* *= 'posthoc comparison'* @@ -535,6 +535,10 @@ Schema for the enrichment analysis results DataFrame. #### posthoc_pvalue *: [float](https://docs.python.org/3/builtins/functions.html#float)* *= 'posthoc pvalue'* +#### f_statistics *: [float](https://docs.python.org/3/builtins/functions.html#float)* *= 'F-statistics'* + +#### posthoc_padj *: [float](https://docs.python.org/3/builtins/functions.html#float)* *= 'posthoc pvalue adj'* + #### posthoc_rejected *: [bool](https://docs.python.org/3/builtins/functions.html#bool)* *= 'posthoc rejected'* #### coef *: [float](https://docs.python.org/3/builtins/functions.html#float)* *= 'coef'* @@ -545,10 +549,6 @@ Schema for the enrichment analysis results DataFrame. #### conf_int_upp *: [float](https://docs.python.org/3/builtins/functions.html#float)* *= 'Conf. Int. Upp.'* -#### f_statistics *: [float](https://docs.python.org/3/builtins/functions.html#float)* *= 'F-statistics'* - -#### posthoc_padj *: [float](https://docs.python.org/3/builtins/functions.html#float)* *= 'posthoc pvalue adj'* - #### *class* Config Bases: [`BaseConfig`](https://pandera.readthedocs.io/en/stable/reference/generated/pandera.api.pandas.model_config.BaseConfig.html#pandera.api.pandas.model_config.BaseConfig) From 65ced94ac86c770ec9601146838760a895048691 Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Mon, 12 Oct 2026 16:33:51 +0200 Subject: [PATCH 4/4] :art: pin last vuecore release as minimal version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 91b5234b..215e20cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,7 @@ docs = [ "sphinx-copybutton", "sphinx-llms-txt", # Multi-Omics-Analysis group package for visualisation of results in the documentation - "vuecore>=0.2.1", + "vuecore>=0.3.0", ] dev = [ "black[jupyter]",