Reviewing a whole SV callset
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.17. Desktop beta builds are coming soon.
A somatic structural-variant caller reports junctions, points where two distant loci are joined, and we'll check each one in the COLO829 callset against the tumor and normal reads. We:
- render every junction as an image with
jb2export batch - render the matched normal the same way, as the control
- sort the calls with the manifest
- render a three-chromosome rearrangement with
jb2export breakpoint
Prerequisites
@jbrowse/img, which putsjb2exporton your PATH- a JBrowse for the last section (Web or Desktop)
npm install -g @jbrowse/imgThe data
The COLO829 somatic SV callset comes from the ONT open-data release's
wf-somatic-variation run
(Valle-Inclán et al. 2022),
rehosted alongside the cancer SV demo. The first
command downloads the VCF, and every command streams the reads by URL.
| What it is | File |
|---|---|
| The callset these commands fetch directly | COLO829.somatic-sv.vcf.gz |
Read by URL (no download needed)
| What it is | File |
|---|---|
The tumor reads the config's COLO829_tumor_ont track streams, Oxford Nanopore R10 from the ONT open-data release | COLO829_tumor.ht.cram |
The matched normal the config's COLO829BL_normal_ont track streams | PAU59807.d052sup4305mCG_5hmCGvHg38.bam |
Rendering every tumor junction with jb2export batch
We'll start with jb2export batch, which renders one image per record. An event
on one chromosome gets a single row, and a junction between two chromosomes gets
a breakpoint split view with one panel per chromosome.
curl -fO https://jbrowse.org/demos/cancer_sv/COLO829.somatic-sv.vcf.gz
# --track: the track id, then display settings as key:value pairs
# --flank: bases drawn either side of each breakend
# --manifest: writes manifest.tsv beside the images
jb2export batch --sites COLO829.somatic-sv.vcf.gz \
--config https://jbrowse.org/demos/cancer_sv/config.json --assembly hg38 \
--track COLO829_tumor_ont height:240 \
--outDir tumor --flank 600 --width 1100 --manifestEach image is named 002_chr1_33053494-chr6_2919922_r_0_0.png: the record's
index in the callset, its coordinates, and the caller's ID where it has one.
For your own callset, point --config at a JBrowse config with the assembly and
an alignments track whose reads have an index (.bai or .crai) beside them.
The VCF's chromosome names must match the assembly's:
# --dryRun: list each row's file and loci without rendering
# --limit: render only the first rows; a later --resume run keeps them
# --passOnly: drop records the caller filtered out
# --jobs: render processes, about a gigabyte each
jb2export batch --sites calls.vcf.gz \
--config your/config.json --assembly <assemblyName> --track <trackId> \
--outDir out --passOnly --limit 20Rendering the matched normal as the control
Next we'll render the matched normal into a second directory. Each call keeps
its file name across tumor/ and normal/:
jb2export batch --sites COLO829.somatic-sv.vcf.gz \
--config https://jbrowse.org/demos/cancer_sv/config.json --assembly hg38 \
--track COLO829BL_normal_ont height:240 \
--outDir normal --flank 600 --width 1100 --manifestThe caller filed 009_chr1_168055349-chr19_23850381 as somatic, but the normal
has the same curves, so the junction is germline.
Sorting the calls with the manifest
Each manifest.tsv row describes one image:
linkscounts the split reads with pieces in more than one window. Sorttumor/manifest.tsvon it to put the unsupported calls first; re-render one with a wider--flankbefore calling it false.altholds, for an SNV, indel,<DEL>or<INS>, the reads carrying the ALT over the reads covering it (17/41). A deletion that one alignment holds has its reads here and alinksof zero.specis the view as a session spec that opens the same windows in JBrowse.lineis the record's line in the VCF, to join a row back to the callset.
A dense fan in a region of ragged coverage is usually a repeat, since a read mismapped there draws a curve like any other.
Rendering a three-chromosome rearrangement
COLO829's der(3) joins pieces of chr3, chr10 and chr12, and its reads visit all
three. We'll render it with jb2export breakpoint, one --loc per panel, then
run the same command with COLO829BL_normal_ont as the control:
# featureHeight:super-compact draws each read 1 px tall
jb2export breakpoint \
--config https://jbrowse.org/demos/cancer_sv/config.json --assembly hg38 \
--track COLO829_tumor_ont height:130 force:true featureHeight:super-compact \
--loc chr3:25,358,511-25,359,711 \
--loc chr10:58,716,962-58,718,162 \
--loc chr12:72,272,512-72,273,712 \
--width 1000 --out der3_tumor.pngThe complex rearrangements tutorial builds the reconstructed contig on the right.
Opening a call in the browser
Take the coordinates from an image's filename, open the SV inspector on the same VCF, and click through to the breakpoint split view, which adds the gene track and read details.
Rendering calls from other SV callers
jb2export batch and jb2export breakpoint read any caller that writes
breakends or symbolic SVs (such as <DEL>) to a VCF:
- cuteSV, Sniffles, pbsv, Delly, Manta and GRIDSS write a VCF that
--sitesreads directly. - LINX writes clusters and chained links as TSVs. Convert the junction columns
to the six BEDPE columns with
awkand pass the.bedpefile as--sites. - To draw PURPLE's copy-number segments under the reads, convert them to a
bedGraph, run
bedGraphToBigWig, and pass the result as--bigwig.
A caller that groups one rearrangement's junctions under VCF 4.4's EVENT key,
as DRAGEN and the C-GIAB benchmark do, gets the der(3) image from batch
itself, which renders each event visiting more than two loci once more as
event_<n>_<label>. Severus writes the grouping as CLUSTERID, which the
SV inspector guide
renames to EVENT.
See also
- Tutorial: Complex rearrangements and derivative alleles
- Tutorial: Structural variants (Cancer GIAB) part 1: breakpoints
- Tutorial: Low-mappability regions (SMN)
- User guide: SV inspector view
- User guide: SV visualization
- Docs: Static image export (@jbrowse/img)
Citations
- Valle-Inclán et al. (2022). A multi-platform reference for somatic structural variation detection
Feedback on this tutorial is welcome: contact us.