Skip to content

Fix ANOVA and pairwise gene set enrichment and spatial registration plot visualization - #125

Closed
manishabarse wants to merge 7 commits into
develfrom
app_layer_colors
Closed

manishabarse wants to merge 7 commits into
develfrom
app_layer_colors

Conversation

@manishabarse

@manishabarse manishabarse commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Overview

I noticed that some plots failed because the color mappings did not include pairwise spatial domain (SpD) comparisons (e.g., L1-L2) or the overall ANOVA result. ANOVA gene set enrichment also encountered issues with result column names and single-column data frames being simplified to vectors.

Changes

  • Add color handling for pairwise SpD comparisons by deriving colors from the corresponding domain colors.
  • Use neutral grey for overall ANOVA results, which do not represent individual SpDs.
  • Standardize ANOVA result column names for downstream plotting.
  • Preserve data frame structure for single-column ANOVA results using drop = FALSE.
  • Add golem:: to the app launch function.
  • Add scales to DESCRIPTION for color interpolation.
  • Extend get_colors() to support assigning spatialLIBD layer colors based on cluster labels.
  • Document the custom color assignment functionality in run_app() and the spatialLIBD vignette.

Implementation

  • Automatically generate midpoint colors for pairwise comparisons from the user-supplied colors of the corresponding SpDs, so users do not need to define colors for every pairwise comparison.
  • Use a grey fallback when colors for the corresponding SpDs are unavailable.
  • Handle overall ANOVA result colors separately from the colors used for enrichment and pairwise statistics.
  • Normalize ANOVA result column names in the app without modifying the original modeling results.
  • Add an optional logical argument to get_colors() to use spatialLIBD layer colors when cluster labels match the available libd_layer names.
  • Explain how users can supply custom cluster colors through the run_app() documentation and spatialLIBD vignette.

Validation / Testing

  • Tested the updated plotting code locally in RStudio using the example from the run_app.R script.
  • Tested the functionality with the DLPFC_ASD dataset.
  • Verified that ANOVA gene set enrichment and spatial registration plots handle SpD colors as expected.
  • Tested the updated cluster color assignment functionality.
  • Checked the plots with @Nick-Eagles and we think ANOVA plots look as would be expected.

@Nick-Eagles

Copy link
Copy Markdown
Member

Thanks so much for the fixes and clearly documenting everything! I incorporated these fixes separate from this pull request (with your help), so I'll close it

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