fix: volcano summary feature handling and layout - #239
Conversation
for more information, see https://pre-commit.ci
_commit message is ai-generated_
_commit message is ai-generated_
There was a problem hiding this comment.
Pull request overview
This PR updates MOSuite’s volcano summary plotting so it correctly supports non-Gene feature ID columns, and switches the summary plot rendering to reuse the existing plot_volcano_enhanced() implementation (stitching multiple EnhancedVolcano plots into a grid with appropriately scaled output dimensions and updated axis/legend labeling).
Changes:
- Add a regression test ensuring
plot_volcano_summary()respects a non-Genefeature ID column. - Refactor
plot_volcano_summary()to delegate plotting toplot_volcano_enhanced()(grid stitching + scaled output size). - Extend
plot_volcano_enhanced()with tick-label sizing, improved legend labels (p-value vs FDR), and configurable grid layout scaling; updateNEWS.mdand Rd files accordingly.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/testthat/test-plot_volcano_summary.R | Adds coverage for non-Gene feature ID column handling. |
| R/plot_volcano_summary.R | Delegates summary plotting to plot_volcano_enhanced() and threads new axis sizing params. |
| R/plot_volcano_enhanced.R | Adds tick label sizing, legend label alignment, and grid-aware output dimension scaling. |
| NEWS.md | Adds a user-facing entry for the volcano summary fixes. |
| man/plot_volcano_summary.Rd | Documents new axis label/tick sizing parameters. |
| man/plot_volcano_enhanced.Rd | Documents new tick sizing and grid layout/output scaling parameters. |
Files not reviewed (2)
- man/plot_volcano_enhanced.Rd: Generated file
- man/plot_volcano_summary.Rd: Generated file
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 11 changed files in this pull request and generated 3 comments.
Files not reviewed (2)
- man/plot_volcano_enhanced.Rd: Generated file
- man/plot_volcano_summary.Rd: Generated file
Comments suppressed due to low confidence (3)
R/plot_volcano_summary.R:57
plot_volcano_summary()is exported butaspect_ratiohas been removed from the public signature. Any external caller (including internal tooling) still passingaspect_ratiowill now error with an unused argument; the repo’s Galaxy metadata still references this parameter (inst/extdata/galaxy/0_nidap-1.0/missing_parameters.csv:12). Consider keepingaspect_ratioas a deprecated argument (even if ignored) or adding...to allow older callers to continue working while they are updated.
image_width = 15,
image_height = 15,
dpi = 300,
use_default_grid_layout = TRUE,
number_of_rows_in_grid_layout = 1,
plot_filename = "volcano_summary.png",
inst/extdata/json_args/defaults/plot_volcano_enhanced.json:27
- The defaults JSON for
plot_volcano_enhancedhasn’t been updated for newly added styling/grid parameters in the R function signature (e.g.,axis_tick_lab_size, label colors, point/threshold colors, and grid layout controls). If this JSON is used for CLI/config defaults, those arguments will be unavailable and may be dropped during parsing.
"axis_lab_size": 24,
"point_size": 2,
"image_width": 3000,
inst/extdata/json_args/common/plot_volcano_enhanced.json:27
- The common JSON args for
plot_volcano_enhancedhasn’t been updated for newly added styling/grid parameters in the R function signature (e.g.,axis_tick_lab_size, label colors, point/threshold colors, and grid layout controls). This can make these options unavailable/ignored when building configs from the common JSON.
"axis_lab_size": 24,
"point_size": 2,
"image_width": 3000,
for more information, see https://pre-commit.ci
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #239 +/- ##
==========================================
+ Coverage 82.55% 83.82% +1.27%
==========================================
Files 23 24 +1
Lines 4024 4137 +113
==========================================
+ Hits 3322 3468 +146
+ Misses 702 669 -33 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
kelly-sovacool
left a comment
There was a problem hiding this comment.
A test is failing, looks like a snapshot just needs to be updated
https://github.com/CCBR/MOSuite/actions/runs/30355909218/job/90263993915?pr=239#step:5:1407
@kelly-sovacool so there are additional warnings when running on github, see below. Should i apply the changes highlighted in this message? Condition |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 13 changed files in this pull request and generated no new comments.
Files not reviewed (3)
- man/plot_venn_diagram.Rd: Generated file
- man/plot_volcano_enhanced.Rd: Generated file
- man/plot_volcano_summary.Rd: Generated file
Comments suppressed due to low confidence (2)
R/plot_volcano_enhanced.R:357
- When
label_significant_features_onlyfilters out most/all rows,df_sub[1:num_features_to_label, ...]can returnNAlabels (or evenNA-filled rows). ThoseNAvalues then flow intogenes_to_label/selectLaband can produce incorrect labeling behavior or warnings/errors. Guard against emptydf_suband explicitly dropNA/empty labels before callingEnhancedVolcano().
if (label_significant_features_only) {
df_sub <- df[
df[[sig_name]] <= signif_threshold &
abs(df[[lfc_name]]) >= change_threshold,
]
} else {
df_sub <- df
}
genes_to_label <- as.character(df_sub[1:num_features_to_label, label_col])
split_values <- unlist(strsplit(gsub(",", " ", custom_gene_list), " "))
man/plot_venn_diagram.Rd:184
- The
plot_filenamedocumentation here claims that when multiple comparisons are saved separately, the comparison name is appended to the filename.plot_venn_diagram()only saves a single output plot and does not implement per-comparison filename suffixing, so this sentence is misleading and should be removed for this function.
previously, default signif & logfc colnames were hard-coded to contrasts from the nidap dataset. now they are automatically detected if not provided based on the adjpval and logFC suffixes, and both plot_volcano_summary and plot_volcano_enhanced share the same strategy for identifying the correct column names.
…uite into VolcanoSummaryFeatureCol
Changes
plot_volcano_summary()to respect non-Genefeature ID columns.plot_volcano_enhanced()so individual EnhancedVolcano plots are stitched into a grid.p-valueversusFDR).NEWS.mdfor PR fix: volcano summary feature handling and layout #239.Issues
No linked issue.
PR Checklist
NEWS.mdwith a short description of any user-facing changes and reference the PR number. Follow the style described in https://style.tidyverse.org/news.htmldevtools::check()locally and fix all notes, warnings, and errors.