Skip to content

Conversation

@jrobinso
Copy link
Contributor

  • Add dark mode heatmaps for copy number and gene expression.

* Add dark mode heatmaps for copy number and gene expression.
Copy link
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

This PR refactors heatmap legend editing and usage, simplifying the codebase by consolidating color scale management and adding dark mode support for heatmaps.

  • Introduces dark mode color scales for copy number and gene expression heatmaps
  • Refactors color scale management to use string-based keys instead of TrackType enums
  • Simplifies heatmap legend editor by removing unused TrackType parameter

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
test/sessions/wig_heatmap.xml New test session for heatmap rendering with ChipSeq data
test/sessions/gbm_subtypes2.xml New test session for copy number heatmaps
test/sessions/gbm_subtypes.xml Updates resource URLs to use GitHub raw content
src/main/resources/preferences.tab Adds dark mode color scale preferences for copy number and gene expression
src/main/java/org/igv/ui/legend/HeatmapLegendEditor.java Removes TrackType parameter from constructor
src/main/java/org/igv/ui/HeatmapScaleDialog.java Removes unused main method
src/main/java/org/igv/track/TrackMenuUtils.java Refactors heatmap scale dialog to use lambda and adds null safety for color scales
src/main/java/org/igv/track/MergedTracks.java Removes redundant getColorScale override
src/main/java/org/igv/track/FeatureTrack.java Removes manual color scale range adjustment
src/main/java/org/igv/track/AbstractTrack.java Refactors getColorScale to check preferences by key and simplifies logic
src/main/java/org/igv/session/Session.java Simplifies getColorScale to not fall back to preferences
src/main/java/org/igv/session/IGVSessionReader.java Cleans up comments in color scale parsing
src/main/java/org/igv/prefs/PreferencesEditor.java Refactors to use LegendPanel and improves combo box handling with SelectionItem wrapper
src/main/java/org/igv/prefs/LegendPanel.java Renamed from HeatmapLegendPanel, refactored to use string keys and adds dark mode support for labels
src/main/java/org/igv/prefs/IGVPreferences.java Refactors color scale management to use string keys, adds getColorScale(String) overload, renames get() to getUserPreference()
src/main/java/org/igv/maf/MultipleAlignmentTrack.java Removes empty setColorScale override
Comments suppressed due to low confidence (3)

src/main/java/org/igv/prefs/LegendPanel.java:7

  • The import for TrackType is unused. After the refactoring, this class no longer uses TrackType anywhere in its implementation. Consider removing this unused import.
    src/main/java/org/igv/prefs/LegendPanel.java:52
  • The mouseExited() method is empty. Consider resetting the cursor to the default when the mouse exits the component to properly restore the cursor state.
    src/main/java/org/igv/prefs/LegendPanel.java:139
  • The label color is set to use dark mode detection (Globals.isDarkMode() ? Color.WHITE : Color.BLACK) in paintHorizontal(). However, the vertical painting method paintVertical() still uses hardcoded Color.BLACK at line 182. For consistency with the dark mode support added in this PR, paintVertical() should also use the same dark mode-aware color selection.

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

// Ignore
}
}
colorScaleCache.put(key, scale);
Copy link

Copilot AI Dec 31, 2025

Choose a reason for hiding this comment

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

The method caches null values in colorScaleCache (line 763) when both the preference lookup and TrackType parsing fail. This could prevent subsequent attempts to retrieve a valid color scale. Consider only caching non-null values or returning early when the scale cannot be determined.

Copilot uses AI. Check for mistakes.
jrobinso and others added 11 commits December 30, 2025 21:30
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jrobinso jrobinso merged commit 8c75a14 into main Dec 31, 2025
2 of 4 checks passed
@jrobinso jrobinso deleted the heatmaps branch December 31, 2025 05:46
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