ggiraph package 0.8.11 compatibility - #27
Open
stevemussmann wants to merge 9 commits into
Open
Conversation
ltalignani
referenced
this pull request
in ltalignani/microhaplot-2
Jul 22, 2026
Adds fieldSelectorModule.R — a reusable moduleServer providing current_group/current_indiv/current_locus reactives, to be consumed by the upcoming Genotype Call (#25/#26) and Criteria Cutoff (#27) tabs. Key decision: selection state is tracked in server-side reactiveVal()s rather than read directly off input$group/input$indiv/input$locus. updateSelectInput() only pushes a value to the browser widget — it never loops back into input$<id> outside a real browser round-trip, so shiny::testServer() can't observe the effect of updateSelectInput() on input$x. Routing all reads/writes through reactiveVal()s makes the "changing group resets individual to first of group" and prev/next navigation logic directly testable, while updateSelectInput() calls remain as a one-way sync to keep the real browser widgets in sync. Files changed: - app/R/fieldSelectorModule.R (new): fieldSelectorUI/fieldSelectorServer - app/app.R: source the new module (not yet wired into the navbar — #25 will add the Genotype Call tab that consumes it) - tests/testthat/test-field-selector-server.R (new): 6 testServer cycles covering population from haplo_data, group-change reset, individual and locus prev/next navigation with clamping, manual dropdown selection, and the no-data state Verification: full R test suite run — 417 pass, 1 pre-existing unrelated failure in test-input-validation.R:118 (BAI path matching, present before this change). Blockers/notes for next iteration: #25 (Genotype Call > AR Refinement) and #26 (Summaries) are unblocked by this and should add a "Genotype Call" nav_panel in app.R wiring fieldSelectorUI/fieldSelectorServer alongside their own sub-tab content. #27 (Criteria Cutoff) is independently unblocked and does not need this module (reads haplo_data directly). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ltalignani
referenced
this pull request
in ltalignani/microhaplot-2
Jul 22, 2026
…ofiling Adds a new "Criteria Cutoff" navbar tab reading haplo_data directly (no blockers). Global sliders (min.depth.homo, min.depth.het, min.ar) drive three plots: read depth histogram with threshold lines, rank-2 allele ratio histogram with threshold line, and an individual x locus coverage heatmap (pass/fail/missing). Key decisions: - Coverage status per individual x locus picks min_depth_het when a rank-2 haplotype was observed for that combo (heterozygote candidate), else min_depth_homo — mirrors how Genotype Call (#25) will classify homozygote vs heterozygote calls. - locus_coverage_status() builds the full id x locus grid via expand.grid so combos absent from haplo_data show up as "missing" rather than being silently dropped, which a plain group_by/summarise would do. - Threshold values are read straight from sliders via input$ (not routed through reactiveVal() like fieldSelectorModule/#24) because shiny::testServer correctly reflects direct input$ writes via session$setInputs() — the updateSelectInput() round-trip problem from #24 only applies to select/updateSelectInput, not sliders. Files changed: - app/R/criteria_cutoff.R (new): default_criteria_params(), total_depth_by_indiv_locus(), rank2_ar_values(), locus_coverage_status() - app/R/criteriaCutoffModule.R (new): criteriaCutoffUI/criteriaCutoffServer — exposes $thresholds and $has_data reactives for downstream consumers - app/app.R: source new files, add "Criteria Cutoff" nav_panel, wire criteriaCutoffServer in the main server function - tests/testthat/test-criteria-cutoff.R (new): 8 tests for the pure aggregation/classification helpers - tests/testthat/test-criteria-cutoff-server.R (new): 4 testServer cycles covering threshold defaults, slider reactivity, and has_data state Verification: full R test suite — 447 pass, 1 pre-existing unrelated failure in test-input-validation.R:118 (BAI path matching, present before this change). Blockers/notes for next iteration: criteria_res$thresholds is returned from criteriaCutoffServer in app.R but not yet consumed by the filtering pipeline or Genotype Call tab, since #25/#26 (Genotype Call) don't exist yet — same "computed but not yet wired downstream" pattern #24 used for fieldSelectorModule. When #25/#26 land, thread criteria_res$thresholds() into their diplotype-calling logic, and consider feeding it into filterAnnotationServer's global params as the new baseline. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ltalignani
referenced
this pull request
in ltalignani/microhaplot-2
Jul 22, 2026
Key decisions: - criteriaCutoffModule now receives filter_params (per-locus, from #30) and current_locus (from #29) as reactive args instead of owning its own min_depth_homo/min_depth_het/min_ar sliders — those and the "Save thresholds" button are removed along with the old locus_coverage heatmap. - Two bslib::navset_tab sub-tabs: Global Scope (allReadDepth/allAllelicRatio histograms across all id x locus with a dashed threshold line from the active locus's filter_params row; haplabel/hapReadDepth/hapAllelicRatio per-haplotype views + RDnARplot scatter, all scoped to current_locus) and Quality Profiling (sliderTextInput("rdMin") + Update button drives ambigIndivPlot/ambigLociPlot with an x-brush, and indivProfileTbl DT). - "Ambiguous" id x locus combos are defined as more ranks passing rdMin than the locus's n.alleles cap (from filter_params) — a stand-in for the v1 "> n.alleles qualified haplotypes" semantics, since #30 replaced the old global thresholds with per-locus filter_params. - Located the legacy v1 plot logic (ggiraph/shinyBS-based) in upstream commit 2554654 and used it to understand intent, not ported verbatim — reimplemented with this project's ggplot2/DT/bslib conventions instead. - total_depth_by_indiv_locus() and rank2_ar_values() are kept from #27 and repurposed to feed the new Global Scope histograms; default_criteria_params() and locus_coverage_status() are removed as superseded. Files changed: app/app.R, app/R/criteria_cutoff.R, app/R/criteriaCutoffModule.R, tests/testthat/test-criteria-cutoff.R, tests/testthat/test-criteria-cutoff-server.R, CHANGELOG.md, issues/32-criteria-cutoff-v1-plots.md -> issues/done/ Full suite: 639 PASS, 1 pre-existing FAIL (test-input-validation.R:118, unrelated BAI path matching), 21 WARN (pre-existing Bioc version mismatches). Blockers/notes for next iteration: no open issues remain in issues/ — all AFK tasks (#21-#32) are complete. The brush inputs on ambigIndivPlot/ ambigLociPlot are wired but not yet consumed downstream (no exclusion action); a future issue could wire them to an exclusion reactive if needed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
The ggiraph R package changed the names of some function calls and I have updated these in a fork of the microhaplot code to make it compatible with ggiraph v0.8.11. The function
ggiraphOutputis nowgirafeOutputandrenderggiraphis nowrenderGirafe.Thank you for your consideration in adding these updates,
-Steve