Structural variants (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.13. Desktop beta builds are coming soon.
Take the deletion of RHD, the RhD blood group gene, out of the 1000 Genomes ensemble SV callset, sort the cohort's genotypes at it, then open three of those samples' reads and watch the coverage go to zero, halve, and stay flat. The page ends on a complex call from the same cohort whose coverage does none of that.
Prerequisites
- a JBrowse instance to add tracks to (see the web quickstart or the desktop quickstart)
- a multi-sample SV VCF, bgzip-compressed and tabix-indexed, with a
.tbior.csibeside it - CRAMs aligned to the same assembly, each with its
.craibeside it
Where the data comes from
The page reads the 1000 Genomes 2022 high-coverage ensemble SV callset (Byrska-Bishop et al., 2022) against CRAMs from three of the cohort's samples and QuicK-mer2 copy number for the whole cohort.
Nothing to download: the track configs below read these files by URL.
The files
- the ensemble SV callset, 3202 samples. EBI publishes it with no mirror, so the demo reads a byte-for-byte copy on jbrowse.org1: https://jbrowse.org/demos/1000g/1KGP_3202.Illumina_ensemble_callset.freeze_V1.vcf.gz
- HG00113 (homozygous alt) high-coverage CRAM: https://1000genomes.s3.amazonaws.com/1000G_2504_high_coverage/data/ERR3240129/HG00113.final.cram
- HG00096 (heterozygous) high-coverage CRAM: https://1000genomes.s3.amazonaws.com/1000G_2504_high_coverage/data/ERR3240114/HG00096.final.cram
- HG00097 (homozygous reference) high-coverage CRAM: https://1000genomes.s3.amazonaws.com/1000G_2504_high_coverage/data/ERR3240115/HG00097.final.cram
- HG02768 high-coverage CRAM, for the complex call: https://ftp-trace.ncbi.nlm.nih.gov/1000genomes/ftp/1000G_2504_high_coverage/data/ERR3242423/HG02768.final.cram
- QuicK-mer2 copy number for the cohort, the store the
copy-number tutorial also reads. A directory
of chunks that 404s at its root, and the adapter takes it as its
uri: https://jbrowse.org/demos/1000g/qm2_cn_1kb.zarr
The RHD deletion in the 1000 Genomes SV callset
HGSV_1821 is a deletion on chr1 spanning the whole of RHD, so samples called
homozygous have no copy of that gene. Deleting RHD is the most common cause of
the RhD-negative blood type. The call is PASS and common enough to fill all
three genotype classes, which read depth separates into two copies of the gene,
one, or none.
Loading the callset, the reads and the copy-number store
The CRAMs decode against the assembly's sequence, so it must be the GRCh38 sequence the reads were aligned to, with the chromosome names the VCF uses.
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"
}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 Show all available genomes and pick it. To load the files of this config instead:
In JBrowse Desktop, Open new 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
We'll add the callset as a variant track. Swap uri for your own VCF, which
needs per-sample genotype columns and an index beside it:
Goes in the tracks array of config.json. See Tracks.
{
"type": "VariantTrack",
"trackId": "kgp_ensemble_sv",
"name": "1KGP ensemble SV calls, 3202 samples",
"assemblyNames": ["hg38"],
"uri": "https://jbrowse.org/demos/1000g/1KGP_3202.Illumina_ensemble_callset.freeze_V1.vcf.gz"
}jbrowse add-track https://jbrowse.org/demos/1000g/1KGP_3202.Illumina_ensemble_callset.freeze_V1.vcf.gz \
--trackId kgp_ensemble_sv \
--name "1KGP ensemble SV calls, 3202 samples" \
--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://jbrowse.org/demos/1000g/1KGP_3202.Illumina_ensemble_callset.freeze_V1.vcf.gz
Click Next. JBrowse reads the adapter and track type off the file name. Then fill in:
- Track name:
1KGP ensemble SV calls, 3202 samples - Assembly:
hg38
Click Add.
Open this track in JBrowse Web ↗
Open this track in JBrowse Desktop ↗ (JBrowse Desktop 5.0+)
One alignments track per sample comes next, here HG00113, the homozygous alt.
Swap uri for your own CRAM, with its .crai beside it. The other two samples
differ only in the file:
Goes in the tracks array of config.json. See Tracks.
{
"type": "AlignmentsTrack",
"trackId": "hg00113_cram",
"name": "HG00113 high coverage",
"assemblyNames": ["hg38"],
"uri": "https://1000genomes.s3.amazonaws.com/1000G_2504_high_coverage/data/ERR3240129/HG00113.final.cram"
}jbrowse add-track https://1000genomes.s3.amazonaws.com/1000G_2504_high_coverage/data/ERR3240129/HG00113.final.cram \
--trackId hg00113_cram \
--name "HG00113 high coverage" \
--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/1000G_2504_high_coverage/data/ERR3240129/HG00113.final.cram
Click Next. JBrowse reads the adapter and track type off the file name. Then fill in:
- Track name:
HG00113 high coverage - Assembly:
hg38
Click Add.
Open this track in JBrowse Web ↗
Open this track in JBrowse Desktop ↗ (JBrowse Desktop 5.0+)
The copy-number track reads the Zarr store through jbrowse-plugin-zarr, which
is not yet in the plugin store. Add its hosted bundle to the config's plugins:
{
"plugins": [
{
"name": "Zarr",
"url": "https://jbrowse.org/demos/zarr/jbrowse-plugin-zarr.umd.production.min.js"
}
]
}The track below reads the store; the copy-number tutorial builds one from your own BigWigs:
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": "span",
"origin": 2,
"scales": { "y": { "domainMin": 0, "domainMax": 4 } },
"color": {
"field": "score",
"scale": "threshold",
"range": ["#2166ac", "#b2182b"],
"title": "Copy number"
}
}
}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": "span",
"origin": 2,
"scales": { "y": { "domainMin": 0, "domainMax": 4 } },
"color": {
"field": "score",
"scale": "threshold",
"range": ["#2166ac", "#b2182b"],
"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": "span",
"origin": 2,
"scales": { "y": { "domainMin": 0, "domainMax": 4 } },
"color": {
"field": "score",
"scale": "threshold",
"range": ["#2166ac", "#b2182b"],
"title": "Copy number"
}
}
}Navigate to chr1:25,200,000-25,400,000, the genotype figure's window. In
grammar-of-graphics terms, the copy-number track's mark is the shape drawn,
scales.y its y scale and color a color scale on score.
Sorting the cohort by genotype at the RHD deletion
Switch the callset track to Display types → Multi-sample variant display from the track menu. Each sample becomes a row drawn at the variant's genomic span, so the deletion is a wide block. Clicking it opens the feature details panel, whose SAMPLES section lists every sample's genotype, read depth and other fields.
Rows start in the callset's order. Right-click the deletion and pick Sort by genotype to order rows by genotype at that call, then by how far each keeps matching its neighbours. Clustering → Cluster rows by genotype... in the track menu instead clusters rows by genotypes across the whole window, with a dendrogram.
In the matrix, dark blue is no copy of RHD, light blue one and grey two. The
olive stripe is HGSV_1823, a small copy-number record nested inside the
deletion. The callset gives most of the cohort a no-call there (no genotype
reported), but QuicK-mer2 measures copy number per bin from the reads, so the
olive no-call column is a red gain in the copy-number track.
A matrix cell marks some call at that column. To see which call, load the same VCF again in the ordinary variant display, which draws each record on a separate row with its id, class and size, or color cells by SV type, as the multi-variant track guide shows.
The figure below has three tracks over NCBI RefSeq genes:
- the callset as a genotype matrix, one row per sample, sorted by genotype at the RHD deletion
- QuicK-mer2 copy number for 2504 individuals, one row each and clustered on this window, where blue is a copy lost against the diploid white and red a copy gained
- the same records in the ordinary variant display, each labelled with its id
Checking the RHD genotypes against read coverage in three samples
Open three samples' alignments, one per genotype: HG00113 homozygous alt, HG00096 heterozygous, HG00097 homozygous reference. Two settings make them comparable:
- Turn the pileup off with Show... → Show pileup in the track menu, since at this width the coverage curve shows the difference.
- Share one axis from Coverage axis... → Share axis with, ticking the other two tracks, so the samples compare by height.
Coverage over the deleted span in the top row sits just above zero. The neighbouring gene RHCE, just right of RHD, is nearly identical, so some RHCE reads land in the empty RHD footprint.
Reading a complex call in HG02768 from read-pair orientation
A balanced rearrangement such as an inversion leaves coverage unchanged but changes read-pair orientation, meaning which strand each mate maps to. HG02768 has a complex call, an inversion with a duplicated copy, with coverage like the rest of its arm.
Put 1:39,658,200-39,661,800 in the location box and add HG02768's CRAM as a
track the same way as HG00113's.
Read connections → SV channels (pairs by orientation) in the track menu splits the reads into one band per orientation class, each with a separate coverage curve and arcs:
- The normal-orientation band holds the flat coverage profile
- The two same-strand bands (both mates on one strand) each draw a bundle of arcs on one pair of breakpoints, the inversion signature
- The outward-pointing band (mates facing away from each other), where a tandem duplication would go, stays near empty
The call also lists a duplicated copy in INFO.CPX_INTERVALS, which no band
shows. A copy inserted beside its origin leaves pair orientation unchanged, so
that half of the call rests on coverage, where noise at this size makes bumps as
wide as the duplication.
See also
- Tutorial: Low-mappability regions (SMN)
- Tutorial: Phased trio analysis (1000 Genomes)
- Tutorial: Structural variants (Dog10K)
- Tutorial: CNV across a population (1000 Genomes)
- Tutorial: Structural variants (Cancer GIAB)
- User guide: SV inspector view
- User guide: SV visualization
- User guide: Multi-sample variant display
- User guide: Clustering rows
- Docs: jbrowse-anywidget
Notes
-
The file EBI publishes is at https://ftp.1000genomes.ebi.ac.uk/vol1/ftp/data_collections/1000G_2504_high_coverage/working/20210124.SV_Illumina_Integration/1KGP_3202.Illumina_ensemble_callset.freeze_V1.vcf.gz and the jbrowse.org copy is byte-for-byte that. The CRAM urls above are the Registry of Open Data mirror of the same 1000 Genomes ftp tree, which answers a range request in a fraction of the time EBI takes. ↩
Feedback on this tutorial is welcome: contact us.