Skip to content

Commit

Permalink
Set initial color for all track types
Browse files Browse the repository at this point in the history
  • Loading branch information
turner committed Nov 26, 2024
1 parent 34543f5 commit c2e74f5
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 3 deletions.
12 changes: 11 additions & 1 deletion dev/multi-select/multi-select.html
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,18 @@
"aliasURL": "https://s3.amazonaws.com/igv.org.genomes/hg19/hg19_alias.tab",
"chromosomeOrder": "chr1, chr2, chr3, chr4, chr5, chr6, chr7, chr8, chr9, chr10, chr11, chr12, chr13, chr14, chr15, chr16, chr17, chr18, chr19, chr20, chr21, chr22, chrX, chrY"
},
"locus": "chr8:128,746,680-128,756,197",
"locus": "chr10:1-120,250,001",
"tracks": [
{
"url": "https://www.dropbox.com/scl/fi/yczvlb961oh77sgv9syc6/MP_skin_CRUSH_Loxafr3.0_HiC.bedgraph?rlkey=e2j6wm62gxoiiyhh0m3bems7q&dl=0",
"name": "MP_skin_CRUSH_Loxafr3.0_HiC.bedgraph",
"format": "bedgraph",
"type": "wig",
"color": "rgb(255, 114, 110)",
"altColor": "rgb(106, 207, 255)",
"min": -100,
"max": 100
},
{
"name": "Homo sapiens A549 treated with 0.02% ethanol for 1 hour EP300 ",
"url": "https://www.encodeproject.org/files/ENCFF000NDX/@@download/ENCFF000NDX.bigWig",
Expand Down
4 changes: 4 additions & 0 deletions js/blat/blatTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class BlatTrack extends FeatureTrack {
this._features = features;
this.featureSource = new StaticFeatureSource({features}, this.browser.genome)
}

this._initialColor = this.color || this.constructor.defaultColor
this._initialAltColor = this.altColor || this.constructor.defaultColor

}

openTableView() {
Expand Down
3 changes: 3 additions & 0 deletions js/feature/featureTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ class FeatureTrack extends TrackBase {
this.visibilityWindow = await this.featureSource.defaultVisibilityWindow()
}

this._initialColor = this.color || this.constructor.defaultColor
this._initialAltColor = this.altColor || this.constructor.defaultColor

return this

}
Expand Down
3 changes: 3 additions & 0 deletions js/feature/interactionTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ class InteractionTrack extends TrackBase {
this.featureSource.visibilityWindow = this.visibilityWindow // <- this looks odd
}

this._initialColor = this.color || this.constructor.defaultColor
this._initialAltColor = this.altColor || this.constructor.defaultColor

return this
}

Expand Down
4 changes: 4 additions & 0 deletions js/feature/segTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ class SegTrack extends TrackBase {
if (this.header) {
this.setTrackProperties(this.header)
}

this._initialColor = this.color || this.constructor.defaultColor
this._initialAltColor = this.altColor || this.constructor.defaultColor

}


Expand Down
3 changes: 3 additions & 0 deletions js/feature/spliceJunctionTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ class SpliceJunctionTrack extends TrackBase {
this.visibilityWindow = await this.featureSource.defaultVisibilityWindow()
}

this._initialColor = this.color || this.constructor.defaultColor
this._initialAltColor = this.altColor || this.constructor.defaultColor

return this

}
Expand Down
4 changes: 4 additions & 0 deletions js/feature/wigTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ class WigTrack extends TrackBase {
const header = await this.getHeader()
if (this.disposed) return // This track was removed during async load
if (header) this.setTrackProperties(header)

this._initialColor = this.color || this.constructor.defaultColor
this._initialAltColor = this.altColor || this.constructor.defaultColor

}

get supportsWholeGenome() {
Expand Down
4 changes: 4 additions & 0 deletions js/gcnv/gcnvTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ class GCNVTrack extends TrackBase {
}
}
}

this._initialColor = this.color || this.constructor.defaultColor
this._initialAltColor = this.altColor || this.constructor.defaultColor

}

menuItemList() {
Expand Down
3 changes: 3 additions & 0 deletions js/gwas/gwasTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ class GWASTrack extends TrackBase {
}
}

this._initialColor = this.color || this.constructor.defaultColor
this._initialAltColor = this.altColor || this.constructor.defaultColor

return this

}
Expand Down
3 changes: 3 additions & 0 deletions js/shoebox/shoeboxTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ class ShoeboxTrack extends TrackBase {
// This shouldn't be neccessary
if (!this.scale) this.scale = 1.0

this._initialColor = this.color || this.constructor.defaultColor
this._initialAltColor = this.altColor || this.constructor.defaultColor

}

get color() {
Expand Down
14 changes: 12 additions & 2 deletions js/trackBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ class TrackBase {
}
}

this._initialColor = this.color || this.constructor.defaultColor
this._initialAltColor = this.altColor || this.constructor.defaultColor
// this._initialColor = this.color || this.constructor.defaultColor
// this._initialAltColor = this.altColor || this.constructor.defaultColor

if (config.name || config.label) {
this.name = config.name || config.label
Expand Down Expand Up @@ -138,6 +138,16 @@ class TrackBase {
}
}

async postInit(){

console.log(`TrackBase - track(${ this.type }) - postInit()`)

this._initialColor = this.color || this.constructor.defaultColor
this._initialAltColor = this.altColor || this.constructor.defaultColor

return this
}

get name() {
return this._name
}
Expand Down
3 changes: 3 additions & 0 deletions js/variant/variantTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ class VariantTrack extends TrackBase {
}
}

this._initialColor = this.color || this.constructor.defaultColor
this._initialAltColor = this.altColor || this.constructor.defaultColor

return this
}

Expand Down

0 comments on commit c2e74f5

Please sign in to comment.