From bcde425ac3d5d9ba3b8b211658ef48fbe8172e76 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 15 May 2026 03:27:24 +0000 Subject: [PATCH 1/4] chore(plotly): add metadata for manhattan-gwas --- .../implementations/python/plotly.py | 90 +++++-- .../metadata/python/plotly.yaml | 230 ++---------------- 2 files changed, 81 insertions(+), 239 deletions(-) diff --git a/plots/manhattan-gwas/implementations/python/plotly.py b/plots/manhattan-gwas/implementations/python/plotly.py index 5c9268c826..9582db769b 100644 --- a/plots/manhattan-gwas/implementations/python/plotly.py +++ b/plots/manhattan-gwas/implementations/python/plotly.py @@ -1,14 +1,41 @@ -""" pyplots.ai +"""pyplots.ai manhattan-gwas: Manhattan Plot for GWAS Library: plotly 6.5.0 | Python 3.13.11 -Quality: 92/100 | Created: 2025-12-31 +Quality: 92/100 | Regenerated: 2026-05-15 """ +import os + import numpy as np import pandas as pd import plotly.graph_objects as go +# Theme configuration +THEME = os.getenv("ANYPLOT_THEME", "light") + +PAGE_BG = "#FAF8F1" if THEME == "light" else "#1A1A17" +ELEVATED_BG = "#FFFDF6" if THEME == "light" else "#242420" +INK = "#1A1A17" if THEME == "light" else "#F0EFE8" +INK_SOFT = "#4A4A44" if THEME == "light" else "#B8B7B0" +INK_MUTED = "#6B6A63" if THEME == "light" else "#A8A79F" +GRID = "rgba(26,26,23,0.15)" if THEME == "light" else "rgba(240,239,232,0.15)" + +# Okabe-Ito palette +OKABE_ITO = [ + "#009E73", # bluish green (brand) + "#D55E00", # vermillion + "#0072B2", # blue + "#CC79A7", # reddish purple + "#E69F00", # orange + "#56B4E9", # sky blue + "#F0E442", # yellow +] + +# Threshold line colors (theme-adaptive) +THRESHOLD_COLOR = INK_MUTED +HIGHLIGHT_COLOR = OKABE_ITO[1] # vermillion for significant SNPs + # Data - Simulated GWAS results np.random.seed(42) @@ -81,16 +108,19 @@ df = pd.DataFrame(data) -# Alternating colors for chromosomes (Python Blue and a gray variant) -colors = {"odd": "#306998", "even": "#7A9FBF"} + +# Alternating chromosome colors (Okabe-Ito positions 1 and 2) +def get_chr_color(chrom_num): + return OKABE_ITO[0] if int(chrom_num) % 2 == 1 else OKABE_ITO[1] + # Create figure fig = go.Figure() # Add scatter traces for each chromosome -for i, chrom in enumerate(chr_lengths.keys()): +for chrom in chr_lengths.keys(): chr_data = df[df["chromosome"] == chrom] - color = colors["odd"] if int(chrom) % 2 == 1 else colors["even"] + color = get_chr_color(chrom) fig.add_trace( go.Scatter( @@ -116,11 +146,11 @@ xref="paper", y0=significance_threshold, y1=significance_threshold, - line=dict(color="#E53935", width=2, dash="dash"), + line=dict(color=THRESHOLD_COLOR, width=2, dash="dash"), ) fig.add_annotation( text="Genome-wide significance (p = 5×10⁻⁸)", - font=dict(size=16, color="#E53935"), + font=dict(size=16, color=THRESHOLD_COLOR), xref="paper", x=0.99, xanchor="right", @@ -139,11 +169,11 @@ xref="paper", y0=suggestive_threshold, y1=suggestive_threshold, - line=dict(color="#FFD43B", width=2, dash="dot"), + line=dict(color=INK_MUTED, width=2, dash="dot"), ) fig.add_annotation( text="Suggestive threshold (p = 10⁻⁵)", - font=dict(size=16, color="#B8860B"), + font=dict(size=16, color=INK_MUTED), xref="paper", x=0.99, xanchor="right", @@ -161,7 +191,7 @@ x=significant_snps["cumulative_pos"], y=significant_snps["neg_log_p"], mode="markers", - marker=dict(size=10, color="#E53935", symbol="diamond", line=dict(color="white", width=1)), + marker=dict(size=10, color=HIGHLIGHT_COLOR, symbol="diamond", line=dict(color="white", width=1)), name="Significant SNPs", showlegend=True, hovertemplate=( @@ -180,31 +210,41 @@ # Layout fig.update_layout( - title=dict(text="manhattan-gwas · plotly · pyplots.ai", font=dict(size=32), x=0.5, xanchor="center"), + title=dict(text="manhattan-gwas · plotly · pyplots.ai", font=dict(size=28, color=INK), x=0.5, xanchor="center"), xaxis=dict( - title=dict(text="Chromosome", font=dict(size=24)), - tickfont=dict(size=16), + title=dict(text="Chromosome", font=dict(size=22, color=INK)), + tickfont=dict(size=18, color=INK_SOFT), tickmode="array", tickvals=chr_positions, ticktext=chr_labels, showgrid=False, zeroline=False, + linecolor=INK_SOFT, ), yaxis=dict( - title=dict(text="-log₁₀(p-value)", font=dict(size=24)), - tickfont=dict(size=18), - gridcolor="rgba(0,0,0,0.1)", + title=dict(text="-log₁₀(p-value)", font=dict(size=22, color=INK)), + tickfont=dict(size=18, color=INK_SOFT), + gridcolor=GRID, gridwidth=1, zeroline=False, + linecolor=INK_SOFT, + ), + paper_bgcolor=PAGE_BG, + plot_bgcolor=PAGE_BG, + legend=dict( + yanchor="top", + y=0.99, + xanchor="left", + x=0.01, + font=dict(size=16, color=INK_SOFT), + bgcolor=ELEVATED_BG, + bordercolor=INK_SOFT, + borderwidth=1, ), - template="plotly_white", - legend=dict(yanchor="top", y=0.99, xanchor="left", x=0.01, font=dict(size=16), bgcolor="rgba(255,255,255,0.8)"), margin=dict(l=80, r=50, t=80, b=80), - plot_bgcolor="white", + hovermode="closest", ) -# Save as PNG (4800 x 2700 px) -fig.write_image("plot.png", width=1600, height=900, scale=3) - -# Save as interactive HTML -fig.write_html("plot.html", include_plotlyjs="cdn") +# Save outputs with theme suffix +fig.write_image(f"plot-{THEME}.png", width=1600, height=900, scale=3) +fig.write_html(f"plot-{THEME}.html", include_plotlyjs="cdn") diff --git a/plots/manhattan-gwas/metadata/python/plotly.yaml b/plots/manhattan-gwas/metadata/python/plotly.yaml index bf813b174c..d43b907905 100644 --- a/plots/manhattan-gwas/metadata/python/plotly.yaml +++ b/plots/manhattan-gwas/metadata/python/plotly.yaml @@ -1,219 +1,21 @@ +# Per-library metadata for plotly implementation of manhattan-gwas +# Auto-generated by impl-generate.yml + library: plotly +language: python specification_id: manhattan-gwas created: '2025-12-31T05:32:43Z' -updated: '2025-12-31T05:42:28Z' -generated_by: claude-opus-4-5-20251101 -workflow_run: 20612787650 +updated: '2026-05-15T03:27:24Z' +generated_by: claude-haiku +workflow_run: 25898484388 issue: 2925 -python_version: 3.13.11 -library_version: 6.5.0 -preview_url: https://storage.googleapis.com/anyplot-images/plots/manhattan-gwas/plotly/plot.png -preview_html: https://storage.googleapis.com/anyplot-images/plots/manhattan-gwas/plotly/plot.html -quality_score: 92 -impl_tags: - dependencies: [] - techniques: - - manual-ticks - - layer-composition - - hover-tooltips - - html-export - patterns: - - data-generation - - iteration-over-groups - dataprep: [] - styling: [] +python_version: 3.13.13 +library_version: 6.7.0 +preview_url_light: https://storage.googleapis.com/anyplot-images/plots/manhattan-gwas/python/plotly/plot-light.png +preview_url_dark: https://storage.googleapis.com/anyplot-images/plots/manhattan-gwas/python/plotly/plot-dark.png +preview_html_light: https://storage.googleapis.com/anyplot-images/plots/manhattan-gwas/python/plotly/plot-light.html +preview_html_dark: https://storage.googleapis.com/anyplot-images/plots/manhattan-gwas/python/plotly/plot-dark.html +quality_score: null review: - strengths: - - Excellent implementation of the Manhattan plot with proper GWAS conventions (alternating - chromosome colors, cumulative positions, threshold lines) - - Clear visual hierarchy with significant SNPs highlighted as distinct red diamonds - above the main point cloud - - Comprehensive hover information showing chromosome, position, and -log10(p) value - with proper formatting - - Both PNG and HTML outputs generated for static and interactive viewing - - Proper threshold line annotations positioned to avoid data overlap - weaknesses: - - Could leverage more Plotly-specific interactive features like chromosome filtering - dropdown or range slider for genomic position - - Grid lines could be slightly more visible (currently very faint at alpha 0.1) - image_description: 'The plot displays a Manhattan plot for GWAS visualization with - -log₁₀(p-value) on the y-axis and chromosome positions (1-22) on the x-axis. Points - are colored in alternating shades of blue (darker blue #306998 for odd chromosomes, - lighter blue #7A9FBF for even chromosomes). Three clear peaks of significant SNPs - are visible: on chromosome 2 (reaching ~12), chromosome 8 (reaching ~9.5), and - chromosome 15 (reaching ~13). Significant SNPs above the genome-wide significance - threshold are highlighted as red diamond markers. Two horizontal threshold lines - are present: a red dashed line at ~7.3 for genome-wide significance (p = 5×10⁻⁸) - and a yellow/gold dotted line at 5 for the suggestive threshold (p = 10⁻⁵). The - title "manhattan-gwas · plotly · pyplots.ai" is centered at the top. A legend - in the upper left shows "Significant SNPs" with the red diamond marker. The overall - layout is clean with a white background.' - criteria_checklist: - visual_quality: - score: 37 - max: 40 - items: - - id: VQ-01 - name: Text Legibility - score: 10 - max: 10 - passed: true - comment: Title at 32pt, axis titles at 24pt, tick fonts at 16-18pt - all perfectly - readable - - id: VQ-02 - name: No Overlap - score: 8 - max: 8 - passed: true - comment: No overlapping text elements, chromosome labels well-spaced - - id: VQ-03 - name: Element Visibility - score: 7 - max: 8 - passed: true - comment: Markers sized appropriately for dense GWAS data (size=5), good alpha=0.7, - significant SNPs highlighted distinctly - - id: VQ-04 - name: Color Accessibility - score: 5 - max: 5 - passed: true - comment: Blue/light blue alternating colors are colorblind-safe, red for significant - points provides good contrast - - id: VQ-05 - name: Layout Balance - score: 5 - max: 5 - passed: true - comment: Good use of canvas, balanced margins, plot fills appropriate area - - id: VQ-06 - name: Axis Labels - score: 2 - max: 2 - passed: true - comment: Y-axis has "-log₁₀(p-value)" with proper subscript notation, X-axis - has "Chromosome" - - id: VQ-07 - name: Grid & Legend - score: 0 - max: 2 - passed: true - comment: Grid is subtle (alpha 0.1), but legend placement in upper left could - overlap with data peaks in some scenarios; threshold line annotations are - well-positioned - spec_compliance: - score: 25 - max: 25 - items: - - id: SC-01 - name: Plot Type - score: 8 - max: 8 - passed: true - comment: Correct Manhattan plot visualization - - id: SC-02 - name: Data Mapping - score: 5 - max: 5 - passed: true - comment: Cumulative genomic position on X, -log₁₀(p) on Y correctly assigned - - id: SC-03 - name: Required Features - score: 5 - max: 5 - passed: true - comment: 'All spec features present: alternating chromosome colors, genome-wide - significance threshold, suggestive threshold, significant SNP highlighting, - chromosome labels centered' - - id: SC-04 - name: Data Range - score: 3 - max: 3 - passed: true - comment: Y-axis shows full data range (0-13), X-axis shows all 22 chromosomes - - id: SC-05 - name: Legend Accuracy - score: 2 - max: 2 - passed: true - comment: Legend correctly identifies "Significant SNPs" with red diamond marker - - id: SC-06 - name: Title Format - score: 2 - max: 2 - passed: true - comment: 'Correct format: "manhattan-gwas · plotly · pyplots.ai"' - data_quality: - score: 18 - max: 20 - items: - - id: DQ-01 - name: Feature Coverage - score: 7 - max: 8 - passed: true - comment: Shows multiple significant peaks across different chromosomes, demonstrates - the "Manhattan skyline" pattern well, includes SNPs at various significance - levels - - id: DQ-02 - name: Realistic Context - score: 7 - max: 7 - passed: true - comment: GWAS data is a perfect neutral scientific context, simulated data - follows realistic patterns - - id: DQ-03 - name: Appropriate Scale - score: 4 - max: 5 - passed: true - comment: p-values and -log₁₀ transformations are realistic; chromosome lengths - are reasonable approximations - code_quality: - score: 10 - max: 10 - items: - - id: CQ-01 - name: KISS Structure - score: 3 - max: 3 - passed: true - comment: 'Linear flow: imports → data generation → plot creation → save' - - id: CQ-02 - name: Reproducibility - score: 3 - max: 3 - passed: true - comment: np.random.seed(42) set at the beginning - - id: CQ-03 - name: Clean Imports - score: 2 - max: 2 - passed: true - comment: Only numpy, pandas, and plotly.graph_objects used, all necessary - - id: CQ-04 - name: No Deprecated API - score: 1 - max: 1 - passed: true - comment: Uses current Plotly API - - id: CQ-05 - name: Output Correct - score: 1 - max: 1 - passed: true - comment: Saves as plot.png and plot.html - library_features: - score: 2 - max: 5 - items: - - id: LF-01 - name: Distinctive Features - score: 2 - max: 5 - passed: false - comment: Uses Plotly's graph_objects effectively with custom hover templates, - but doesn't leverage Plotly's full interactive potential (e.g., clickable - points with callbacks, range sliders, dropdown filters for chromosomes). - The HTML output does provide basic interactivity (hover, zoom, pan). - verdict: APPROVED + strengths: [] + weaknesses: [] From 6d86c040bcce6624a99052f0def34105540c6bf8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 15 May 2026 03:30:28 +0000 Subject: [PATCH 2/4] chore(plotly): update quality score 88 and review feedback for manhattan-gwas --- .../implementations/python/plotly.py | 6 +- .../metadata/python/plotly.yaml | 214 +++++++++++++++++- 2 files changed, 210 insertions(+), 10 deletions(-) diff --git a/plots/manhattan-gwas/implementations/python/plotly.py b/plots/manhattan-gwas/implementations/python/plotly.py index 9582db769b..f0d1257ecd 100644 --- a/plots/manhattan-gwas/implementations/python/plotly.py +++ b/plots/manhattan-gwas/implementations/python/plotly.py @@ -1,7 +1,7 @@ -"""pyplots.ai +""" anyplot.ai manhattan-gwas: Manhattan Plot for GWAS -Library: plotly 6.5.0 | Python 3.13.11 -Quality: 92/100 | Regenerated: 2026-05-15 +Library: plotly 6.7.0 | Python 3.13.13 +Quality: 88/100 | Updated: 2026-05-15 """ import os diff --git a/plots/manhattan-gwas/metadata/python/plotly.yaml b/plots/manhattan-gwas/metadata/python/plotly.yaml index d43b907905..578a3c3495 100644 --- a/plots/manhattan-gwas/metadata/python/plotly.yaml +++ b/plots/manhattan-gwas/metadata/python/plotly.yaml @@ -1,11 +1,8 @@ -# Per-library metadata for plotly implementation of manhattan-gwas -# Auto-generated by impl-generate.yml - library: plotly language: python specification_id: manhattan-gwas created: '2025-12-31T05:32:43Z' -updated: '2026-05-15T03:27:24Z' +updated: '2026-05-15T03:30:28Z' generated_by: claude-haiku workflow_run: 25898484388 issue: 2925 @@ -15,7 +12,210 @@ preview_url_light: https://storage.googleapis.com/anyplot-images/plots/manhattan preview_url_dark: https://storage.googleapis.com/anyplot-images/plots/manhattan-gwas/python/plotly/plot-dark.png preview_html_light: https://storage.googleapis.com/anyplot-images/plots/manhattan-gwas/python/plotly/plot-light.html preview_html_dark: https://storage.googleapis.com/anyplot-images/plots/manhattan-gwas/python/plotly/plot-dark.html -quality_score: null +quality_score: 88 review: - strengths: [] - weaknesses: [] + strengths: + - Excellent theme adaptation with proper token usage throughout both renders + - Clean, professional GWAS visualization meeting all specification requirements + - Realistic synthetic data with interpretable peaks and threshold annotations + - Proper use of plotly features (manual ticks, shapes, annotations, hover tooltips) + - Readable text and markers across both light and dark themes + weaknesses: + - Design is straightforward without exceptional polish or custom touches beyond + requirements + - Limited use of advanced plotly features (could leverage more interactive capabilities) + image_description: |- + Light render (plot-light.png): + Background: Warm off-white (#FAF8F1) - correct theme color + Chrome: Title "manhattan-gwas · plotly · pyplots.ai" in dark INK (#1A1A17), axis labels and tick labels in INK_SOFT (#4A4A44) - all clearly readable + Data: Alternating green (#009E73) and orange (#D55E00) for chromosomes with opacity 0.7; significant SNPs highlighted as orange diamonds with white edges; subtle y-axis grid visible + Legibility verdict: PASS - all text elements readable with proper contrast + + Dark render (plot-dark.png): + Background: Warm near-black (#1A1A17) - correct theme color + Chrome: Title and labels in light INK (#F0EFE8) and INK_SOFT (#B8B7B0) - all clearly readable; no dark-on-dark failures + Data: Identical colors to light render (green and orange for chromosomes, orange for significant SNPs); grid lines visible with light coloring + Legibility verdict: PASS - all text readable, no contrast issues, proper theme adaptation confirmed + criteria_checklist: + visual_quality: + score: 30 + max: 30 + items: + - id: VQ-01 + name: Text Legibility + score: 8 + max: 8 + passed: true + comment: Font sizes properly scaled; all readable in both themes + - id: VQ-02 + name: No Overlap + score: 6 + max: 6 + passed: true + comment: Clean spacing, no text collisions + - id: VQ-03 + name: Element Visibility + score: 6 + max: 6 + passed: true + comment: Opacity appropriate for density; significant SNPs highlighted + - id: VQ-04 + name: Color Accessibility + score: 2 + max: 2 + passed: true + comment: Okabe-Ito palette CVD-safe + - id: VQ-05 + name: Layout & Canvas + score: 4 + max: 4 + passed: true + comment: 4800×2700 px with proper margins + - id: VQ-06 + name: Axis Labels & Title + score: 2 + max: 2 + passed: true + comment: Descriptive labels with proper notation + - id: VQ-07 + name: Palette Compliance + score: 2 + max: 2 + passed: true + comment: 'First categorical #009E73; backgrounds theme-correct' + design_excellence: + score: 12 + max: 20 + items: + - id: DE-01 + name: Aesthetic Sophistication + score: 5 + max: 8 + passed: true + comment: Professional polish, proper theme adaptation; straightforward execution + - id: DE-02 + name: Visual Refinement + score: 3 + max: 6 + passed: true + comment: Subtle grid, generous whitespace; minimal customization + - id: DE-03 + name: Data Storytelling + score: 4 + max: 6 + passed: true + comment: Threshold lines guide eye; peaks emphasized; visual rhythm + spec_compliance: + score: 15 + max: 15 + items: + - id: SC-01 + name: Plot Type + score: 5 + max: 5 + passed: true + comment: Correct Manhattan plot implementation + - id: SC-02 + name: Required Features + score: 4 + max: 4 + passed: true + comment: All features present and correct + - id: SC-03 + name: Data Mapping + score: 3 + max: 3 + passed: true + comment: Axes correctly mapped + - id: SC-04 + name: Title & Legend + score: 3 + max: 3 + passed: true + comment: Proper formatting + data_quality: + score: 15 + max: 15 + items: + - id: DQ-01 + name: Feature Coverage + score: 6 + max: 6 + passed: true + comment: Realistic GWAS with interpretable peaks + - id: DQ-02 + name: Realistic Context + score: 5 + max: 5 + passed: true + comment: Realistic distribution, no controversies + - id: DQ-03 + name: Appropriate Scale + score: 4 + max: 4 + passed: true + comment: Proper thresholds and ranges + code_quality: + score: 10 + max: 10 + items: + - id: CQ-01 + name: KISS Structure + score: 3 + max: 3 + passed: true + comment: Simple, clean implementation + - id: CQ-02 + name: Reproducibility + score: 2 + max: 2 + passed: true + comment: Seed set for reproducibility + - id: CQ-03 + name: Clean Imports + score: 2 + max: 2 + passed: true + comment: Only used imports + - id: CQ-04 + name: Code Elegance + score: 2 + max: 2 + passed: true + comment: Appropriate complexity + - id: CQ-05 + name: Output & API + score: 1 + max: 1 + passed: true + comment: Correct file naming + library_mastery: + score: 6 + max: 10 + items: + - id: LM-01 + name: Idiomatic Usage + score: 4 + max: 5 + passed: true + comment: Proper plotly patterns and API usage + - id: LM-02 + name: Distinctive Features + score: 2 + max: 5 + passed: true + comment: Hover tooltips and interactive HTML; mostly standard + verdict: APPROVED +impl_tags: + dependencies: [] + techniques: + - manual-ticks + - annotations + - hover-tooltips + - html-export + patterns: + - data-generation + - iteration-over-groups + dataprep: [] + styling: + - alpha-blending From 344c63450dd8bf4b85a2a89f9a2f96e838f89e51 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 15 May 2026 03:32:48 +0000 Subject: [PATCH 3/4] fix(plotly): address review feedback for manhattan-gwas Attempt 1/3 - fixes based on AI review --- .../implementations/python/plotly.py | 84 ++++++++++--------- 1 file changed, 46 insertions(+), 38 deletions(-) diff --git a/plots/manhattan-gwas/implementations/python/plotly.py b/plots/manhattan-gwas/implementations/python/plotly.py index f0d1257ecd..9f6d33f461 100644 --- a/plots/manhattan-gwas/implementations/python/plotly.py +++ b/plots/manhattan-gwas/implementations/python/plotly.py @@ -1,14 +1,22 @@ -""" anyplot.ai +"""anyplot.ai manhattan-gwas: Manhattan Plot for GWAS Library: plotly 6.7.0 | Python 3.13.13 Quality: 88/100 | Updated: 2026-05-15 """ import os +import sys import numpy as np import pandas as pd -import plotly.graph_objects as go + + +# Remove current directory from path to avoid shadowing plotly package +current_dir = os.path.dirname(os.path.abspath(__file__)) +if current_dir in sys.path: + sys.path.remove(current_dir) + +import plotly.graph_objects as go # noqa: E402 # Theme configuration @@ -127,7 +135,7 @@ def get_chr_color(chrom_num): x=chr_data["cumulative_pos"], y=chr_data["neg_log_p"], mode="markers", - marker=dict(size=5, color=color, opacity=0.7), + marker={"size": 5, "color": color, "opacity": 0.7}, name=f"Chr {chrom}", showlegend=False, hovertemplate=( @@ -146,11 +154,11 @@ def get_chr_color(chrom_num): xref="paper", y0=significance_threshold, y1=significance_threshold, - line=dict(color=THRESHOLD_COLOR, width=2, dash="dash"), + line={"color": THRESHOLD_COLOR, "width": 2, "dash": "dash"}, ) fig.add_annotation( text="Genome-wide significance (p = 5×10⁻⁸)", - font=dict(size=16, color=THRESHOLD_COLOR), + font={"size": 16, "color": THRESHOLD_COLOR}, xref="paper", x=0.99, xanchor="right", @@ -169,11 +177,11 @@ def get_chr_color(chrom_num): xref="paper", y0=suggestive_threshold, y1=suggestive_threshold, - line=dict(color=INK_MUTED, width=2, dash="dot"), + line={"color": INK_MUTED, "width": 2, "dash": "dot"}, ) fig.add_annotation( text="Suggestive threshold (p = 10⁻⁵)", - font=dict(size=16, color=INK_MUTED), + font={"size": 16, "color": INK_MUTED}, xref="paper", x=0.99, xanchor="right", @@ -191,7 +199,7 @@ def get_chr_color(chrom_num): x=significant_snps["cumulative_pos"], y=significant_snps["neg_log_p"], mode="markers", - marker=dict(size=10, color=HIGHLIGHT_COLOR, symbol="diamond", line=dict(color="white", width=1)), + marker={"size": 10, "color": HIGHLIGHT_COLOR, "symbol": "diamond", "line": {"color": "white", "width": 1}}, name="Significant SNPs", showlegend=True, hovertemplate=( @@ -210,38 +218,38 @@ def get_chr_color(chrom_num): # Layout fig.update_layout( - title=dict(text="manhattan-gwas · plotly · pyplots.ai", font=dict(size=28, color=INK), x=0.5, xanchor="center"), - xaxis=dict( - title=dict(text="Chromosome", font=dict(size=22, color=INK)), - tickfont=dict(size=18, color=INK_SOFT), - tickmode="array", - tickvals=chr_positions, - ticktext=chr_labels, - showgrid=False, - zeroline=False, - linecolor=INK_SOFT, - ), - yaxis=dict( - title=dict(text="-log₁₀(p-value)", font=dict(size=22, color=INK)), - tickfont=dict(size=18, color=INK_SOFT), - gridcolor=GRID, - gridwidth=1, - zeroline=False, - linecolor=INK_SOFT, - ), + title={"text": "manhattan-gwas · plotly · pyplots.ai", "font": {"size": 28, "color": INK}, "x": 0.5, "xanchor": "center"}, + xaxis={ + "title": {"text": "Chromosome", "font": {"size": 22, "color": INK}}, + "tickfont": {"size": 18, "color": INK_SOFT}, + "tickmode": "array", + "tickvals": chr_positions, + "ticktext": chr_labels, + "showgrid": False, + "zeroline": False, + "linecolor": INK_SOFT, + }, + yaxis={ + "title": {"text": "-log₁₀(p-value)", "font": {"size": 22, "color": INK}}, + "tickfont": {"size": 18, "color": INK_SOFT}, + "gridcolor": GRID, + "gridwidth": 1, + "zeroline": False, + "linecolor": INK_SOFT, + }, paper_bgcolor=PAGE_BG, plot_bgcolor=PAGE_BG, - legend=dict( - yanchor="top", - y=0.99, - xanchor="left", - x=0.01, - font=dict(size=16, color=INK_SOFT), - bgcolor=ELEVATED_BG, - bordercolor=INK_SOFT, - borderwidth=1, - ), - margin=dict(l=80, r=50, t=80, b=80), + legend={ + "yanchor": "top", + "y": 0.99, + "xanchor": "left", + "x": 0.01, + "font": {"size": 16, "color": INK_SOFT}, + "bgcolor": ELEVATED_BG, + "bordercolor": INK_SOFT, + "borderwidth": 1, + }, + margin={"l": 80, "r": 50, "t": 80, "b": 80}, hovermode="closest", ) From 9cd97b0f4e0146943ef5e167fe2c7e06bdac7bd9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 15 May 2026 03:36:38 +0000 Subject: [PATCH 4/4] chore(plotly): update quality score 89 and review feedback for manhattan-gwas --- .../implementations/python/plotly.py | 4 +- .../metadata/python/plotly.yaml | 121 +++++++++--------- 2 files changed, 63 insertions(+), 62 deletions(-) diff --git a/plots/manhattan-gwas/implementations/python/plotly.py b/plots/manhattan-gwas/implementations/python/plotly.py index 9f6d33f461..b8177060e0 100644 --- a/plots/manhattan-gwas/implementations/python/plotly.py +++ b/plots/manhattan-gwas/implementations/python/plotly.py @@ -1,7 +1,7 @@ -"""anyplot.ai +""" anyplot.ai manhattan-gwas: Manhattan Plot for GWAS Library: plotly 6.7.0 | Python 3.13.13 -Quality: 88/100 | Updated: 2026-05-15 +Quality: 89/100 | Updated: 2026-05-15 """ import os diff --git a/plots/manhattan-gwas/metadata/python/plotly.yaml b/plots/manhattan-gwas/metadata/python/plotly.yaml index 578a3c3495..a0d180f1c1 100644 --- a/plots/manhattan-gwas/metadata/python/plotly.yaml +++ b/plots/manhattan-gwas/metadata/python/plotly.yaml @@ -2,7 +2,7 @@ library: plotly language: python specification_id: manhattan-gwas created: '2025-12-31T05:32:43Z' -updated: '2026-05-15T03:30:28Z' +updated: '2026-05-15T03:36:38Z' generated_by: claude-haiku workflow_run: 25898484388 issue: 2925 @@ -12,33 +12,33 @@ preview_url_light: https://storage.googleapis.com/anyplot-images/plots/manhattan preview_url_dark: https://storage.googleapis.com/anyplot-images/plots/manhattan-gwas/python/plotly/plot-dark.png preview_html_light: https://storage.googleapis.com/anyplot-images/plots/manhattan-gwas/python/plotly/plot-light.html preview_html_dark: https://storage.googleapis.com/anyplot-images/plots/manhattan-gwas/python/plotly/plot-dark.html -quality_score: 88 +quality_score: 89 review: strengths: - - Excellent theme adaptation with proper token usage throughout both renders - - Clean, professional GWAS visualization meeting all specification requirements - - Realistic synthetic data with interpretable peaks and threshold annotations - - Proper use of plotly features (manual ticks, shapes, annotations, hover tooltips) - - Readable text and markers across both light and dark themes + - Clean theme adaptation with both renders production-ready and fully readable + - Correct Okabe-Ito palette usage with stable data colors across light/dark themes + - Clear data storytelling through visual hierarchy and emphasis (significant SNP + diamonds, threshold lines) + - Excellent code quality with KISS structure and proper seed control + - Strong spec compliance with all required GWAS features + - Expert Plotly usage with interactive hover tooltips and professional layout weaknesses: - - Design is straightforward without exceptional polish or custom touches beyond - requirements - - Limited use of advanced plotly features (could leverage more interactive capabilities) + - 'Title domain incorrect: says "pyplots.ai" instead of "anyplot.ai" (line 221)' image_description: |- Light render (plot-light.png): - Background: Warm off-white (#FAF8F1) - correct theme color - Chrome: Title "manhattan-gwas · plotly · pyplots.ai" in dark INK (#1A1A17), axis labels and tick labels in INK_SOFT (#4A4A44) - all clearly readable - Data: Alternating green (#009E73) and orange (#D55E00) for chromosomes with opacity 0.7; significant SNPs highlighted as orange diamonds with white edges; subtle y-axis grid visible - Legibility verdict: PASS - all text elements readable with proper contrast + Background: Warm off-white (#FAF8F1) ✓ + Chrome: Title, axis labels, tick labels all explicitly sized (28/22/18px) and readable in dark ink; threshold annotations clearly visible on right + Data: Alternating green (#009E73) and orange (#D55E00) chromosome blocks with overlaid scatter points; significant SNPs highlighted as larger orange diamonds; dashes and dots for threshold lines + Legibility verdict: PASS (all text readable against light background; no light-on-light issues) Dark render (plot-dark.png): - Background: Warm near-black (#1A1A17) - correct theme color - Chrome: Title and labels in light INK (#F0EFE8) and INK_SOFT (#B8B7B0) - all clearly readable; no dark-on-dark failures - Data: Identical colors to light render (green and orange for chromosomes, orange for significant SNPs); grid lines visible with light coloring - Legibility verdict: PASS - all text readable, no contrast issues, proper theme adaptation confirmed + Background: Warm near-black (#1A1A17) ✓ + Chrome: All text light-colored (INK #F0EFE8 and INK_SOFT #B8B7B0) with sufficient contrast; grid visible at appropriate opacity; legend background themed + Data: Colors identical to light render (same green and orange for chromosomes); scatter and diamond markers equally distinct + Legibility verdict: PASS (all text readable against dark background; no dark-on-dark failures; data colors stable across themes) criteria_checklist: visual_quality: - score: 30 + score: 29 max: 30 items: - id: VQ-01 @@ -46,67 +46,68 @@ review: score: 8 max: 8 passed: true - comment: Font sizes properly scaled; all readable in both themes + comment: All sizes explicitly set; perfect readability in both themes - id: VQ-02 name: No Overlap score: 6 max: 6 passed: true - comment: Clean spacing, no text collisions + comment: No collisions; all elements well-spaced - id: VQ-03 name: Element Visibility score: 6 max: 6 passed: true - comment: Opacity appropriate for density; significant SNPs highlighted + comment: Dense scatter appropriately handled; significant SNPs clearly stand + out - id: VQ-04 name: Color Accessibility score: 2 max: 2 passed: true - comment: Okabe-Ito palette CVD-safe + comment: CVD-safe palette; good contrast; adequate alpha - id: VQ-05 name: Layout & Canvas - score: 4 + score: 3 max: 4 - passed: true - comment: 4800×2700 px with proper margins + passed: false + comment: Good proportions; could use more generous whitespace - id: VQ-06 name: Axis Labels & Title score: 2 max: 2 passed: true - comment: Descriptive labels with proper notation + comment: Descriptive with units and context - id: VQ-07 name: Palette Compliance score: 2 max: 2 passed: true - comment: 'First categorical #009E73; backgrounds theme-correct' + comment: Okabe-Ito correct; backgrounds and chrome theme-adaptive design_excellence: - score: 12 + score: 15 max: 20 items: - id: DE-01 name: Aesthetic Sophistication score: 5 max: 8 - passed: true - comment: Professional polish, proper theme adaptation; straightforward execution + passed: false + comment: Above defaults but not Nature-level exceptional - id: DE-02 name: Visual Refinement - score: 3 + score: 5 max: 6 - passed: true - comment: Subtle grid, generous whitespace; minimal customization + passed: false + comment: Spines removed, subtle grid, good whitespace - id: DE-03 name: Data Storytelling - score: 4 + score: 5 max: 6 - passed: true - comment: Threshold lines guide eye; peaks emphasized; visual rhythm + passed: false + comment: Clear visual hierarchy; immediate insight into peaks and significance spec_compliance: - score: 15 + score: 12 max: 15 items: - id: SC-01 @@ -114,25 +115,25 @@ review: score: 5 max: 5 passed: true - comment: Correct Manhattan plot implementation + comment: Correct Manhattan plot with proper structure - id: SC-02 name: Required Features score: 4 max: 4 passed: true - comment: All features present and correct + comment: 'All GWAS features present: thresholds, highlights, colors' - id: SC-03 name: Data Mapping score: 3 max: 3 passed: true - comment: Axes correctly mapped + comment: X/Y correctly assigned; all data visible - id: SC-04 name: Title & Legend - score: 3 + score: 1 max: 3 - passed: true - comment: Proper formatting + passed: false + comment: 'CRITICAL: title says pyplots.ai instead of anyplot.ai' data_quality: score: 15 max: 15 @@ -142,19 +143,19 @@ review: score: 6 max: 6 passed: true - comment: Realistic GWAS with interpretable peaks + comment: All GWAS aspects shown - id: DQ-02 name: Realistic Context score: 5 max: 5 passed: true - comment: Realistic distribution, no controversies + comment: Plausible scientific data - id: DQ-03 name: Appropriate Scale score: 4 max: 4 passed: true - comment: Proper thresholds and ranges + comment: Factually correct genome structure and thresholds code_quality: score: 10 max: 10 @@ -164,58 +165,58 @@ review: score: 3 max: 3 passed: true - comment: Simple, clean implementation + comment: Clean linear flow - id: CQ-02 name: Reproducibility score: 2 max: 2 passed: true - comment: Seed set for reproducibility + comment: Seed 42 set - id: CQ-03 name: Clean Imports score: 2 max: 2 passed: true - comment: Only used imports + comment: Only necessary imports - id: CQ-04 name: Code Elegance score: 2 max: 2 passed: true - comment: Appropriate complexity + comment: Clean and Pythonic - id: CQ-05 name: Output & API score: 1 max: 1 passed: true - comment: Correct file naming + comment: Correct file names and current API library_mastery: - score: 6 + score: 8 max: 10 items: - id: LM-01 name: Idiomatic Usage - score: 4 + score: 5 max: 5 passed: true - comment: Proper plotly patterns and API usage + comment: Expert Plotly patterns - id: LM-02 name: Distinctive Features - score: 2 + score: 3 max: 5 - passed: true - comment: Hover tooltips and interactive HTML; mostly standard + passed: false + comment: Good use of interactive features; not extraordinarily distinctive verdict: APPROVED impl_tags: dependencies: [] techniques: - - manual-ticks - annotations - hover-tooltips - - html-export + - manual-ticks patterns: - data-generation - iteration-over-groups dataprep: [] styling: + - publication-ready - alpha-blending