Skip to content

feat(workflow-operator): volcano plot labels follow columns - #9040

Open
eugenegujing wants to merge 1 commit into
apache:mainfrom
eugenegujing:fix/volcano-plot-axis-labels
Open

eugenegujing wants to merge 1 commit into
apache:mainfrom
eugenegujing:fix/volcano-plot-axis-labels

Conversation

@eugenegujing

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Root cause: VolcanoPlotOpDesc.generatePythonCode hard-codes the y column as the literal "-log10(pvalue)" and plots it under that name, so the y axis always says -log10(pvalue) even when the selected column is padj. The title is the literal "Volcano Plot" and the x axis and color bar show the raw effect column name. None of this can be changed from the property panel.

Before:  P-Value Column = padj  ->  y column "-log10(pvalue)"  ->  y axis "-log10(pvalue)"
After:   P-Value Column = padj  ->  y column "-log10(padj)"    ->  y axis "-log10(padj)", or the Y Label the user typed

The y column is now named after the selected p-value column, so the axis and the hover text say which column was transformed. Four optional label properties are added, empty by default:

Property Empty Set
Title Volcano Plot the text typed
X Label effect column name the text typed
Y Label -log10(<p-value column>) the text typed
Color Bar Label effect column name the text typed

The labels go through fig.update_layout(xaxis_title, yaxis_title, coloraxis_colorbar_title_text), same as Line Chart's X Label / Y Label. Each label is an EncodableString, so quotes and non-ASCII text are fine. A whitespace-only field counts as empty. The hover box still shows raw column names (plotly behaviour, same as Line Chart).

Behavior change for saved workflows: a workflow with padj as the p-value column now renders -log10(padj) instead of -log10(pvalue). That is the fix.

Rebase note: coloraxis_colorbar_title_text is emitted unconditionally. Once the significance-coloring PR (#9039) lands, the categorical mode has no coloraxis, so whichever branch rebases second needs to make that entry conditional.

Figures below are the operator's generated Python from main and from this branch, run on the 430-gene example workflow from the issue; the third one has all four labels filled in.

Before After (defaults) After (labels set)
before-main labels-after-default labels-after-custom

Any related issues, documentation, discussions?

Closes #9037

PR #8504 adds a generateStandaloneCode() path to this operator that copies the current template, including the hard-coded "-log10(pvalue)". Whichever lands first, the other needs a follow-up.

How was this PR tested?

New tests in VolcanoPlotOpDescSpec, written before the source change:

  • y column and axis are named after the selected p-value column; the old literal is gone
  • every label falls back to its default when empty or whitespace-only
  • a set label replaces its default and reaches the code only as a decode site (sentinels with quotes, backslash, non-ASCII)
  • one set label leaves the other three at their defaults
  • a workflow JSON saved before this change (only the two column keys) generates byte-for-byte the same code as a default-constructed operator
sbt -Dsbt.server.forcestart=true "WorkflowOperator/testOnly *VolcanoPlotOpDescSpec"
# Tests: succeeded 11, failed 0, canceled 0, ignored 0, pending 1   (the pending one is pre-existing)

sbt -Dsbt.server.forcestart=true "WorkflowOperator/scalafmtAll" "WorkflowOperator/Test/scalafmtAll"
sbt -Dsbt.server.forcestart=true "WorkflowOperator/scalafixAll --check"
# success

Smoke run: the generated code was executed outside Texera (pytexera stubbed, pandas + plotly 5.24.1) on the 430-gene mock table. Defaults give title Volcano Plot, x lfc_shrunk, y -log10(padj), color bar lfc_shrunk; with all four labels set the figure shows the typed text; whitespace-only title and y label fall back to the defaults.

Was this PR authored or co-authored using generative AI tooling?

Yes. Generated-by: Claude Code (claude-fable-5-1). Co-authored with Claude; the author reviewed the change before submission.

Name the y column and its axis -log10(<p-value column>) instead of the fixed "-log10(pvalue)". Add optional Title, X Label, Y Label and Color Bar Label properties that override the column-derived text when set; an empty or blank field keeps the default.
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @kz930, @Yicong-Huang
    You can notify them by mentioning @kz930, @Yicong-Huang in a comment.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Volcano Plot labels the y axis "-log10(pvalue)" regardless of the selected column, and offers no title / axis / color-bar labels

1 participant