Skip to content

Conversation

@jrobinso
Copy link
Contributor

…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.

…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.
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 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.

Comment on lines +1188 to +1189
// No explicitly set color, try the feature itself
if (featureColor == null) {
Copy link

Copilot AI Jan 21, 2026

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(); }

Suggested change
// 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()) {

Copilot uses AI. Check for mistakes.
jrobinso and others added 4 commits January 20, 2026 20:12
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 b50ad94 into main Jan 21, 2026
2 checks passed
@jrobinso jrobinso deleted the colors branch January 21, 2026 04:37
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