Skip to content

Commit c933450

Browse files
committed
window function refinements -- only present options supported by backing source
1 parent 689ac70 commit c933450

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ igv.css.map
2929
/deployShoebox.sh
3030
/examples/shoebox.html
3131
/dev/shoebox/*
32+
/js/bigwig/bwReader_nochromtree.js

dev/wig/windowFunctions.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"url": "../../test/data/wig/ENCFF000ARZ.wig",
6565
"name": "H3K4me1 points",
6666
"graphType": "points",
67+
"windowFunction": "none",
6768
"autoscaleGroup": "1"
6869
}
6970
]

js/feature/textFeatureSource.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class TextFeatureSource {
5252
this.genome = genome
5353
this.sourceType = (config.sourceType === undefined ? "file" : config.sourceType)
5454
this.maxWGCount = config.maxWGCount || DEFAULT_MAX_WG_COUNT
55+
this.windowFunctions = ["mean", "min", "max", "none"]
5556

5657
const queryableFormats = new Set(["bigwig", "bw", "bigbed", "bb", "biginteract", "biggenepred", "bignarrowpeak", "tdf"])
5758

js/feature/wigTrack.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class WigTrack extends TrackBase {
7171

7272
async getFeatures(chr, start, end, bpPerPixel) {
7373

74-
const windowFunction = "points" === this.graphType ? "none" : this.windowFunction
74+
const windowFunction = this.windowFunction
7575

7676
const features = await this.featureSource.getFeatures({
7777
chr,
@@ -119,7 +119,7 @@ class WigTrack extends TrackBase {
119119

120120
items.push(...this.numericDataMenuItems())
121121

122-
if("points" !== this.graphType) {
122+
if(this.featureSource.windowFunctions) {
123123
items.push(...this.wigSummarizationItems())
124124
}
125125

@@ -128,14 +128,10 @@ class WigTrack extends TrackBase {
128128

129129
wigSummarizationItems() {
130130

131+
const windowFunctions = this.featureSource.windowFunctions
132+
131133
const menuItems = []
132134
menuItems.push('<hr/>')
133-
134-
const windowFunctions = this.featureSource.windowFunctions ?
135-
this.featureSource.windowFunctions.slice() :
136-
["mean", "min", "max"]
137-
windowFunctions.push("none")
138-
139135
menuItems.push("<div>Windowing function</div>")
140136
for (const wf of windowFunctions) {
141137
const object = $(createCheckbox(wf, this.windowFunction === wf))

0 commit comments

Comments
 (0)