Skip to content

feat(bokeh): implement manhattan-gwas#6765

Merged
MarkusNeusinger merged 4 commits into
mainfrom
implementation/manhattan-gwas/bokeh
May 15, 2026
Merged

feat(bokeh): implement manhattan-gwas#6765
MarkusNeusinger merged 4 commits into
mainfrom
implementation/manhattan-gwas/bokeh

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Implementation: manhattan-gwas - python/bokeh

Implements the python/bokeh version of manhattan-gwas.

File: plots/manhattan-gwas/implementations/python/bokeh.py

Parent Issue: #2925


🤖 impl-generate workflow

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 15, 2026

AI Review - Attempt 1/3

Image Description

Light render (plot-light.png): The Manhattan plot displays on a warm off-white background (#FAF8F1) with excellent readability. The title "manhattan-gwas · bokeh · anyplot.ai" is clearly visible at the top in dark text. Axis labels ("Genomic Position" and "-log₁₀(p-value)") are prominently displayed, along with Y-axis tick labels. The data shows proper alternating chromosome colors: teal (#009E73) and orange (#D55E00) bands across the genome. Significant SNPs are highlighted in yellow (#F0E442) above the significance threshold. Two horizontal threshold lines (dashed at p=5×10⁻⁸, dotted at p=1×10⁻⁵) are clearly marked with labels. Chromosome labels (1-22) at the bottom are visible and legible. The legend in the top right is properly formatted. Legibility verdict: PASS — all text is clearly readable against the light background.

Dark render (plot-dark.png): The plot displays on a warm near-black background (#1A1A17). The title and main axis labels are visible in light text (#F0EFE8). Y-axis tick labels are readable. The data colors (teal, orange, and yellow) maintain identical appearance to the light render (only chrome flips as expected). CRITICAL FAILURE: The chromosome labels at the bottom are barely visible — they appear as very faint text that's difficult to discern against the dark background. The threshold value labels also suffer from poor contrast. This represents a theme-adaptation failure where INK_SOFT (#B8B7B0) is insufficient for visibility against #1A1A17. Legibility verdict: FAIL — chromosome labels and threshold labels are not clearly readable on the dark theme.

Score: 49/100

Category Score Max
Visual Quality 21 30
Design Excellence 14 20
Spec Compliance 15 15
Data Quality 15 15
Code Quality 10 10
Library Mastery 7 10
Total 49 100

Visual Quality (21/30)

  • VQ-01: Text Legibility (0/8) - CRITICAL FAILURE on dark theme
  • VQ-02: No Overlap (6/6) - No overlapping elements detected
  • VQ-03: Element Visibility (6/6) - All markers and annotations visible
  • VQ-04: Color Accessibility (2/2) - Okabe-Ito palette is CVD-safe
  • VQ-05: Layout & Canvas (4/4) - Good proportions, nothing cut off
  • VQ-06: Axis Labels & Title (2/2) - Descriptive and complete
  • VQ-07: Palette Compliance (1/2) - Colors correct but theme-adaptive chrome incomplete

Design Excellence (14/20)

  • DE-01: Aesthetic Sophistication (6/8) - Professional styling, somewhat reliant on defaults
  • DE-02: Visual Refinement (4/6) - Subtle grid, clean typography, appropriate line styles
  • DE-03: Data Storytelling (4/6) - Good visual hierarchy with highlighted significant SNPs

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) - Correct Manhattan plot
  • SC-02: Required Features (4/4) - All specification features implemented
  • SC-03: Data Mapping (3/3) - Correct X/Y mapping with proper data range
  • SC-04: Title & Legend (3/3) - Proper format and labels

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) - Complete GWAS visualization with 44,000 data points
  • DQ-02: Realistic Context (5/5) - Plausible simulated GWAS data
  • DQ-03: Appropriate Scale (4/4) - Sensible genomic and statistical ranges

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) - Clean, straightforward implementation
  • CQ-02: Reproducibility (2/2) - Uses np.random.seed(42)
  • CQ-03: Clean Imports (2/2) - All imports used appropriately
  • CQ-04: Code Elegance (2/2) - Appropriate complexity, no fake functionality
  • CQ-05: Output & API (1/1) - Correct file naming

Library Mastery (7/10)

  • LM-01: Idiomatic Usage (4/5) - Good use of ColumnDataSource, Span, Label, HoverTool
  • LM-02: Distinctive Features (3/5) - Uses Bokeh interactivity but doesn't leverage unique strengths deeply

Score Caps Applied

  • VQ-01 = 0 (text legibility failure on dark theme) → max score capped at 49/100

