Hi-C track
A HicTrack with a HicAdapter needs only the .hic file location. Loop and
interaction calls (BEDPE) are a separate VariantTrack drawn as link marks on a
LinearMarkDisplay.
Goes in the tracks array of config.json. See Tracks.
{
"type": "HicTrack",
"trackId": "hic",
"name": "Hi-C Track",
"assemblyNames": ["hg19"],
"adapter": {
"type": "HicAdapter",
"uri": "https://jbrowse.org/genomes/hg19/intra_nofrag_30.hic"
}
}jbrowse add-track https://jbrowse.org/genomes/hg19/intra_nofrag_30.hic \
--trackId hic \
--name "Hi-C Track" \
--assemblyNames hg19In JBrowse Desktop, or in any running JBrowse Web session, open a view on this track’s assembly, then File → Open track... and, in Add a track from file or URL, enter:
- Main file:
https://jbrowse.org/genomes/hg19/intra_nofrag_30.hic
Click Next. JBrowse reads the adapter and track type off the file name. Then fill in:
- Track name:
Hi-C Track - Assembly:
hg19
Click Add.
HicAdapter takes the .hic file through the uri shorthand; the longhand
slot is hicLocation (HicAdapter).
Display settings
The coloring and its controls are LinearHicDisplay slots, and adjusting the color scale shows what each does to the picture:
Goes in the tracks array of config.json. See Tracks.
{
"trackId": "hic_kr",
"name": "Hi-C (KR, log scale)",
"uri": "https://jbrowse.org/genomes/hg19/intra_nofrag_30.hic",
"assemblyNames": ["hg19"],
"displayDefaults": {
"data": { "normalization": "KR" },
"encoding": {
"color": { "scale": { "type": "log", "scheme": "viridis" } }
},
"legend": { "show": true }
}
}jbrowse add-track https://jbrowse.org/genomes/hg19/intra_nofrag_30.hic \
--trackId hic_kr \
--name "Hi-C (KR, log scale)" \
--assemblyNames hg19 \
--displayDefaults '{"data":{"normalization":"KR"},"encoding":{"color":{"scale":{"type":"log","scheme":"viridis"}}},"legend":{"show":true}}'In JBrowse Desktop, or in any running JBrowse Web session, open a view on this track’s assembly, then File → Open track..., choose Add track from pasted JSON, and paste:
{
"trackId": "hic_kr",
"name": "Hi-C (KR, log scale)",
"uri": "https://jbrowse.org/genomes/hg19/intra_nofrag_30.hic",
"assemblyNames": ["hg19"],
"displayDefaults": {
"data": { "normalization": "KR" },
"encoding": {
"color": { "scale": { "type": "log", "scheme": "viridis" } }
},
"legend": { "show": true }
}
}data.normalizationnames the matrix-balancing scheme (KR,SCALE,VC,VC_SQRT,NONE). JBrowse resolves it against what the file provides, so a scheme the file lacks falls back with no error (normalization)data.resolutionis a signed offset from the zoom-derived binsize, so the choice survives zooming: positive is finer, negative coarserencoding.color.scale.domainMaxpins the count the color scale saturates at. Unset, it follows the loaded counts, so two tracks given the same number share one scaleencoding.color.fieldisobserved, the counts, orobserved/expected, each count over the file's expected count at its distance, drawn diverging around 1 (compartments)
Comparing two conditions
A controlAdapter on the
adapter names a second .hic, and the
observed/control field draws each count
over the control's, both scaled to one library depth. This track is K562 over
GM12878:
Goes in the tracks array of config.json. See Tracks.
{
"type": "HicTrack",
"trackId": "hic_k562_over_gm12878",
"name": "K562 over GM12878",
"assemblyNames": ["hg38"],
"adapter": {
"type": "HicAdapter",
"uri": "https://encode-public.s3.amazonaws.com/2021/10/28/4d332729-3463-4782-b33c-76e4fa8ff72a/ENCFF080DPJ.hic",
"controlAdapter": {
"type": "HicAdapter",
"uri": "https://encode-public.s3.amazonaws.com/2021/10/28/6f0cc163-86c7-4a68-baac-65af90f5a90d/ENCFF053VBX.hic"
}
},
"displayDefaults": { "encoding": { "color": "observed/control" } }
}jbrowse add-track-json '{
"type": "HicTrack",
"trackId": "hic_k562_over_gm12878",
"name": "K562 over GM12878",
"assemblyNames": ["hg38"],
"adapter": {
"type": "HicAdapter",
"uri": "https://encode-public.s3.amazonaws.com/2021/10/28/4d332729-3463-4782-b33c-76e4fa8ff72a/ENCFF080DPJ.hic",
"controlAdapter": {
"type": "HicAdapter",
"uri": "https://encode-public.s3.amazonaws.com/2021/10/28/6f0cc163-86c7-4a68-baac-65af90f5a90d/ENCFF053VBX.hic"
}
},
"displayDefaults": { "encoding": { "color": "observed/control" } }
}'In JBrowse Desktop, or in any running JBrowse Web session, open a view on this track’s assembly, then File → Open track..., choose Add track from pasted JSON, and paste:
{
"type": "HicTrack",
"trackId": "hic_k562_over_gm12878",
"name": "K562 over GM12878",
"assemblyNames": ["hg38"],
"adapter": {
"type": "HicAdapter",
"uri": "https://encode-public.s3.amazonaws.com/2021/10/28/4d332729-3463-4782-b33c-76e4fa8ff72a/ENCFF080DPJ.hic",
"controlAdapter": {
"type": "HicAdapter",
"uri": "https://encode-public.s3.amazonaws.com/2021/10/28/6f0cc163-86c7-4a68-baac-65af90f5a90d/ENCFF053VBX.hic"
}
},
"displayDefaults": { "encoding": { "color": "observed/control" } }
}The track menu's Compare with... builds the same track from two tracks already loaded (comparing two conditions).
Loops and interactions as arcs
BEDPE loop calls load as a VariantTrack with a
mark display drawing one link per call: a
mate step reads each record's other end, x2 names the fields holding it,
strokeWidth is the stroke in pixels and color the stroke color. A filter
step keeps the high-scoring calls, drawn here in dark red as thin arcs:
Goes in the tracks array of config.json. See Tracks.
{
"type": "VariantTrack",
"trackId": "hic_loops",
"name": "Hi-C loops",
"uri": "https://example.com/loops.bedpe.gz",
"assemblyNames": ["hg38"],
"displays": [
{
"type": "LinearMarkDisplay",
"marks": [
{
"mark": "link",
"encoding": { "color": { "value": "#8b1a1a" }, "strokeWidth": 1 },
"transform": [
{ "type": "mate" },
{ "type": "filter", "expr": "jexl:get(feature,'score')>=500" }
]
}
]
}
]
}jbrowse add-track-json '{
"type": "VariantTrack",
"trackId": "hic_loops",
"name": "Hi-C loops",
"uri": "https://example.com/loops.bedpe.gz",
"assemblyNames": ["hg38"],
"displays": [
{
"type": "LinearMarkDisplay",
"marks": [
{
"mark": "link",
"encoding": { "color": { "value": "#8b1a1a" }, "strokeWidth": 1 },
"transform": [
{ "type": "mate" },
{ "type": "filter", "expr": "jexl:get(feature,'\''score'\'')>=500" }
]
}
]
}
]
}'In JBrowse Desktop, or in any running JBrowse Web session, open a view on this track’s assembly, then File → Open track..., choose Add track from pasted JSON, and paste:
{
"type": "VariantTrack",
"trackId": "hic_loops",
"name": "Hi-C loops",
"uri": "https://example.com/loops.bedpe.gz",
"assemblyNames": ["hg38"],
"displays": [
{
"type": "LinearMarkDisplay",
"marks": [
{
"mark": "link",
"encoding": { "color": { "value": "#8b1a1a" }, "strokeWidth": 1 },
"transform": [
{ "type": "mate" },
{ "type": "filter", "expr": "jexl:get(feature,'score')>=500" }
]
}
]
}
]
}A strokeWidth bound to a field strokes each loop by its score instead, through
a linear or log scale into a range of pixels:
Mark display §"Links".
Compartments and subcompartments
The compartment eigenvector is a BigWig, drawn as a
quantitative track in two colors
around zero. Pin
encoding.y.scale.domainMin and
domainMax when two of these tracks are
read against each other, so neither autoscales to that track's extremes; the
user guide
covers the sign check that goes with it:
Goes in the tracks array of config.json. See Tracks.
{
"trackId": "hic_compartments",
"name": "Compartment eigenvector",
"uri": "https://encode-public.s3.amazonaws.com/2021/10/28/5b488af0-df49-4b9b-9feb-8ad671b7eaef/ENCFF661LPK.bigWig",
"assemblyNames": ["hg38"],
"displayDefaults": {
"encoding": { "y": { "scale": { "domainMin": -0.03, "domainMax": 0.03 } } }
}
}jbrowse add-track https://encode-public.s3.amazonaws.com/2021/10/28/5b488af0-df49-4b9b-9feb-8ad671b7eaef/ENCFF661LPK.bigWig \
--trackId hic_compartments \
--name "Compartment eigenvector" \
--assemblyNames hg38 \
--displayDefaults '{"encoding":{"y":{"scale":{"domainMin":-0.03,"domainMax":0.03}}}}'In JBrowse Desktop, or in any running JBrowse Web session, open a view on this track’s assembly, then File → Open track..., choose Add track from pasted JSON, and paste:
{
"trackId": "hic_compartments",
"name": "Compartment eigenvector",
"uri": "https://encode-public.s3.amazonaws.com/2021/10/28/5b488af0-df49-4b9b-9feb-8ad671b7eaef/ENCFF661LPK.bigWig",
"assemblyNames": ["hg38"],
"displayDefaults": {
"encoding": { "y": { "scale": { "domainMin": -0.03, "domainMax": 0.03 } } }
}
}Subcompartments are a BED whose color column holds the class color. ENCODE's
copies are not tabix-indexed, so the plain
BedAdapter reads the whole file:
Goes in the tracks array of config.json. See Tracks.
{
"type": "FeatureTrack",
"trackId": "hic_subcompartments",
"name": "Subcompartments",
"assemblyNames": ["hg38"],
"adapter": {
"type": "BedAdapter",
"uri": "https://encode-public.s3.amazonaws.com/2022/08/26/7165fc3e-f186-4fba-be87-f4ea600404b0/ENCFF247IAA.bed.gz",
"columnNames": [
"chrom",
"chromStart",
"chromEnd",
"name",
"score",
"strand",
"thickStart",
"thickEnd",
"itemRgb",
"numAltClusterings",
"altClusterNum",
"altClusterAssignment"
]
}
}jbrowse add-track-json '{
"type": "FeatureTrack",
"trackId": "hic_subcompartments",
"name": "Subcompartments",
"assemblyNames": ["hg38"],
"adapter": {
"type": "BedAdapter",
"uri": "https://encode-public.s3.amazonaws.com/2022/08/26/7165fc3e-f186-4fba-be87-f4ea600404b0/ENCFF247IAA.bed.gz",
"columnNames": [
"chrom",
"chromStart",
"chromEnd",
"name",
"score",
"strand",
"thickStart",
"thickEnd",
"itemRgb",
"numAltClusterings",
"altClusterNum",
"altClusterAssignment"
]
}
}'In JBrowse Desktop, or in any running JBrowse Web session, open a view on this track’s assembly, then File → Open track..., choose Add track from pasted JSON, and paste:
{
"type": "FeatureTrack",
"trackId": "hic_subcompartments",
"name": "Subcompartments",
"assemblyNames": ["hg38"],
"adapter": {
"type": "BedAdapter",
"uri": "https://encode-public.s3.amazonaws.com/2022/08/26/7165fc3e-f186-4fba-be87-f4ea600404b0/ENCFF247IAA.bed.gz",
"columnNames": [
"chrom",
"chromStart",
"chromEnd",
"name",
"score",
"strand",
"thickStart",
"thickEnd",
"itemRgb",
"numAltClusterings",
"altClusterNum",
"altClusterAssignment"
]
}
}columnNames does two jobs here,
and neither failure it prevents raises an error:
- The file's last three columns are not BED12's block fields, so the
positional layout takes the cluster count for a
blockCountand grows every feature a row of nonexistent subfeatures - Column nine named
itemRgbpaints each class in a separate color. The file's header spells ititemRGB, which JBrowse does not look for, and a second comment line follows the column line, so the parser takes that last line as the definition and finds no tab-separated fields in it
See also
- Tutorial: Structural variants from Hi-C
- User guide: Hi-C track
- Reference: LinearMarkDisplay config schema