higlass-dynseq
Dynamic sequence track for HiGlass
Installation
If you are using NPM:
npm install higlass-dynseq
Then you can load it by adding this import to your JavaScript:
import HorizontalDynseqTrack from 'higlass-dynseq';
import 'higlass-dynseq';
Otherwise, load higlass-dynseq
from a CDN. You can use this script tag:
<script src="https://unpkg.com/higlass-dynseq"></script>
<script src="hglib.js"></script>
Usage
The DynSeq track depends on both a data source (e.g. bigWig) and a sequence source (FASTA). You should load them together with higlass-multi-tileset
(follow the installation instructions before using it).
{
"data": {
"type": "multi-tileset",
"configs": [
{
"server": "http://localhost:8001/api/v1",
"tilesetUid": "my-bigwig-tileset"
},
{
"server": "https://my-higlass-server.com/api/v1",
"tilesetUid": "my-fasta-tileset"
}
]
},
"uid": "dynseq-example",
"type": "horizontal-dynseq",
"options": {
...
}
}
These options are available (beyond the standard ones such as labelColor
and minHeight
):
{
"lineStrokeColor": "blue",
"lineStrokeWidth": 1,
"valueScaling": "linear",
"minFontSize": 0,
"fadeOutFontSize": 8,
"maxFontSize": 40,
"nonStandardSequence": false,
"fontFamily": "Arial",
"fontColors": {
"A": "#89c738",
"T": "#9238c7",
"C": "#e05144",
"G": "#3899c7",
"N": "#858585"
},
"defaultFontColor": "#ffb347"
}
Features
The DynSeq track was designed with performance in mind. It only fetches the FASTA sequence when it is visible on screen and takes advantage of HiGlass' tiling system to minimize network requests and latency. Using efficient rendering techniques and debounced, batched updates, the track remains as fast as a standalone line track.
Multiple DynSeq tracks that use the same FASTA sequence but different datasets will remain fast due to the tile cache in HiGlass, which prevents duplicate tile requests, and the efficient Pixi.js-based rendering system, which reuses a high-resolution bitmap of each character to offer smooth, latency-free analysis even on low-end devices.
higlass-dynseq
includes a configurable automatic hiding feature for the FASTA sequence when there are thousands of characters on screen. As a user zooms out, the sequence will fade out as it is replaced by a colored line, which will more accurately show the data. At low zoom levels, the DynSeq track is similar to the horizontal-line
track built-in to HiGlass.
Support
File an issue if you have found a bug, would like help resolving a problem, or want to ask a question about using the track.
Alternatively, contact Arjun Barrett for more information.