Repository navigation
feat(workflow-operator): volcano plot significance cut-offs - #9041
eugenegujing wants to merge 9 commits into
Conversation
Add optional Significance threshold and Effect-size threshold properties that draw dashed cut-off lines at -log10(threshold) and at plus and minus the effect-size threshold. Add a Color by significance toggle that, with both thresholds set, colors points Up, Down or Not significant instead of by effect size. Bound both thresholds in the JSON schema and ignore a non-positive, non-finite or above-one value instead of drawing it.
Automated Reviewer SuggestionsBased on the
|
…ignificance-thresholds
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9041 +/- ##
============================================
+ Coverage 91.55% 91.56% +0.01%
- Complexity 5112 5139 +27
============================================
Files 1291 1291
Lines 57359 57398 +39
Branches 7502 7502
============================================
+ Hits 52516 52558 +42
+ Misses 2933 2932 -1
+ Partials 1910 1908 -2
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 412 | 0.252 | 22,149/34,293/34,293 us | 🟢 -32.3% / 🔴 +156.4% |
| ⚪ | bs=100 sw=10 sl=64 | 863 | 0.527 | 115,848/129,898/129,898 us | ⚪ within ±5% / 🔴 +50.5% |
| ⚪ | bs=1000 sw=10 sl=64 | 974 | 0.595 | 1,024,752/1,095,788/1,095,788 us | ⚪ within ±5% / 🔴 +36.3% |
Baseline details
Latest main 2e98e44 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 412 tuples/sec | 441 tuples/sec | 1,046 tuples/sec | -6.6% | -60.6% |
| bs=10 sw=10 sl=64 | MB/s | 0.252 MB/s | 0.269 MB/s | 0.638 MB/s | -6.3% | -60.5% |
| bs=10 sw=10 sl=64 | p50 | 22,149 us | 20,296 us | 10,039 us | +9.1% | +120.6% |
| bs=10 sw=10 sl=64 | p95 | 34,293 us | 50,629 us | 13,374 us | -32.3% | +156.4% |
| bs=10 sw=10 sl=64 | p99 | 34,293 us | 50,629 us | 15,946 us | -32.3% | +115.1% |
| bs=100 sw=10 sl=64 | throughput | 863 tuples/sec | 894 tuples/sec | 1,408 tuples/sec | -3.5% | -38.7% |
| bs=100 sw=10 sl=64 | MB/s | 0.527 MB/s | 0.545 MB/s | 0.86 MB/s | -3.3% | -38.7% |
| bs=100 sw=10 sl=64 | p50 | 115,848 us | 111,387 us | 78,599 us | +4.0% | +47.4% |
| bs=100 sw=10 sl=64 | p95 | 129,898 us | 128,483 us | 86,338 us | +1.1% | +50.5% |
| bs=100 sw=10 sl=64 | p99 | 129,898 us | 128,483 us | 108,934 us | +1.1% | +19.2% |
| bs=1000 sw=10 sl=64 | throughput | 974 tuples/sec | 982 tuples/sec | 1,457 tuples/sec | -0.8% | -33.2% |
| bs=1000 sw=10 sl=64 | MB/s | 0.595 MB/s | 0.599 MB/s | 0.889 MB/s | -0.7% | -33.1% |
| bs=1000 sw=10 sl=64 | p50 | 1,024,752 us | 1,011,391 us | 766,492 us | +1.3% | +33.7% |
| bs=1000 sw=10 sl=64 | p95 | 1,095,788 us | 1,111,548 us | 804,229 us | -1.4% | +36.3% |
| bs=1000 sw=10 sl=64 | p99 | 1,095,788 us | 1,111,548 us | 850,445 us | -1.4% | +28.8% |
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,485.06,200,128000,412,0.252,22149.45,34293.14,34293.14
1,100,10,64,20,2318.19,2000,1280000,863,0.527,115847.87,129897.92,129897.92
2,1000,10,64,20,20531.11,20000,12800000,974,0.595,1024752.34,1095787.78,1095787.78
kz930
left a comment
There was a problem hiding this comment.
LGTM. The schema bounds plus the runtime filter cover both the property panel and hand-edited JSON.
…ignificance-thresholds # Conflicts: # common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/volcanoPlot/VolcanoPlotOpDesc.scala
…ignificance-thresholds
…aight to px Hand the Up / Down / Not significant categories to px as `color` instead of writing them into `table["Significance"]`, in both the engine template and the exported script, and add a regression test. Remove the redundant single-threshold, hold-Doubles, export toggle-off and export saved-workflow tests, stop the engine saved-workflow test at the equality check, and file the two required-field tests back under generatePythonCode.
…ignificance-thresholds
…ignificance-thresholds
…a column no input uses
What changes were proposed in this PR?
The Volcano Plot draws a plain scatter of effect size vs
-log10(p), colored by effect size, which is already the x axis. Nothing shows where the significance bar is or which points clear it. This PR adds three optional properties, all off by default, so saved workflows render as before.0 < x <= 1-log10(threshold)> 0+thresholdand-thresholdUp/Down/Not significantwith a legend instead of the continuousRdBuscaleCategories use strict comparisons on the selected p-value column:
Up=p < sigandeffect > eff,Down=p < sigandeffect < -eff, everything elseNot significant. The categories are stored in a new column that px colors by. It is namedSignificance, with underscores appended until no input column has that name, so no input column is overwritten. The legend and the hover call itSignificance. The one exception is an effect column that is itself namedSignificance: the category then shows under the column's own name (Significance_), because px merges two hover lines that share a label. Colors are ColorBrewer RdBu end points#B2182B/#2166ACplus grey#9E9E9E.Validation: the JSON schema bounds above stop bad values in the property panel. For hand-edited JSON the operator also ignores a threshold it cannot draw (NaN, infinite, <= 0, or a p cut-off > 1) and falls back to the continuous coloring if the toggle is on but a threshold is missing. A cut-off of exactly 1 is allowed and draws its line at y = 0. If the cut-off's
-log10is beyond the data range the line may fall outside the auto-ranged axis; extending the range is left for a follow-up.Since #8504 merged, the operator also exports a standalone script through
generateStandaloneCode(). This PR adds the cut-off lines and theUp/Down/Not significantcoloring there too, from the same helpers where possible: the color map and category order are one shared literal, the threshold lines come from the same builder, and only the column names differ (Python literals instead of decoded strings). A spec checks that both paths make the same line and coloring decisions for eight threshold shapes, so the exported figure cannot drift from the engine's.The label fix (#9037) and the hover column (#9038) have landed and this branch is merged with both. The title and the axis labels apply in both coloring modes; the color bar title only shows with the continuous coloring, since the category coloring has a legend instead of a color bar.
Figures below are the operator's generated Python from
mainand from this branch, run on the 430-gene example workflow from the issue, with thresholds 0.05 and 1.Any related issues, documentation, discussions?
Closes #9039
PR #8504 (merged) added the
generateStandaloneCode()export path; the mirroring described above is the follow-up it needed.How was this PR tested?
New tests in
VolcanoPlotOpDescSpec, written before the source change:np.selectcategories written to a column whose name no input column has,color,labelsandcategory_orderskeyed by that column, exact color map, nocolor_continuous_scaleSignificance: neither path assignstable["Significance"], and both leave theSignificancelabel off so the two hover lines stay apart; an effect column namedSignificance_keeps the labelInfinity,-Infinity,NaNfrom JSON never reach the Python1e-300,Double.MIN_VALUEand1e21in every site they appearexclusiveMinimum/maximumon the two thresholdsgenerateStandaloneCode: defaults draw no line and keep the continuous coloring; the toggle on colorsUp/Down/Not significantwith the column names as literals; a cross-path test checks that the exported script makes the same cut-off and coloring decisions as the engine for eight threshold shapes (unset, one side only, zero, p cut-off above 1, non-finite, exactly 1)Smoke run outside Texera (pytexera stubbed, pandas + plotly 5.24.1) on the 430-gene mock table, 420 rows after the operator drops zero and missing p-values:
Up35,Down35,Not significant350"Infinity"/"NaN"from JSONNot significant420Up41,Down38,Not significant341Column-name collisions, run on both generated paths with thresholds 0.05 / 1 and the toggle on (10-row table, 8 rows after the filter): an effect column, a selected hover column or the first column named
color; an unused column, the hover column or the p-value column namedSignificance;SignificanceandSignificance_both present; an effect column namedSignificance_; a column name with quotes, a backslash and non-ASCII text. Every case drawsUp2 /Down1 /Not significant5 in the three colors with the legend titledSignificance, the x values and the hover text equal the input columns, the engine and exported figures are equal as JSON, and the input table is unchanged. With the effect column namedSignificancethe legend readsSignificance_and the hover keeps both the category line and the x line. For an ordinary table the figure is unchanged from the previous revision of this PR.With thresholds 0.05 / 1, a hover column, and Title, X Label and Y Label all set, both paths draw the configured title and axis labels. With the toggle on they show the
Significancelegend and no trace uses the color bar; with the toggle off the color bar is titled with the X Label.The exponent-form dumps pass
python -m py_compile. The exported script for the default, lines-only and colored configurations parses withast.parse.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.