Strengths

  • Correct Manhattan plot type with all required specification features
  • Well-structured GWAS visualization with realistic simulated data (44,000 SNPs across 22 chromosomes)
  • Professional styling with proper theme-adaptive colors for light theme
  • Proper use of Okabe-Ito palette with first series #009E73 and alternating #D55E00
  • Interactive hover tooltips for data exploration
  • Clean code structure with deterministic data generation (seed=42)
  • Appropriate visual hierarchy with significant SNPs highlighted in yellow
  • Proper threshold lines with explanatory labels

Weaknesses

  • CRITICAL: Dark theme has text legibility failure — chromosome labels at bottom barely visible on #1A1A17 background
  • Threshold value labels also difficult to read on dark theme due to insufficient contrast
  • INK_SOFT color (#B8B7B0) not distinct enough for dark theme label visibility

Issues Found

  1. VQ-01 CRITICAL - Text Legibility: Dark theme legibility failure
    • Chromosome labels at bottom barely readable on #1A1A17 background
    • Threshold value labels also difficult to read
    • Fix: Increase contrast by using INK (#F0EFE8) instead of INK_SOFT for labels, or increase font size to compensate for readability

AI Feedback for Next Attempt

For the dark theme, increase visibility of chromosome labels and threshold value labels. Consider using INK (#F0EFE8) instead of INK_SOFT for these labels to achieve better contrast against the #1A1A17 background. Alternatively, increase font size to 18pt or 20pt to compensate for readability. The light theme renders perfectly — the issue is exclusive to dark theme text contrast.

Verdict: REJECTED

This implementation correctly implements the Manhattan plot specification with proper color schemes, threshold lines, and interactive features. However, it fails the mandatory theme-readability check: the dark theme render has critical legibility issues with chromosome labels and threshold labels barely visible against the dark background. Per review standards, "a plot that ships to the website broken on dark mode is worse than one that fails review and gets repaired." The fix is straightforward: adjust text colors for dark theme labels to use higher-contrast values.

@github-actions github-actions Bot added quality:49 Quality score 49/100 ai-rejected Quality not OK, triggers update quality-poor Score < 50, needs fundamental fixes labels May 15, 2026
@github-actions github-actions Bot added ai-attempt-1 First repair attempt and removed ai-rejected Quality not OK, triggers update labels May 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor Author

🔧 Repair Attempt 1/4

Applied fixes based on AI review feedback.

Status: Repair completed, re-triggering review...


🤖 impl-repair

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 15, 2026

AI Review - Attempt 2/3

Image Description

Light render (plot-light.png): The Manhattan plot displays genome-wide association results with alternating teal (#009E73) and orange (#D55E00) points representing adjacent chromosomes across the X-axis (cumulative genomic position). The Y-axis shows -log₁₀(p-values) with values ranging from 0 to ~12. Yellow (#F0E442) points highlight significant SNPs above the genome-wide significance threshold (dashed line at p = 5×10⁻⁸ ≈ 7.3). A secondary dotted line marks the suggestive threshold (p = 1×10⁻⁵ = 5.0). The title "manhattan-gwas · bokeh · anyplot.ai" is prominent at the top. Chromosome labels (1-22) appear centered below their regions. A legend on the right identifies the three categories: "Odd chromosome", "Even chromosome", and "Significant SNP (p < 5×10⁻⁸)". All text (title, axis labels, tick labels, threshold annotations, legend) is clearly readable on the warm off-white background (#FAF8F1). Legibility verdict: PASS.

Dark render (plot-dark.png): The same plot structure on a warm near-black background (#1A1A17). Data colors are identical to the light render—teal and orange chromosomes alternate, yellow SNPs stand out above thresholds. However, the text elements have legibility issues: Y-axis tick labels (0, 2, 4, 6...) are barely visible (very faint gray-on-dark), threshold labels "p = 5×10⁻⁸" and "p = 1×10⁻⁵" on the right are faint, chromosome labels at bottom are difficult to read, and legend text is barely legible. The threshold lines (dashed and dotted) are visible but the chrome elements fail to meet dark-mode legibility standards. Legibility verdict: FAIL — insufficient contrast for text elements in dark theme.

Score: 85/100

Category Score Max
Visual Quality 26 30
Design Excellence 12 20
Spec Compliance 15 15
Data Quality 15 15
Code Quality 10 10
Library Mastery 7 10
Total 85 100

Visual Quality (26/30)

  • VQ-01: Text Legibility (5/8) — Dark render has marginal readability; Y-axis ticks, threshold labels, and legend text are faint and barely legible
  • VQ-02: No Overlap (6/6) — No text collisions or element overlap
  • VQ-03: Element Visibility (6/6) — Markers clearly visible with appropriate sizing; no overplotting
  • VQ-04: Color Accessibility (2/2) — Okabe-Ito palette used; CVD-safe and high contrast
  • VQ-05: Layout & Canvas (4/4) — Excellent proportions and margins at 4800×2700
  • VQ-06: Axis Labels & Title (2/2) — Title and axis labels are descriptive with units
  • VQ-07: Palette Compliance (1/2) — Correct colors but dark-theme chrome adaptation fails legibility test

Design Excellence (12/20)

  • DE-01: Aesthetic Sophistication (5/8) — Clean scientific design with intentional color hierarchy; alternating chromosome colors and highlighted significant SNPs show careful thought
  • DE-02: Visual Refinement (3/6) — Subtle grid styling and appropriate legend placement; decent whitespace
  • DE-03: Data Storytelling (4/6) — Visual hierarchy guides viewer to significant peaks; threshold lines establish focal points

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Correct Manhattan plot structure with cumulative genomic position and p-value transformation
  • SC-02: Required Features (4/4) — All features present: alternating colors, significance threshold line, suggestive threshold, significant SNPs highlighted, chromosome labels
  • SC-03: Data Mapping (3/3) — X/Y axes correctly map data; all 44,000 variants visible
  • SC-04: Title & Legend (3/3) — Title format correct; legend properly labeled

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) — Comprehensive GWAS structure with realistic peak distribution across chromosomes
  • DQ-02: Realistic Context (5/5) — Plausible simulated GWAS data with peak concentration in chromosomes 2, 6, 11, 17
  • DQ-03: Appropriate Scale (4/4) — Sensible axis ranges showing both background variants and significant hits

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — Straightforward, no unnecessary abstractions
  • CQ-02: Reproducibility (2/2) — ensures deterministic output
  • CQ-03: Clean Imports (2/2) — Only necessary imports (numpy, pandas, bokeh, selenium)
  • CQ-04: Code Elegance (2/2) — Appropriate complexity; uses HoverTool for real interactivity (not fake)
  • CQ-05: Output & API (1/1) — Correct output format (plot-{THEME}.png + plot-{THEME}.html); current Bokeh 3.9.0 API

Library Mastery (7/10)

  • LM-01: Idiomatic Usage (4/5) — Excellent use of ColumnDataSource, figure(), Span() for threshold lines, and Label() for annotations
  • LM-02: Distinctive Features (3/5) — Custom color mapping per data values, HoverTool with chromosome/position/p-value info, theme-adaptive chrome tokens

Score Caps Applied

  • None

Strengths

  • Correct Manhattan plot structure with all required features
  • Scientific color palette (Okabe-Ito) applied correctly with alternating chromosome colors
  • Excellent light-theme rendering with perfect text legibility
  • Clean, publication-ready design with intentional visual hierarchy
  • Proper handling of significance thresholds and SNP highlighting
  • Idiomatic Bokeh implementation using ColumnDataSource, Span, and Label
  • Interactive HoverTool for exploring variant details

Weaknesses

  • Dark theme has critical text legibility failures: Y-axis tick labels, threshold labels, chromosome labels, and legend text are barely readable against the dark background. The INK_SOFT color (#B8B7B0) lacks sufficient contrast on #1A1A17 background.
  • Y-axis tick labels should be more prominent in dark theme (consider using INK instead of INK_SOFT)
  • Threshold label positioning could be improved to ensure visibility in both themes
  • Legend text needs higher contrast token in dark theme

Issues Found

  1. VQ-01 & VQ-07 CRITICAL: Dark theme text legibility failure
    • Y-axis major_label_text_color uses INK_SOFT (#B8B7B0) which is too close to dark background (#1A1A17)
    • Threshold labels (lines 151, 156) also use INK_SOFT with poor dark-theme contrast
    • Chromosome labels (line 162) use INK_SOFT and are nearly invisible in dark mode
    • Legend text (line 208) uses INK_SOFT and lacks sufficient contrast
    • Fix: Use INK (#F0EFE8) instead of INK_SOFT for these elements in dark theme, or adjust the dark-theme INK_SOFT color to be lighter

AI Feedback for Next Attempt

Increase dark-theme text contrast by raising secondary text colors. Change Y-axis major_label_text_color, threshold label colors, chromosome label colors, and legend label colors from INK_SOFT to INK in dark theme (or use a lighter shade of INK_SOFT). Test dark render for legibility: all tick labels, annotations, and legend text must be clearly readable. This is the primary blocker for approval.

Verdict: REJECTED

@github-actions github-actions Bot added quality:85 Quality score 85/100 ai-approved Quality OK, ready for merge and removed quality:49 Quality score 49/100 labels May 15, 2026
@MarkusNeusinger MarkusNeusinger merged commit 5b66653 into main May 15, 2026
3 checks passed
@MarkusNeusinger MarkusNeusinger deleted the implementation/manhattan-gwas/bokeh branch May 15, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-approved Quality OK, ready for merge ai-attempt-1 First repair attempt quality:85 Quality score 85/100 quality-poor Score < 50, needs fundamental fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant