Skip to content

Sample pca filtering#60

Open
loguille wants to merge 3 commits intoUCLouvain-CBIO:mainfrom
loguille:sample_pca_filtering
Open

Sample pca filtering#60
loguille wants to merge 3 commits intoUCLouvain-CBIO:mainfrom
loguille:sample_pca_filtering

Conversation

@loguille
Copy link
Copy Markdown
Collaborator

@loguille loguille commented Apr 8, 2026

Not sure about color_width button, should we remove it ?

@leopoldguyot
Copy link
Copy Markdown
Member

Not sure about color_width button, should we remove it ?

Not sure about color_width button, should we remove it ?

#61

selectInput(
inputId = NS(id, "selected_assay"),
choices = NULL,
label = "Select set"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Select set for which to apply the dimension reduction

Copy link
Copy Markdown
Member

@leopoldguyot leopoldguyot left a comment

Choose a reason for hiding this comment

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

Should we use the term "PCA" or "Dimension Reduction" ?

@loguille
Copy link
Copy Markdown
Collaborator Author

loguille commented Apr 9, 2026

Should we use the term "PCA" or "Dimension Reduction" ?

Dimension Reduction sounds better for what the page displays

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the QC metrics PCA UI/server logic to use a single “Dimension Reduction” plot driven by a shared set of parameters (method, orientation, scaling/centering, and coloring), instead of separate “features” and “samples” PCA boxes.

Changes:

  • Adds a shared parameter panel (assay type, method, color-by, scaling/centering, legend, color label truncation length).
  • Moves PCA color-choice population to server_module_qc_metrics() and passes PCA parameters into server_module_pca_box() as reactives.
  • Simplifies interface_module_pca_box() to only render the Plotly output (no dedicated box/sidebar inside the submodule).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
R/server_module_qc_metrics.R Centralizes PCA parameter handling and updates server_module_pca_box() to accept reactives and compute samples/features PCA based on pca_type.
R/interface_module_qc_metrics.R Reworks the QC metrics UI layout into a parameters box + single dimension reduction plot, and simplifies the PCA UI submodule.

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

Comment on lines +22 to +27
selectInput(
inputId = NS(id, "assay_type"),
choices = c("samples", "features"),
label = "Select dimension reduction type",
selected = "samples"
),
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

interface_module_qc_metrics() receives a type argument (passed by interface_module_filtering_tab() as either "samples" or "features"), but the new assay_type selector is hard-coded to selected = "samples" and the type argument is otherwise unused. This makes the default PCA orientation inconsistent with the filtering tab type. Consider validating type via match.arg() and using it as the default selected value (or remove the type parameter entirely if it’s no longer intended to control the UI).

Copilot uses AI. Check for mistakes.
#' @importFrom methods is
#'
server_module_pca_box <- function(id, single_assay, method, transpose) {
server_module_pca_box <- function(id, single_assay, method, pca_type, scale, center, show_legend, color, color_width) {
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The roxygen documentation for server_module_pca_box() is now out of sync with the function signature and behavior (it still documents transpose and says only "nipals" is valid, but the function now takes pca_type, scale, center, show_legend, color, and color_width, and transpose is derived from pca_type()). Please update the @param entries to match the new arguments and semantics.

Copilot uses AI. Check for mistakes.
Comment on lines +104 to 109
interface_module_pca_box <- function(id) {
with_output_waiter(plotlyOutput(outputId = NS(id, "pca")),
html = waiter::spin_6(),
color = "transparent"
)
}
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The roxygen documentation for interface_module_pca_box() is outdated: it still documents a title parameter and describes returning a box/boxSidebar, but the function now only returns the plotlyOutput wrapped with with_output_waiter(). Please update/remove the stale @param title and adjust the return description/import tags accordingly.

Copilot uses AI. Check for mistakes.
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.

3 participants