-
Notifications
You must be signed in to change notification settings - Fork 402
Recfactor track color implementation to enforce the following hierarc… #1814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…hy: (1) explicit track color setting, (2) feature color (e.g. from bed file), (3) default track color. Add menu items to "unset" an explicit track color setting.
There was a problem hiding this 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 pull request refactors the track color implementation to enforce a clear hierarchy for feature coloring: (1) explicit track color setting, (2) feature color from files (e.g., BED itemRgb), and (3) default track color. The refactoring consolidates color selection logic from IGVFeatureRenderer into a new AbstractTrack.getFeatureColor() method and adds UI menu items to unset explicit track colors.
Changes:
- Consolidated feature color selection logic into AbstractTrack.getFeatureColor() method
- Removed getExplicitColor/getExplicitAltColor methods in favor of direct field access
- Added "Unset Track Color" menu items to revert tracks to default colors
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/org/igv/util/ParsingUtils.java | Added colorByStrand track line parsing support; improved code formatting |
| src/main/java/org/igv/track/TrackMenuUtils.java | Renamed menu items from "Change" to "Set"; added "Unset Track Color" menu item with null pointer handling |
| src/main/java/org/igv/track/Track.java | Removed getExplicitColor/getExplicitAltColor methods; removed unused viewLimitMin/Max getters; added getDefaultColor() default implementation |
| src/main/java/org/igv/track/GisticTrack.java | Removed unused/dead code methods and color stubs |
| src/main/java/org/igv/track/FeatureTrack.java | Moved trackLine methods to AbstractTrack |
| src/main/java/org/igv/track/AbstractTrack.java | Refactored color fields (posColor→color); added getFeatureColor() method; changed viewLimitMin/Max defaults from NaN to 0/1000; moved trackLine methods from FeatureTrack |
| src/main/java/org/igv/seg/CNFreqTrack.java | Updated field reference from posColor to color |
| src/main/java/org/igv/sam/CoverageTrack.java | Updated field reference from _color to color; removed redundant setColor override |
| src/main/java/org/igv/renderer/SpliceJunctionRenderer.java | Updated to use new color hierarchy (getColor/getAltColor/getDefaultColor) |
| src/main/java/org/igv/renderer/IGVFeatureRenderer.java | Removed getFeatureColor() and related helper methods; delegated to AbstractTrack.getFeatureColor() |
| src/main/java/org/igv/feature/genome/load/GenomeLoader.java | Removed explicit gene track color setting to use defaults |
| src/main/java/org/igv/bedpe/NestedArcRenderer.java | Updated to use AbstractTrack.getFeatureColor() and conditional alpha blending for HiC tracks |
| src/main/java/org/igv/bedpe/InteractionTrack.java | Refactored color initialization; added "Unset Track Color" menu item |
| src/main/java/org/igv/bedpe/HicInteractionTrack.java | Updated color and useScore initialization with setDefaultColor() |
| src/main/java/org/igv/Globals.java | Moved DULL_BLUE and DULL_RED color constants from IGVFeatureRenderer |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // No explicitly set color, try the feature itself | ||
| if (featureColor == null) { |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The getFeatureColor method doesn't check track.isItemRGB() before using feature.getColor(). This could cause features from BED files to always show their own colors even when itemRGB should be off. The check should be: if (featureColor == null && track.isItemRGB()) { featureColor = feature.getColor(); }
| // No explicitly set color, try the feature itself | |
| if (featureColor == null) { | |
| // No explicitly set color, try the feature itself only if itemRGB is enabled | |
| if (featureColor == null && isItemRGB()) { |
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>
…hy: (1) explicit track color setting, (2) feature color (e.g. from bed file), (3) default track color. Add menu items to "unset" an explicit track color setting.