Skip to content

fix: volcano summary feature handling and layout - #239

Merged
kelly-sovacool merged 40 commits into
mainfrom
VolcanoSummaryFeatureCol
Jul 30, 2026
Merged

fix: volcano summary feature handling and layout#239
kelly-sovacool merged 40 commits into
mainfrom
VolcanoSummaryFeatureCol

Conversation

@phoman14

@phoman14 phoman14 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Fix plot_volcano_summary() to respect non-Gene feature ID columns.
  • Delegate volcano summary plotting to plot_volcano_enhanced() so individual EnhancedVolcano plots are stitched into a grid.
  • Scale saved volcano summary output dimensions by grid rows/columns so each stitched plot keeps its single-plot proportions.
  • Add separate axis tick label sizing and align volcano legend significance labels with the y-axis (p-value versus FDR).
  • Update NEWS.md for PR fix: volcano summary feature handling and layout #239.

Issues

No linked issue.

PR Checklist

  • This comment contains a description of changes with justifications, with any relevant issues linked.
  • Write unit tests for any new features, bug fixes, or other code changes.
  • Update the docs if there are any API changes (roxygen2 comments, vignettes, readme, etc.).
  • Update NEWS.md with a short description of any user-facing changes and reference the PR number. Follow the style described in https://style.tidyverse.org/news.html
  • Run devtools::check() locally and fix all notes, warnings, and errors.

@github-actions github-actions Bot added the MOSuite RepoName label Jul 27, 2026
_commit message is ai-generated_

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

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-Gene feature ID column.
  • Refactor plot_volcano_summary() to delegate plotting to plot_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; update NEWS.md and 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

Comment thread R/plot_volcano_summary.R Outdated
Comment thread R/plot_volcano_summary.R
Comment thread R/plot_volcano_enhanced.R Outdated
Comment thread R/plot_volcano_enhanced.R Outdated

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

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 but aspect_ratio has been removed from the public signature. Any external caller (including internal tooling) still passing aspect_ratio will 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 keeping aspect_ratio as 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_enhanced hasn’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_enhanced hasn’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,

Comment thread R/plot_volcano_enhanced.R Outdated
Comment thread inst/extdata/json_args/defaults/plot_volcano_summary.json Outdated
Comment thread inst/extdata/json_args/common/plot_volcano_summary.json Outdated
@kelly-sovacool kelly-sovacool changed the title Fix volcano summary feature handling and layout fix: volcano summary feature handling and layout Jul 27, 2026
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.58859% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.82%. Comparing base (255bfb9) to head (eca71fd).

Files with missing lines Patch % Lines
R/plot_volcano_enhanced.R 81.12% 37 Missing ⚠️
R/plot_volcano_summary.R 99.08% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kelly-sovacool kelly-sovacool left a comment

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.

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

@phoman14

Copy link
Copy Markdown
Contributor Author

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
Warning:
Using size aesthetic for lines was deprecated in ggplot2 3.4.0.
i Please use linewidth instead.
i The deprecated feature was likely used in the EnhancedVolcano package.
Please report the issue to the authors.
Warning:
The size argument of element_line() is deprecated as of ggplot2 3.4.0.
i Please use the linewidth argument instead.
i The deprecated feature was likely used in the EnhancedVolcano package.
Please report the issue to the authors.

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

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_only filters out most/all rows, df_sub[1:num_features_to_label, ...] can return NA labels (or even NA-filled rows). Those NA values then flow into genes_to_label/selectLab and can produce incorrect labeling behavior or warnings/errors. Guard against empty df_sub and explicitly drop NA/empty labels before calling EnhancedVolcano().
    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_filename documentation 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.

phoman14 and others added 7 commits July 28, 2026 19:08
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.
@kelly-sovacool

Copy link
Copy Markdown
Member

There was a bug in plot_volcano_enhanced where it was only plotting two contrasts instead of all three. I fixed it in 92333bd. @phoman14 take a look and let me know what you think!

@kelly-sovacool
kelly-sovacool marked this pull request as ready for review July 30, 2026 19:08
@kelly-sovacool
kelly-sovacool enabled auto-merge (squash) July 30, 2026 19:15
@kelly-sovacool
kelly-sovacool disabled auto-merge July 30, 2026 19:40
@kelly-sovacool
kelly-sovacool merged commit c5840ed into main Jul 30, 2026
12 checks passed
@kelly-sovacool
kelly-sovacool deleted the VolcanoSummaryFeatureCol branch July 30, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants