Skip to content

Issue 71#97

Merged
leopoldguyot merged 3 commits into
mainfrom
issue_71
Jun 9, 2026
Merged

Issue 71#97
leopoldguyot merged 3 commits into
mainfrom
issue_71

Conversation

@leopoldguyot

Copy link
Copy Markdown
Collaborator

#71

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for filtering rows/columns based on missing values (Issue #71) by introducing explicit missingness operators and wiring them through the Shiny filtering UI, runtime filtering logic, code generation, and test coverage.

Changes:

  • Adds new filtering operators: is_missing and is_not_missing, including UI/operator plumbing and condition spec handling.
  • Extends the annotation plot logic to render a dedicated “missing vs not missing” plot for missingness filters.
  • Adds test coverage for missingness operators across operator application, sample/feature filtering, code generation, and plotting.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/testthat/test-filtering.R Adds tests covering missingness operators end-to-end (operator application, filtering, code generation output, and plot behavior).
R/server_module_filtering_tab.R Enables condition specs with NULL values when the operator is a missingness operator; adds operator helpers and missingness handling in apply_filter_operator().
R/server_module_filtering_box.R Adds missingness operators to the UI, hides the value input for missingness, and introduces missingness-specific plot value mapping and plotting wrapper.
R/code_generator_processQFeatures.R Extends codeGeneratorFiltering() to emit is.na(...) / !is.na(...) conditions for missingness operators.
Comments suppressed due to low confidence (2)

R/code_generator_processQFeatures.R:399

  • The generated code for categorical != uses !(x %in% ...), which evaluates to TRUE for NA values and therefore keeps missing annotations. In the interactive filtering path, scalar != produces NA for missing values which is later coerced to FALSE, so the generated code can diverge from the GUI behavior. Adding an !is.na(...) guard aligns generated code with the filtering semantics and with the new explicit missingness operators.
                    } else if (condition[[i]]$operator == "!=") {
                        build_condition <- paste0("!(rowData(se)[[", annotation, "]] %in% ")
                        vector <- paste0(as_r_vector_literal(condition[[i]]$value), ")")

R/code_generator_processQFeatures.R:462

  • Same as the features branch: the generated code for categorical != on colData will keep NA values because !(NA %in% ...) is TRUE. If missing values should only be included/excluded via is_missing/is_not_missing, add an !is.na(...) guard to keep generated code consistent with runtime filtering.
                    } else if (condition[[i]]$operator == "!=") {
                        build_condition <- paste0("!(colData(se)[[", annotation, "]] %in% ")
                        vector <- paste0(as_r_vector_literal(condition[[i]]$value), ")")

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/testthat/test-filtering.R Outdated
@leopoldguyot leopoldguyot merged commit 21ffec6 into main Jun 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants