Closed dasmoth closed 9 years ago
The master branch now has basic support for doing this. Example track configuration:
{name: 'Alternates test',
merge: 'alternates',
overlay: [
{name: 'bam_subtrack',
bamURI: 'http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeUwDnase/wgEncodeUwDnaseK562AlnRep1.bam'},
{name: 'bwg_subtrack',
bwgURI: 'http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeUwDnase/wgEncodeUwDnaseK562RawRep1.bigWig'}
],
style: [
{method: 'bam_subtrack', type: 'default', zoom: 'high',
style: {"glyph": "__SEQUENCE",
"HEIGHT": 8,
"BUMP": true,
"LABEL": false}},
{method: 'bwg_subtrack', type: 'default', zoom: 'medium',
style: {"glyph": "HISTOGRAM",
"BGCOLOR": "blue",
"HEIGHT": 30}},
{method: 'bwg_subtrack', type: 'default', zoom: 'low',
style: {"glyph": "HISTOGRAM",
"BGCOLOR": "blue",
"HEIGHT": 30}}]
}
There are two points to note here:
One issue at the moment is that you have to give an explicit stylesheet for this kind of track, there's no way to use the default styles because there's no way to weave the appropriate zoom-level filters into them. This is something I'm eager to see addressed (see #89 for some discussions), but may not happen for a while.
Primary use case: switch from BAM to bigWig when zooming out. (suggested by Roy Chaudhuri on the mailing list).
OverlayFeatureSource already handles the logic of wrapping multiple back-ends up in a single track, so just need a way to switch back-ends on and off when zooming.