CNV across a population (1000 Genomes)
The tutorials target the JBrowse v5 beta, and the v4.3.0 release
on the download page lacks some of what they show. To install the
beta of JBrowse Web, run npm install -g @jbrowse/cli@next, then
jbrowse create jbrowse2 --branch v5.0.0-beta.22. Desktop beta builds for Linux and
macOS are on the releases page;
the Windows build waits on code signing.
Most of the genome comes in two copies, but some stretches are duplicated or deleted in one person and not the next. We read copy number for the whole 1000 Genomes panel at once, one row per individual, colored by how far that person strays from two copies, at the chemokine genes CCL3L1, a deletion of UGT2B17, and two nested deletions on chr3. We:
- load per-sample BigWigs as one multi-row heatmap track, and a few individuals as step lines at CCL3L1
- add the 1000 Genomes SV map as a variant track over UGT2B17
- load the whole panel from one Zarr store, and cluster its rows over the nested chr3 deletions under a length-filtered variant track
- turn your own QuicK-mer2 output into BigWigs, and build a Zarr store from them
Prerequisites
- a JBrowse instance to paste a track into (see the web quickstart or the desktop quickstart)
- the zarr plugin, for the Zarr store. In your own JBrowse, load it by the URL that section gives
node24 or newer, to build a Zarr store- QuicK-mer2 and a 30x alignment, to add samples of your own
samtoolsandbedGraphToBigWig, to turn QuicK-mer2's output into a bigWig
# Debian/Ubuntu
sudo apt install samtools nodejs
# or conda, which has every tool above
conda install -c bioconda -c conda-forge samtools nodejs \
ucsc-bedgraphtobigwig
# or Linux x86_64 binaries for the tools apt lacks
wget -P ~/.local/bin \
https://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/bedGraphToBigWig
chmod +x ~/.local/bin/bedGraphToBigWigThe data
QuicK-mer2 copy-number estimates over the 30x 1000 Genomes panel, from the Kidd lab at the University of Michigan (Shen and Kidd 2020).
You don't need these files to follow the page: the track configs below read the hosted results. The build script fetches them to rebuild those results, and Run QuicK-mer2 on your own samples takes a cohort of your own.
| What it is | File |
|---|---|
| The sample list across 26 populations, from the lab's UCSC track hub | kmer-1kg.trackDb.txt |
Read by URL (no download needed)
| What it is | File |
|---|---|
| The per-sample bigWigs, one individual's copy number in 1 kb bins, re-hosted unmodified because the lab's download share is offline. Each file sits under its population, so HG00551 and HG00553 are | HG00551.qm2.CN.1k.bw HG00553.qm2.CN.1k.bw |
The same values packed into one Zarr store for the whole panel. The store is a directory of chunks that 404s at its root, and an adapter takes the URL as uri |
qm2_cn_1kb.zarr |
Load the hg38 assembly
The copy-number bins are on GRCh38, so the tracks attach to hg38:
Goes in the assemblies array of config.json. See Assemblies.
{
"name": "hg38",
"uri": "https://jbrowse.org/genomes/GRCh38/fasta/hg38.prefix.fa.gz",
"refNameAliases": {
"uri": "https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/hg38_aliases.txt"
},
"cytobands": "https://jbrowse.org/genomes/GRCh38/cytoBand.txt"
}Edits config.json in the current folder, creating it if there is none. See JBrowse CLI with Desktop.
jbrowse add-assembly https://jbrowse.org/genomes/GRCh38/fasta/hg38.prefix.fa.gz \
--name hg38 \
--refNameAliases https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/hg38_aliases.txt \
--config '{"cytobands":"https://jbrowse.org/genomes/GRCh38/cytoBand.txt"}'hg38 is one of the genomes JBrowse Desktop hosts, with gene tracks already set up: on the start screen click Browse hosted genomes and pick it. To load the files of this config instead:
In JBrowse Desktop, Open your own genome on the start screen (or File → Open genome... in a session), then Open from a URL and paste, one per line:
https://jbrowse.org/genomes/GRCh38/fasta/hg38.prefix.fa.gz
https://jbrowse.org/genomes/GRCh38/fasta/hg38.prefix.fa.gz.fai
https://jbrowse.org/genomes/GRCh38/fasta/hg38.prefix.fa.gz.gziJBrowse reads the format off the file name. Then fill in:
- Genome name:
hg38 - refName aliases (under More options):
https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/hg38_aliases.txt - cytobands (under More options):
https://jbrowse.org/genomes/GRCh38/cytoBand.txt
The figures also show NCBI's RefSeq genes. The locus figures read NCBI's own GFF:
Goes in the tracks array of config.json. See Tracks.
{
"trackId": "ncbi_refseq_109_hg38_latest",
"name": "NCBI RefSeq (GFF3Tabix)",
"uri": "https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/ncbi_refseq/GRCh38_latest_genomic.sort.gff.gz",
"assemblyNames": ["hg38"]
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/ncbi_refseq/GRCh38_latest_genomic.sort.gff.gz \
--trackId ncbi_refseq_109_hg38_latest \
--name "NCBI RefSeq (GFF3Tabix)" \
--assemblyNames hg38In 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://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/ncbi_refseq/GRCh38_latest_genomic.sort.gff.gz
JBrowse reads the adapter and track type off the file name. Then fill in:
- Track name:
NCBI RefSeq (GFF3Tabix) - Assembly:
hg38
Click Add.
The whole-panel figure reads UCSC's copy:
Goes in the tracks array of config.json. See Tracks.
{
"trackId": "ncbi_refseq_hg38",
"name": "NCBI RefSeq genes",
"type": "FeatureTrack",
"assemblyNames": ["hg38"],
"adapter": {
"type": "Gff3TabixAdapter",
"uri": "https://jbrowse.org/ucsc/hg38/ncbiRefSeq.gff.gz",
"csi": true
}
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track-json '{
"trackId": "ncbi_refseq_hg38",
"name": "NCBI RefSeq genes",
"type": "FeatureTrack",
"assemblyNames": ["hg38"],
"adapter": {
"type": "Gff3TabixAdapter",
"uri": "https://jbrowse.org/ucsc/hg38/ncbiRefSeq.gff.gz",
"csi": 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": "ncbi_refseq_hg38",
"name": "NCBI RefSeq genes",
"type": "FeatureTrack",
"assemblyNames": ["hg38"],
"adapter": {
"type": "Gff3TabixAdapter",
"uri": "https://jbrowse.org/ucsc/hg38/ncbiRefSeq.gff.gz",
"csi": true
}
}Load the panel as one heatmap track
QuicK-mer2 counts k-mers that occur
exactly once in the reference, so each estimate belongs to one paralog, one
copy of a duplicated sequence. The config lists two of the panel's 104 PUR
(Puerto Rican) bigWigs, and every file follows the
kidd_lab_cnv/<population>/<sample>.qm2.CN.1k.bw pattern above:
Goes in the tracks array of config.json. See Tracks.
{
"type": "MultiQuantitativeTrack",
"trackId": "pur_copynumber_1000g",
"name": "PUR copy number (1000 Genomes)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"bigWigs": [
"https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00551.qm2.CN.1k.bw",
"https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00553.qm2.CN.1k.bw"
]
},
"displayDefaults": {
"mark": "rect",
"origin": 2,
"encoding": {
"y": { "scale": { "domainMin": 0, "domainMax": 4 } },
"color": {
"scale": { "range": ["#2166ac", "#b2182b"] },
"legend": { "title": "Copy number" }
}
}
}
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track-json '{
"type": "MultiQuantitativeTrack",
"trackId": "pur_copynumber_1000g",
"name": "PUR copy number (1000 Genomes)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"bigWigs": [
"https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00551.qm2.CN.1k.bw",
"https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00553.qm2.CN.1k.bw"
]
},
"displayDefaults": {
"mark": "rect",
"origin": 2,
"encoding": {
"y": { "scale": { "domainMin": 0, "domainMax": 4 } },
"color": {
"scale": { "range": ["#2166ac", "#b2182b"] },
"legend": { "title": "Copy number" }
}
}
}
}'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": "MultiQuantitativeTrack",
"trackId": "pur_copynumber_1000g",
"name": "PUR copy number (1000 Genomes)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"bigWigs": [
"https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00551.qm2.CN.1k.bw",
"https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00553.qm2.CN.1k.bw"
]
},
"displayDefaults": {
"mark": "rect",
"origin": 2,
"encoding": {
"y": { "scale": { "domainMin": 0, "domainMax": 4 } },
"color": {
"scale": { "range": ["#2166ac", "#b2182b"] },
"legend": { "title": "Copy number" }
}
}
}
}Open this track in JBrowse Web ↗
Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=https%3A%2F%2Fjbrowse.org%2Fucsc%2Fhg38%2Fconfig.json&session=spec-%7B%22sessionTracks%22%3A%5B%7B%22type%22%3A%22MultiQuantitativeTrack%22%2C%22trackId%22%3A%22pur_copynumber_1000g%22%2C%22name%22%3A%22PUR+copy+number+%281000+Genomes%29%22%2C%22assemblyNames%22%3A%5B%22hg38%22%5D%2C%22adapter%22%3A%7B%22type%22%3A%22MultiWiggleAdapter%22%2C%22bigWigs%22%3A%5B%22https%3A%2F%2Fjbrowse.org%2Fgenomes%2FGRCh38%2F1000g%2Fkidd_lab_cnv%2FPUR%2FHG00551.qm2.CN.1k.bw%22%2C%22https%3A%2F%2Fjbrowse.org%2Fgenomes%2FGRCh38%2F1000g%2Fkidd_lab_cnv%2FPUR%2FHG00553.qm2.CN.1k.bw%22%5D%7D%2C%22displayDefaults%22%3A%7B%22mark%22%3A%22rect%22%2C%22origin%22%3A2%2C%22encoding%22%3A%7B%22y%22%3A%7B%22scale%22%3A%7B%22domainMin%22%3A0%2C%22domainMax%22%3A4%7D%7D%2C%22color%22%3A%7B%22scale%22%3A%7B%22range%22%3A%5B%22%232166ac%22%2C%22%23b2182b%22%5D%7D%2C%22legend%22%3A%7B%22title%22%3A%22Copy+number%22%7D%7D%7D%7D%7D%5D%2C%22views%22%3A%5B%7B%22type%22%3A%22LinearGenomeView%22%2C%22assembly%22%3A%22hg38%22%2C%22loc%22%3A%22chr3%3A162%2C275%2C163-163%2C360%2C944%22%2C%22tracks%22%3A%5B%22pur_copynumber_1000g%22%5D%7D%5D%7D&sessionName=JBrowse+docs%3A+PUR+copy+number+%281000+Genomes%29This view in a notebook, with jbrowse-anywidget. Swap a track's uri for your file.
from jbrowse_anywidget import JBrowseApp, fetch_hub
config = fetch_hub("https://jbrowse.org/ucsc/hg38/config.json")
app = JBrowseApp(
assemblies=config["assemblies"],
tracks=config.get("tracks", []) + [
{
"type": "MultiQuantitativeTrack",
"trackId": "pur_copynumber_1000g",
"name": "PUR copy number (1000 Genomes)",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "MultiWiggleAdapter",
"bigWigs": [
"https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00551.qm2.CN.1k.bw",
"https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00553.qm2.CN.1k.bw"
]
},
"displayDefaults": {
"mark": "rect",
"origin": 2,
"encoding": {
"y": {
"scale": {
"domainMin": 0,
"domainMax": 4
}
},
"color": {
"scale": {
"range": [
"#2166ac",
"#b2182b"
]
},
"legend": {
"title": "Copy number"
}
}
}
}
}
],
views=[
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr3:162,275,163-163,360,944",
"tracks": [
"pur_copynumber_1000g"
]
}
],
)
app # display the widgetThis view in your React 19 app, with @jbrowse/react-app2 and @jbrowse/core. Add your own files to tracks.
import { use } from 'react'
import { JBrowse } from '@jbrowse/react-app2'
import '@jbrowse/react-app2/styles.css'
import { addRelativeUris } from '@jbrowse/core/util/addRelativeUris'
const configUrl = "https://jbrowse.org/ucsc/hg38/config.json"
const configPromise = fetch(configUrl)
.then(res => res.json())
.then(config => {
addRelativeUris(config, new URL(configUrl))
return config
})
export default function Figure() {
const config = use(configPromise)
return (
<JBrowse
assemblies={config.assemblies}
tracks={[...(config.tracks ?? []), ...[
{
"type": "MultiQuantitativeTrack",
"trackId": "pur_copynumber_1000g",
"name": "PUR copy number (1000 Genomes)",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "MultiWiggleAdapter",
"bigWigs": [
"https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00551.qm2.CN.1k.bw",
"https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00553.qm2.CN.1k.bw"
]
},
"displayDefaults": {
"mark": "rect",
"origin": 2,
"encoding": {
"y": {
"scale": {
"domainMin": 0,
"domainMax": 4
}
},
"color": {
"scale": {
"range": [
"#2166ac",
"#b2182b"
]
},
"legend": {
"title": "Copy number"
}
}
}
}
}
]]}
aggregateTextSearchAdapters={config.aggregateTextSearchAdapters}
configuration={config.configuration}
views={[
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr3:162,275,163-163,360,944",
"tracks": [
"pur_copynumber_1000g"
]
}
]}
/>
)
}jbrowse-img draws this view as an SVG, no browser needed. Swap --config or a track for your own.
cat > tracks.json <<'JSON'
[
{
"type": "MultiQuantitativeTrack",
"trackId": "pur_copynumber_1000g",
"name": "PUR copy number (1000 Genomes)",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "MultiWiggleAdapter",
"bigWigs": [
"https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00551.qm2.CN.1k.bw",
"https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00553.qm2.CN.1k.bw"
]
},
"displayDefaults": {
"mark": "rect",
"origin": 2,
"encoding": {
"y": {
"scale": {
"domainMin": 0,
"domainMax": 4
}
},
"color": {
"scale": {
"range": [
"#2166ac",
"#b2182b"
]
},
"legend": {
"title": "Copy number"
}
}
}
}
}
]
JSON
npx @jbrowse/img --config https://jbrowse.org/ucsc/hg38/config.json \
--trackConfigs tracks.json \
--assembly hg38 --loc chr3:162,275,163-163,360,944 \
--track pur_copynumber_1000g \
--out figure.svgFor a PNG, --out figure.png (needs rsvg-convert: apt install librsvg2-bin, brew install librsvg).
The bigWigs shorthand takes a
plain list of absolute URLs and names each subtrack from its filename. In
grammar-of-graphics terms, encoding.color
is a color scale and encoding.y the y scale, which these settings turn into a
copy-number heatmap:
markrectgives each sample one strip of color.origin2puts white at the diploid baseline, andencoding.color'sscale.rangenames the two colors it fades to: losses toward the first, gains toward the second.encoding.y.scale.domainMinandencoding.y.scale.domainMaxpin the scale, so two copies are the same color in every window. Keep the bounds symmetric around the origin, because the ramp divides both sides by the longer one: 0 to 4 lets both extremes saturate, and gains past 4 clamp.
Clustering → Cluster rows by score... in the track menu brings similar samples together, since rows otherwise stay in file order.
The full list is the pur_copynumber_1000g track in
https://jbrowse.org/code/jb2/main/test_data/config_demo.json, so
the panel opens on a copy-number-polymorphic window of chr3
with these settings already applied.
Individuals' copy-number profiles at CCL3L1
Navigate to chr17:36,080,000-36,270,000, around CCL3L1 (a chemokine gene
with a variable number of copies), and load individuals spanning the range of
copy number as a second track. It draws step lines on one pinned axis, so each
plateau lines up with a copy count:
Goes in the tracks array of config.json. See Tracks.
{
"type": "MultiQuantitativeTrack",
"trackId": "pur_cnv_ladder",
"name": "PUR copy number, six individuals",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "HG01177",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01177.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG01083",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01083.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG01070",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01070.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG01395",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01395.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG00731",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00731.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG00553",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00553.qm2.CN.1k.bw"
}
]
},
"displayDefaults": {
"mark": "line",
"encoding": {
"y": {
"scale": { "domainMin": 0, "domainMax": 10 },
"axis": { "title": "Copy number" }
}
}
}
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track-json '{
"type": "MultiQuantitativeTrack",
"trackId": "pur_cnv_ladder",
"name": "PUR copy number, six individuals",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "HG01177",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01177.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG01083",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01083.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG01070",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01070.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG01395",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01395.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG00731",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00731.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG00553",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00553.qm2.CN.1k.bw"
}
]
},
"displayDefaults": {
"mark": "line",
"encoding": {
"y": {
"scale": { "domainMin": 0, "domainMax": 10 },
"axis": { "title": "Copy number" }
}
}
}
}'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": "MultiQuantitativeTrack",
"trackId": "pur_cnv_ladder",
"name": "PUR copy number, six individuals",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "HG01177",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01177.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG01083",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01083.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG01070",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01070.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG01395",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01395.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG00731",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00731.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG00553",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00553.qm2.CN.1k.bw"
}
]
},
"displayDefaults": {
"mark": "line",
"encoding": {
"y": {
"scale": { "domainMin": 0, "domainMax": 10 },
"axis": { "title": "Copy number" }
}
}
}
}Open this track in JBrowse Web ↗
Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=https%3A%2F%2Fjbrowse.org%2Fucsc%2Fhg38%2Fconfig.json&session=spec-%7B%22sessionTracks%22%3A%5B%7B%22type%22%3A%22MultiQuantitativeTrack%22%2C%22trackId%22%3A%22pur_cnv_ladder%22%2C%22name%22%3A%22PUR+copy+number%2C+six+individuals%22%2C%22assemblyNames%22%3A%5B%22hg38%22%5D%2C%22adapter%22%3A%7B%22type%22%3A%22MultiWiggleAdapter%22%2C%22subadapters%22%3A%5B%7B%22type%22%3A%22BigWigAdapter%22%2C%22name%22%3A%22HG01177%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fgenomes%2FGRCh38%2F1000g%2Fkidd_lab_cnv%2FPUR%2FHG01177.qm2.CN.1k.bw%22%7D%2C%7B%22type%22%3A%22BigWigAdapter%22%2C%22name%22%3A%22HG01083%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fgenomes%2FGRCh38%2F1000g%2Fkidd_lab_cnv%2FPUR%2FHG01083.qm2.CN.1k.bw%22%7D%2C%7B%22type%22%3A%22BigWigAdapter%22%2C%22name%22%3A%22HG01070%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fgenomes%2FGRCh38%2F1000g%2Fkidd_lab_cnv%2FPUR%2FHG01070.qm2.CN.1k.bw%22%7D%2C%7B%22type%22%3A%22BigWigAdapter%22%2C%22name%22%3A%22HG01395%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fgenomes%2FGRCh38%2F1000g%2Fkidd_lab_cnv%2FPUR%2FHG01395.qm2.CN.1k.bw%22%7D%2C%7B%22type%22%3A%22BigWigAdapter%22%2C%22name%22%3A%22HG00731%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fgenomes%2FGRCh38%2F1000g%2Fkidd_lab_cnv%2FPUR%2FHG00731.qm2.CN.1k.bw%22%7D%2C%7B%22type%22%3A%22BigWigAdapter%22%2C%22name%22%3A%22HG00553%22%2C%22uri%22%3A%22https%3A%2F%2Fjbrowse.org%2Fgenomes%2FGRCh38%2F1000g%2Fkidd_lab_cnv%2FPUR%2FHG00553.qm2.CN.1k.bw%22%7D%5D%7D%2C%22displayDefaults%22%3A%7B%22mark%22%3A%22line%22%2C%22encoding%22%3A%7B%22y%22%3A%7B%22scale%22%3A%7B%22domainMin%22%3A0%2C%22domainMax%22%3A10%7D%2C%22axis%22%3A%7B%22title%22%3A%22Copy+number%22%7D%7D%7D%7D%7D%5D%2C%22views%22%3A%5B%7B%22type%22%3A%22LinearGenomeView%22%2C%22assembly%22%3A%22hg38%22%2C%22loc%22%3A%22chr17%3A36%2C080%2C000-36%2C270%2C000%22%2C%22tracks%22%3A%5B%22pur_cnv_ladder%22%5D%7D%5D%7D&sessionName=JBrowse+docs%3A+PUR+copy+number%2C+six+individualsThis view in a notebook, with jbrowse-anywidget. Swap a track's uri for your file.
from jbrowse_anywidget import JBrowseApp, fetch_hub
config = fetch_hub("https://jbrowse.org/ucsc/hg38/config.json")
app = JBrowseApp(
assemblies=config["assemblies"],
tracks=config.get("tracks", []) + [
{
"type": "MultiQuantitativeTrack",
"trackId": "pur_cnv_ladder",
"name": "PUR copy number, six individuals",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "HG01177",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01177.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG01083",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01083.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG01070",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01070.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG01395",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01395.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG00731",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00731.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG00553",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00553.qm2.CN.1k.bw"
}
]
},
"displayDefaults": {
"mark": "line",
"encoding": {
"y": {
"scale": {
"domainMin": 0,
"domainMax": 10
},
"axis": {
"title": "Copy number"
}
}
}
}
}
],
views=[
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr17:36,080,000-36,270,000",
"tracks": [
"pur_cnv_ladder"
]
}
],
)
app # display the widgetThis view in your React 19 app, with @jbrowse/react-app2 and @jbrowse/core. Add your own files to tracks.
import { use } from 'react'
import { JBrowse } from '@jbrowse/react-app2'
import '@jbrowse/react-app2/styles.css'
import { addRelativeUris } from '@jbrowse/core/util/addRelativeUris'
const configUrl = "https://jbrowse.org/ucsc/hg38/config.json"
const configPromise = fetch(configUrl)
.then(res => res.json())
.then(config => {
addRelativeUris(config, new URL(configUrl))
return config
})
export default function Figure() {
const config = use(configPromise)
return (
<JBrowse
assemblies={config.assemblies}
tracks={[...(config.tracks ?? []), ...[
{
"type": "MultiQuantitativeTrack",
"trackId": "pur_cnv_ladder",
"name": "PUR copy number, six individuals",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "HG01177",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01177.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG01083",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01083.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG01070",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01070.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG01395",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01395.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG00731",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00731.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG00553",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00553.qm2.CN.1k.bw"
}
]
},
"displayDefaults": {
"mark": "line",
"encoding": {
"y": {
"scale": {
"domainMin": 0,
"domainMax": 10
},
"axis": {
"title": "Copy number"
}
}
}
}
}
]]}
aggregateTextSearchAdapters={config.aggregateTextSearchAdapters}
configuration={config.configuration}
views={[
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr17:36,080,000-36,270,000",
"tracks": [
"pur_cnv_ladder"
]
}
]}
/>
)
}jbrowse-img draws this view as an SVG, no browser needed. Swap --config or a track for your own.
cat > tracks.json <<'JSON'
[
{
"type": "MultiQuantitativeTrack",
"trackId": "pur_cnv_ladder",
"name": "PUR copy number, six individuals",
"assemblyNames": [
"hg38"
],
"adapter": {
"type": "MultiWiggleAdapter",
"subadapters": [
{
"type": "BigWigAdapter",
"name": "HG01177",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01177.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG01083",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01083.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG01070",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01070.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG01395",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG01395.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG00731",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00731.qm2.CN.1k.bw"
},
{
"type": "BigWigAdapter",
"name": "HG00553",
"uri": "https://jbrowse.org/genomes/GRCh38/1000g/kidd_lab_cnv/PUR/HG00553.qm2.CN.1k.bw"
}
]
},
"displayDefaults": {
"mark": "line",
"encoding": {
"y": {
"scale": {
"domainMin": 0,
"domainMax": 10
},
"axis": {
"title": "Copy number"
}
}
}
}
}
]
JSON
npx @jbrowse/img --config https://jbrowse.org/ucsc/hg38/config.json \
--trackConfigs tracks.json \
--assembly hg38 --loc chr17:36,080,000-36,270,000 \
--track pur_cnv_ladder \
--out figure.svgFor a PNG, --out figure.png (needs rsvg-convert: apt install librsvg2-bin, brew install librsvg).
Two paralogous blocks hold the variation. The right-hand block spans the chemokine genes CCL3L1 and CCL4L1 (labelled CCL3L3 and CCL4L2 in the hg38 gene track) in a variable number of tandem copies, and the left-hand block is a TBC1D3 repeat.
UGT2B17, a simple deletion, against the 1000 Genomes SV map
UGT2B17 on chr4 is deleted whole in many people, a simple biallelic deletion that a structural variant (SV) callset genotypes directly. We'll set the 1000 Genomes phase 3 integrated SV map beside the copy-number rows:
- Add the SV map as a variant track. For your own callset, swap
urifor a bgzip-compressed, tabix-indexed VCF on the same assembly. - Navigate to UGT2B17 with the PUR panel track from Load the panel as one heatmap track under it.
Goes in the tracks array of config.json. See Tracks.
{
"type": "VariantTrack",
"trackId": "integrated_sv_map_v2",
"name": "1000 Genomes integrated SV map (phase 3)",
"assemblyNames": ["hg38"],
"uri": "https://1000genomes.s3.amazonaws.com/phase3/integrated_sv_map/supporting/GRCh38_positions/ALL.wgs.integrated_sv_map_v2_GRCh38.20130502.svs.genotypes.vcf.gz"
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track https://1000genomes.s3.amazonaws.com/phase3/integrated_sv_map/supporting/GRCh38_positions/ALL.wgs.integrated_sv_map_v2_GRCh38.20130502.svs.genotypes.vcf.gz \
--trackId integrated_sv_map_v2 \
--name "1000 Genomes integrated SV map (phase 3)" \
--assemblyNames hg38In 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://1000genomes.s3.amazonaws.com/phase3/integrated_sv_map/supporting/GRCh38_positions/ALL.wgs.integrated_sv_map_v2_GRCh38.20130502.svs.genotypes.vcf.gz
JBrowse reads the adapter and track type off the file name. Then fill in:
- Track name:
1000 Genomes integrated SV map (phase 3) - Assembly:
hg38
Click Add.
Load the whole panel from one Zarr store
The PUR track lists one population's files. Each BigWig needs several dependent reads to find and fetch a region's values, so a track listing every individual in the panel slows with each file it adds. A Zarr v3 store holds the whole panel as one array of samples by bins, in chunk files on static hosting, so a window takes two metadata requests and one chunk.
jbrowse-plugin-zarr adds a
MultiWiggleZarrAdapter that reads such a store with the same display settings
as the BigWig track. Install Zarr from the
plugin store, or name it in config.json:
{
"plugins": [{ "storePlugin": "Zarr" }]
}With the plugin loaded, the adapter's uri names the store:
Goes in the tracks array of config.json. See Tracks.
{
"type": "MultiQuantitativeTrack",
"trackId": "cnv_1000g_zarr",
"name": "1000 Genomes copy number, 2504 individuals",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleZarrAdapter",
"uri": "https://jbrowse.org/demos/1000g/qm2_cn_1kb.zarr"
},
"displayDefaults": {
"mark": "rect",
"origin": 2,
"encoding": {
"y": { "scale": { "domainMin": 0, "domainMax": 4 } },
"color": {
"scale": { "range": ["#2166ac", "#b2182b"] },
"legend": { "title": "Copy number" }
}
}
}
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track-json '{
"type": "MultiQuantitativeTrack",
"trackId": "cnv_1000g_zarr",
"name": "1000 Genomes copy number, 2504 individuals",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleZarrAdapter",
"uri": "https://jbrowse.org/demos/1000g/qm2_cn_1kb.zarr"
},
"displayDefaults": {
"mark": "rect",
"origin": 2,
"encoding": {
"y": { "scale": { "domainMin": 0, "domainMax": 4 } },
"color": {
"scale": { "range": ["#2166ac", "#b2182b"] },
"legend": { "title": "Copy number" }
}
}
}
}'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": "MultiQuantitativeTrack",
"trackId": "cnv_1000g_zarr",
"name": "1000 Genomes copy number, 2504 individuals",
"assemblyNames": ["hg38"],
"adapter": {
"type": "MultiWiggleZarrAdapter",
"uri": "https://jbrowse.org/demos/1000g/qm2_cn_1kb.zarr"
},
"displayDefaults": {
"mark": "rect",
"origin": 2,
"encoding": {
"y": { "scale": { "domainMin": 0, "domainMax": 4 } },
"color": {
"scale": { "range": ["#2166ac", "#b2182b"] },
"legend": { "title": "Copy number" }
}
}
}
}A relative uri resolves against the config that holds it, so for a store
beside your config.json, the uri is qm2_cn_1kb.zarr.
A deletion nested inside another on chr3, sorted by clustering
The Zarr store covers chr3:162.5-163.2 Mb, where a 22 kb deletion sits inside a 114 kb one. Clustering sorts the individuals by which deletion they have, and the long-read assembly calls of the Human Genome Structural Variation Consortium (Logsdon et al. 2025) place both:
- Navigate the Zarr track to
chr3:162,650,000-163,050,000. - Run Clustering → Cluster rows by score... from its track menu.
- Add the HGSVC3 calls as a variant track:
Goes in the tracks array of config.json. See Tracks.
{
"type": "VariantTrack",
"trackId": "hgsvc3_sv_insdel",
"name": "HGSVC3 structural variants, 5 kb and longer",
"assemblyNames": ["hg38"],
"uri": "https://ftp.1000genomes.ebi.ac.uk/vol1/ftp/data_collections/HGSVC3/release/Variant_Calls/1.0/GRCh38/variants_GRCh38_sv_insdel_sym_HGSVC2024v1.0.vcf.gz"
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track https://ftp.1000genomes.ebi.ac.uk/vol1/ftp/data_collections/HGSVC3/release/Variant_Calls/1.0/GRCh38/variants_GRCh38_sv_insdel_sym_HGSVC2024v1.0.vcf.gz \
--trackId hgsvc3_sv_insdel \
--name "HGSVC3 structural variants, 5 kb and longer" \
--assemblyNames hg38In 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://ftp.1000genomes.ebi.ac.uk/vol1/ftp/data_collections/HGSVC3/release/Variant_Calls/1.0/GRCh38/variants_GRCh38_sv_insdel_sym_HGSVC2024v1.0.vcf.gz
JBrowse reads the adapter and track type off the file name. Then fill in:
- Track name:
HGSVC3 structural variants, 5 kb and longer - Assembly:
hg38
Click Add.
Open this track in JBrowse Web ↗
Needs JBrowse Desktop 5.0 or newer. If nothing opens, copy the link and paste it into Desktop's Open JBrowse Web link..., on the start screen or under File → Session.
https://jbrowse.org/code/jb2/main/?config=https%3A%2F%2Fjbrowse.org%2Fucsc%2Fhg38%2Fconfig.json&session=spec-%7B%22sessionTracks%22%3A%5B%7B%22type%22%3A%22VariantTrack%22%2C%22trackId%22%3A%22hgsvc3_sv_insdel%22%2C%22name%22%3A%22HGSVC3+structural+variants%2C+5+kb+and+longer%22%2C%22assemblyNames%22%3A%5B%22hg38%22%5D%2C%22uri%22%3A%22https%3A%2F%2Fftp.1000genomes.ebi.ac.uk%2Fvol1%2Fftp%2Fdata_collections%2FHGSVC3%2Frelease%2FVariant_Calls%2F1.0%2FGRCh38%2Fvariants_GRCh38_sv_insdel_sym_HGSVC2024v1.0.vcf.gz%22%7D%5D%2C%22views%22%3A%5B%7B%22type%22%3A%22LinearGenomeView%22%2C%22assembly%22%3A%22hg38%22%2C%22loc%22%3A%22chr3%3A162%2C650%2C000-163%2C050%2C000%22%2C%22tracks%22%3A%5B%22hgsvc3_sv_insdel%22%5D%7D%5D%7D&sessionName=JBrowse+docs%3A+HGSVC3+structural+variants%2C+5+kb+and+longerThis view in a notebook, with jbrowse-anywidget. Swap a track's uri for your file.
from jbrowse_anywidget import JBrowseApp, fetch_hub
config = fetch_hub("https://jbrowse.org/ucsc/hg38/config.json")
app = JBrowseApp(
assemblies=config["assemblies"],
tracks=config.get("tracks", []) + [
{
"type": "VariantTrack",
"trackId": "hgsvc3_sv_insdel",
"name": "HGSVC3 structural variants, 5 kb and longer",
"assemblyNames": [
"hg38"
],
"uri": "https://ftp.1000genomes.ebi.ac.uk/vol1/ftp/data_collections/HGSVC3/release/Variant_Calls/1.0/GRCh38/variants_GRCh38_sv_insdel_sym_HGSVC2024v1.0.vcf.gz"
}
],
views=[
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr3:162,650,000-163,050,000",
"tracks": [
"hgsvc3_sv_insdel"
]
}
],
)
app # display the widgetThis view in your React 19 app, with @jbrowse/react-app2 and @jbrowse/core. Add your own files to tracks.
import { use } from 'react'
import { JBrowse } from '@jbrowse/react-app2'
import '@jbrowse/react-app2/styles.css'
import { addRelativeUris } from '@jbrowse/core/util/addRelativeUris'
const configUrl = "https://jbrowse.org/ucsc/hg38/config.json"
const configPromise = fetch(configUrl)
.then(res => res.json())
.then(config => {
addRelativeUris(config, new URL(configUrl))
return config
})
export default function Figure() {
const config = use(configPromise)
return (
<JBrowse
assemblies={config.assemblies}
tracks={[...(config.tracks ?? []), ...[
{
"type": "VariantTrack",
"trackId": "hgsvc3_sv_insdel",
"name": "HGSVC3 structural variants, 5 kb and longer",
"assemblyNames": [
"hg38"
],
"uri": "https://ftp.1000genomes.ebi.ac.uk/vol1/ftp/data_collections/HGSVC3/release/Variant_Calls/1.0/GRCh38/variants_GRCh38_sv_insdel_sym_HGSVC2024v1.0.vcf.gz"
}
]]}
aggregateTextSearchAdapters={config.aggregateTextSearchAdapters}
configuration={config.configuration}
views={[
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr3:162,650,000-163,050,000",
"tracks": [
"hgsvc3_sv_insdel"
]
}
]}
/>
)
}jbrowse-img draws this view as an SVG, no browser needed. Swap --config or a track for your own.
cat > tracks.json <<'JSON'
[
{
"type": "VariantTrack",
"trackId": "hgsvc3_sv_insdel",
"name": "HGSVC3 structural variants, 5 kb and longer",
"assemblyNames": [
"hg38"
],
"uri": "https://ftp.1000genomes.ebi.ac.uk/vol1/ftp/data_collections/HGSVC3/release/Variant_Calls/1.0/GRCh38/variants_GRCh38_sv_insdel_sym_HGSVC2024v1.0.vcf.gz"
}
]
JSON
npx @jbrowse/img --config https://jbrowse.org/ucsc/hg38/config.json \
--trackConfigs tracks.json \
--assembly hg38 --loc chr3:162,650,000-163,050,000 \
--track hgsvc3_sv_insdel \
--out figure.svgFor a PNG, --out figure.png (needs rsvg-convert: apt install librsvg2-bin, brew install librsvg).
The HGSVC3 track holds every insertion and deletion, so Filter by → Edit
filters... in its track menu takes a filter that drops the records under 5
kb:
jexl:alleleLength(feature)>=5000Run QuicK-mer2 on your own samples
Run QuicK-mer2 over your aligned reads.
The lab's
tutorial takes
one 30x 1000 Genomes CRAM through count and est, and the GRCh38 k-mer index
is
prebuilt.
est writes copy number in 1 kb windows, and its four columns are bedGraph once
the decoy and EBV contigs are dropped:
grep -v decoy sample.qm2.CN.1k.bed | grep -v chrEBV >sample.bedgraph
samtools faidx GRCh38_BSM.fa
cut -f1,2 GRCh38_BSM.fa.fai >GRCh38_BSM.chrom.sizes
bedGraphToBigWig sample.bedgraph GRCh38_BSM.chrom.sizes sample.qm2.CN.1k.bwHost it, then add its URL to a heatmap track's bigWigs, or a name and url
row to samples.tsv for the Zarr build below. For an individual already in the
panel, compare your result with the lab's estimate.
Building a Zarr store from per-sample BigWigs
build_signal_zarr.ts
turns a list of BigWigs into one store. Its input is a TSV of name and url,
with an optional group column between them (here the population, which labels
and groups the rows), and it imports two npm packages:
curl -fO https://raw.githubusercontent.com/GMOD/jbrowse-components/main/scripts/build_signal_zarr.ts
npm install @gmod/bbi generic-filehandle2
node build_signal_zarr.ts \
--samples samples.tsv \
--out qm2_cn_1kb.zarr \
--region chr17:35000000-37500000 \
--region chr4:68000000-69000000 \
--region chr1:25150000-25450000 \
--region chr3:162500000-163200000 \
--levels 1000,10000The hosted store was built this way, from every sample over the windows in the figures. Three things shape a store:
--levelssets the resolution pyramid, one samples-by-bins array per entry, with coarser ones averaged from the finest. The adapter reads the coarsest level whose bins are no wider than a screen pixel, so a whole-chromosome view costs the same couple of requests. List the input's bin size first, then steps of roughly 3x such as10000,30000,100000; a 10x gap leaves a view fetching 10x the bins it can draw.--regionlimits the build to the windows you pass. The converter holds the finest level in memory and derives the rest from it, so without--regionthis panel takes a few GB at 10 kb bins and tens of GB at the 1 kb of the BigWigs; start a whole-genome pyramid coarse. The converter prints the finest level's size before allocating it and exits if it will not fit.- Summary levels above the finest store the minimum and maximum of the bins
they average alongside the mean.
encoding.y.fieldpicks which a view draws, so an amplification narrower than a bin is visible asmaxScoreand averaged away asscore.
The output is a folder of files, which any static host with CORS enabled can serve to a track. The plugin's store format gives the layout for writing a store from something other than BigWigs.
measure_signal_latency.ts
tells you whether your panel is large enough to need a store. It counts the
requests, bytes and time to fill one window from every sample's BigWig and from
your hosted store, using the readers the browser uses, and takes the same
samples.tsv:
curl -fO https://raw.githubusercontent.com/GMOD/jbrowse-components/main/scripts/measure_signal_latency.ts
# --zarr: the store's URL once hosted; both halves are read over HTTP
node measure_signal_latency.ts --samples samples.tsv \
--region chr17:36,080,000-36,270,000 \
--zarr https://example.org/qm2_cn_1kb.zarrOver the CCL3L1 window against the hosted files, at a median range request of 25 ms:
| chr17:36,080,000-36,270,000, 2504 samples | 2504 BigWigs | Zarr store |
|---|---|---|
| requests | 15,048 | 3 |
| bytes | 48.39 MB | 0.22 MB |
| wall clock | 24.5 s | 0.2 s |
Reproduce it end to end
build_1000g_cnv_zarr.sh
builds the store above. The script:
- Derives the full sample list from the Kidd lab
trackDb. - Fetches the converter and its two npm packages.
- Runs the converter over the tutorial's windows, or over every main contig
with
--whole-genome.
curl -fO https://raw.githubusercontent.com/GMOD/jbrowse-components/main/scripts/build_1000g_cnv_zarr.sh
bash build_1000g_cnv_zarr.sh # the tutorial's windows, 1kb base, into ./1000g_cnv_build
bash build_1000g_cnv_zarr.sh --whole-genome # every main contig, 10kb base and five levelsSee also
- Tutorial: CNV cohort (TCGA)
- Tutorial: Single-cell RNA and ATAC pseudobulk
- Tutorial: Structural variants (1000 Genomes)
- Tutorial: Structural variants (Dog10K)
- User guide: Quantitative track
- User guide: Clustering rows
External links
- KiddLab/kmer_1KG, the Kidd lab track hub these files come from, and KiddLab/QuicK-mer2, the caller that produced them
- The QuicK-mer2 tutorial, one sample from CRAM to copy number, with the lab's own output to check against
- Zarr v3 specification
Citations
- Shen & Kidd (2020). Rapid, Paralog-Sensitive CNV Analysis of 2457 Human Genomes Using QuicK-mer2, the citation for the copy-number data used throughout this page
- 1000 Genomes phase 3 integrated SV map
- Logsdon et al. (2025). Complex genetic variation in nearly complete human genomes, the HGSVC3 structural variant calls in the nested deletion figure
Feedback on this tutorial is welcome: contact us.