From d8ae9323e25bd1d55b1252c7130b6ce382d0471c Mon Sep 17 00:00:00 2001 From: jrobinso <933148+jrobinso@users.noreply.github.com> Date: Fri, 11 Oct 2024 08:15:57 -0700 Subject: [PATCH] Add "visibility window" to wig track. Useful when using "none" for summarization with large bigwig files. --- js/feature/wigTrack.js | 7 ++++++- js/ui/menuUtils.js | 11 +++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/js/feature/wigTrack.js b/js/feature/wigTrack.js index 58ee4e17b..cc44205ca 100755 --- a/js/feature/wigTrack.js +++ b/js/feature/wigTrack.js @@ -23,7 +23,8 @@ class WigTrack extends TrackBase { scaleFactor: undefined, overflowColor: `rgb(255, 32, 255)`, baselineColor: 'lightGray', - summarize: true + summarize: true, + visibilityWindow: undefined } constructor(config, browser) { @@ -69,6 +70,10 @@ class WigTrack extends TrackBase { if (header) this.setTrackProperties(header) } + supportsWholeGenome() { + return this.visibilityWindow === undefined || this.visibilityWindow < 0 + } + async getFeatures(chr, start, end, bpPerPixel) { const windowFunction = this.windowFunction diff --git a/js/ui/menuUtils.js b/js/ui/menuUtils.js index 17dad9aa3..98feb1cb3 100644 --- a/js/ui/menuUtils.js +++ b/js/ui/menuUtils.js @@ -6,7 +6,7 @@ import {colorPalettes} from "../util/colorPalletes.js" const colorPickerTrackTypeSet = new Set(['bedtype', 'alignment', 'annotation', 'variant', 'wig', 'interact']) -const vizWindowTypes = new Set(['alignment', 'annotation', 'variant', 'eqtl', 'qtl', 'snp', 'shoebox']) +const vizWindowTypes = new Set(['alignment', 'annotation', 'variant', 'eqtl', 'qtl', 'snp', 'shoebox', 'wig']) const multiTrackSelectExclusionTypes = new Set(['sequence', 'ruler', 'ideogram']) @@ -83,7 +83,7 @@ class MenuUtils { if (isVisibilityWindowType(trackView)) { list.push('