Complex rearrangements and derivative alleles
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.
Cancer genomes have rearrangements that join several distant pieces of the genome into one molecule through a chain of junctions, each joining two distant stretches. We follow one such chain in the COLO829 melanoma cell line across the three chromosomes it visits, in a breakpoint split view, then align the derivative allele assembled from the reads that span it to the reference, in a synteny view.
Prerequisites
- a JBrowse to open them in: Desktop takes a local file by path, Web through Add track
- Command line tools (JBrowse CLI)
- samtools (v1.21 or later)
- minimap2
bedGraphToBigWigfrom the UCSC utilitiespython3- a GRCh38 FASTA, and roughly 40 GB of free disk
On Debian/Ubuntu, apt install samtools minimap2 python3 covers three of those;
bedGraphToBigWig is a single static binary from UCSC and node, for the CLI,
comes from nodejs.org.
Where the data comes from
All but the last file come from the ONT COLO829 open-data release and its
wf-somatic-variation run; the last is the multi-platform truth set
(Valle-Inclán et al. 2022).
The build script takes these files from their URLs, so there is nothing to download by hand.
- COLO829 tumor reads (ONT R10, haplotagged): ont-open-data.s3.amazonaws.com/…/COLO829_tumor.ht.cramhttps://ont-open-data.s3.amazonaws.com/colo829_2024.03/wf_somatic_variation/sup/COLO829_tumor.ht.cram
- COLO829BL matched normal reads: ont-open-data.s3.amazonaws.com/…/PAU59807.d052sup4305mCG_5hmCGvHg38.bamhttps://ont-open-data.s3.amazonaws.com/colo829_2024.03/basecalls/colo829bl/sup/PAU59807.d052sup4305mCG_5hmCGvHg38.bam
- the somatic SV calls this page works from: ont-open-data.s3.amazonaws.com/…/COLO829.wf-somatic-sv.vcf.gzhttps://ont-open-data.s3.amazonaws.com/colo829_2024.03/wf_somatic_variation/sup/COLO829.wf-somatic-sv.vcf.gz
- mosdepth coverage regions, tumor: ont-open-data.s3.amazonaws.com/…/COLO829_tumor.regions.bed.gzhttps://ont-open-data.s3.amazonaws.com/colo829_2024.03/wf_somatic_variation/sup/COLO829/qc/coverage/COLO829_tumor.regions.bed.gz
- mosdepth coverage regions, normal: ont-open-data.s3.amazonaws.com/…/COLO829_normal.regions.bed.gzhttps://ont-open-data.s3.amazonaws.com/colo829_2024.03/wf_somatic_variation/sup/COLO829/qc/coverage/COLO829_normal.regions.bed.gz
- the GRCh38 build the CRAM decodes against, and the der(3) (derivative chromosome 3) contig aligns to: ont-open-data.s3.amazonaws.com/…/GCA_000001405.15_GRCh38_no_alt_analysis_set.fastahttps://ont-open-data.s3.amazonaws.com/colo829_2024.03/wf_somatic_variation/sup/GCA_000001405.15_GRCh38_no_alt_analysis_set.fasta
- the COLO829 somatic SV truth set, lifted to GRCh38: zenodo.org/…/contenthttps://zenodo.org/api/records/4716169/files/truthset_somaticSVs_COLO829_hg38lifted.vcf/content
COLO829 and its coverage tracks
The demo's tumor and normal coverage tracks are the wf-somatic-variation run's
mosdepth output in 50 kb windows, converted to bigWig:
# awk keeps the contigs in hg38.chrom.sizes; bedGraphToBigWig fails on any other
gzip -dc COLO829_tumor.regions.bed.gz | sort -k1,1 -k2,2n |
awk 'NR==FNR{ok[$1];next} ($1 in ok)' hg38.chrom.sizes - > cov.bg
bedGraphToBigWig cov.bg hg38.chrom.sizes COLO829_tumor.coverage.bwThe rearrangement chain across chr3, chr10 and chr12
A series of junctions can bring two genes together, as in the KLHDC2-SNTB1 fusion of the SK-BR-3 breast cancer line (Nattestad et al. 2018). The chain this page follows is COLO829's der(3), a derivative chromosome 3 assembled from pieces of three chromosomes, whose three junctions close a triangle across chr3, chr10 and chr12:
chr3:25,359,111 <-> chr12:72,273,112
chr3:25,359,568 <-> chr10:58,717,464
chr10:58,717,662 <-> chr12:72,273,294The genes involved are RARB (a tumor suppressor) on chr3, BICC1 on chr10, and TRHDE on chr12.
Tumor and normal reads at the chr3 breakpoints
The ONT reads are aligned to GRCh38, so we load that assembly and the two read
tracks. Each read file needs its index beside it, a .crai for the CRAM and a
.bai for the BAM; for your own sample, swap the uri:
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
Goes in the tracks array of config.json. See Tracks.
{
"trackId": "COLO829_tumor_ont",
"name": "COLO829 tumor (ONT R10)",
"uri": "https://ont-open-data.s3.amazonaws.com/colo829_2024.03/wf_somatic_variation/sup/COLO829_tumor.ht.cram",
"assemblyNames": ["hg38"]
}jbrowse add-track https://ont-open-data.s3.amazonaws.com/colo829_2024.03/wf_somatic_variation/sup/COLO829_tumor.ht.cram \
--trackId COLO829_tumor_ont \
--name "COLO829 tumor (ONT R10)" \
--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://ont-open-data.s3.amazonaws.com/colo829_2024.03/wf_somatic_variation/sup/COLO829_tumor.ht.cram
Click Next. JBrowse reads the adapter and track type off the file name. Then fill in:
- Track name:
COLO829 tumor (ONT R10) - Assembly:
hg38
Click Add.
Open this track in JBrowse Web ↗
Open this track in JBrowse Desktop ↗ (JBrowse Desktop 5.0+)
Goes in the tracks array of config.json. See Tracks.
{
"trackId": "COLO829BL_normal_ont",
"name": "COLO829BL matched normal (ONT R10)",
"uri": "https://ont-open-data.s3.amazonaws.com/colo829_2024.03/basecalls/colo829bl/sup/PAU59807.d052sup4305mCG_5hmCGvHg38.bam",
"assemblyNames": ["hg38"]
}jbrowse add-track https://ont-open-data.s3.amazonaws.com/colo829_2024.03/basecalls/colo829bl/sup/PAU59807.d052sup4305mCG_5hmCGvHg38.bam \
--trackId COLO829BL_normal_ont \
--name "COLO829BL matched normal (ONT R10)" \
--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://ont-open-data.s3.amazonaws.com/colo829_2024.03/basecalls/colo829bl/sup/PAU59807.d052sup4305mCG_5hmCGvHg38.bam
Click Next. JBrowse reads the adapter and track type off the file name. Then fill in:
- Track name:
COLO829BL matched normal (ONT R10) - Assembly:
hg38
Click Add.
Open this track in JBrowse Web ↗
Open this track in JBrowse Desktop ↗ (JBrowse Desktop 5.0+)
The breakends come from the run's somatic SV calls, which need their .tbi
beside them:
Goes in the tracks array of config.json. See Tracks.
{
"trackId": "COLO829_somatic_sv",
"name": "COLO829 somatic SVs (nanomonsv)",
"uri": "https://ont-open-data.s3.amazonaws.com/colo829_2024.03/wf_somatic_variation/sup/COLO829.wf-somatic-sv.vcf.gz",
"assemblyNames": ["hg38"]
}jbrowse add-track https://ont-open-data.s3.amazonaws.com/colo829_2024.03/wf_somatic_variation/sup/COLO829.wf-somatic-sv.vcf.gz \
--trackId COLO829_somatic_sv \
--name "COLO829 somatic SVs (nanomonsv)" \
--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://ont-open-data.s3.amazonaws.com/colo829_2024.03/wf_somatic_variation/sup/COLO829.wf-somatic-sv.vcf.gz
Click Next. JBrowse reads the adapter and track type off the file name. Then fill in:
- Track name:
COLO829 somatic SVs (nanomonsv) - Assembly:
hg38
Click Add.
Open this track in JBrowse Web ↗
Open this track in JBrowse Desktop ↗ (JBrowse Desktop 5.0+)
Open the SV calls and the tumor and normal read tracks at
chr3:25,357,600-25,361,000. The tumor reads end in soft clipping, an end the
aligner left unaligned, because every read crossing the junction continues on
another chromosome. The matched normal is clean.
- Show... → Show soft clipping in the track menu draws the clipped ends, which are off by default.
- Sort by... → Split reads first lifts the reads that continue on another chromosome to the top of the pileup.
- Force load approves the download when the track asks first because the pileup is deep, and holds for the rest of the session.
Following the chain across breakpoint split view panels
A breakpoint split view stacks the loci a rearrangement visits, one panel per locus, and draws the reads that leave one panel and arrive in another. Two ways to open one:
- Add → Breakpoint split view builds it from loci you already know, one row per panel.
- Right-click a record in the variant track and choose Open breakpoint split view. The dialog asks for the layout (two stacked panels, or one row spanning both breakends) and the window each panel opens at.
A breakend (BND) record names one partner, so on its own it opens two panels. Check Follow further breakends at each end to add the rest of the chain:
- The dialog searches the callset at each end for another junction leaving from the same place and adds it when exactly one exists.
- The search stops at a locus with two candidates, or at one leading back into the chain.
- The search assumes two junctions leaving one locus belong to one molecule, and reads crossing both are the evidence.
- From the chr3 record this chain starts at, the search finds three panels: the chr10 breakend has a second junction a couple of hundred bases away, and its far end is on chr12.
To follow a single read, right-click it and choose Linear read vs ref. JBrowse opens a synteny view with the read as an assembly along the bottom and every locus it touches along the top, the layout Ribbon (Nattestad et al. 2021) introduced.
Assembling the der(3) derivative allele and aligning it to GRCh38
The cancer SV demo config, https://jbrowse.org/demos/cancer_sv/config.json, includes a der(3) contig assembled from the tumor reads that span all three loci, so every base in it comes from those reads.
To build one from your own data, pull the reads crossing the loci with
samtools view, assemble them with
Flye,
Shasta or
hifiasm, and align the contigs to the
reference:
# asm5: same-species preset; -c: base-level CIGAR, to draw junctions at base scale
minimap2 -cx asm5 GRCh38.fa contigs.fa > der3.vs_reference.paf
jbrowse make-pif der3.vs_reference.pafThe published contig aligns to the reference in four blocks:
derivative 0-32732 + -> chr3:25,326,821-25,359,568
derivative 32732-32931 + -> chr10:58,717,463-58,717,662
derivative 32932-33115 - -> chr12:72,273,111-72,273,294
derivative 33126-39549 - -> chr3:25,352,683-25,359,111The chr10 and chr12 pieces are templated insertions: stretches of other chromosomes copied in where the break was repaired.
Index the contigs, then load the contig as an assembly and the PAF as a synteny track between it and GRCh38:
samtools faidx contigs.faGoes in the assemblies array of config.json. See Assemblies.
{
"name": "der3_RARB_BICC1_TRHDE",
"uri": "contigs.fa"
}jbrowse add-assembly contigs.fa \
--name der3_RARB_BICC1_TRHDE \
--load copyIn 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:
contigs.fa
contigs.fa.faiJBrowse reads the format off the file name. Then fill in:
- Genome name:
der3_RARB_BICC1_TRHDE
contigs.fa is relative to a config.json. Replace it with its URL or its path on this computer.
The track lists the query assembly (the contig) first and the target (GRCh38) second, the reverse of the minimap2 argument order. Reversed, the view opens empty and reports no error:
Goes in the tracks array of config.json. See Tracks.
{
"type": "SyntenyTrack",
"trackId": "der3_vs_hg38",
"name": "der3 contig vs hg38",
"assemblyNames": ["der3_RARB_BICC1_TRHDE", "hg38"],
"adapter": {
"type": "PairwiseIndexedPAFAdapter",
"uri": "der3.vs_reference.pif.gz",
"queryAssembly": "der3_RARB_BICC1_TRHDE",
"targetAssembly": "hg38"
}
}jbrowse add-track-json '{
"type": "SyntenyTrack",
"trackId": "der3_vs_hg38",
"name": "der3 contig vs hg38",
"assemblyNames": ["der3_RARB_BICC1_TRHDE", "hg38"],
"adapter": {
"type": "PairwiseIndexedPAFAdapter",
"uri": "der3.vs_reference.pif.gz",
"queryAssembly": "der3_RARB_BICC1_TRHDE",
"targetAssembly": "hg38"
}
}'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": "SyntenyTrack",
"trackId": "der3_vs_hg38",
"name": "der3 contig vs hg38",
"assemblyNames": ["der3_RARB_BICC1_TRHDE", "hg38"],
"adapter": {
"type": "PairwiseIndexedPAFAdapter",
"uri": "der3.vs_reference.pif.gz",
"queryAssembly": "der3_RARB_BICC1_TRHDE",
"targetAssembly": "hg38"
}
}der3.vs_reference.pif.gz is relative to a config.json. Replace it with its URL or its path on this computer.
That shows it in the linear view. For the synteny view, open Add → Linear synteny view, pick the track under Quick start, and click Launch.
Add the truth set, called on five platforms before this ONT run existed, so every junction has an independent call to check against:
Goes in the tracks array of config.json. See Tracks.
{
"type": "VariantTrack",
"trackId": "COLO829_truth_set",
"name": "COLO829 validated somatic SVs (Valle-Inclán 2022)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "VcfAdapter",
"uri": "https://zenodo.org/api/records/4716169/files/truthset_somaticSVs_COLO829_hg38lifted.vcf/content"
}
}jbrowse add-track-json '{
"type": "VariantTrack",
"trackId": "COLO829_truth_set",
"name": "COLO829 validated somatic SVs (Valle-Inclán 2022)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "VcfAdapter",
"uri": "https://zenodo.org/api/records/4716169/files/truthset_somaticSVs_COLO829_hg38lifted.vcf/content"
}
}'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": "COLO829_truth_set",
"name": "COLO829 validated somatic SVs (Valle-Inclán 2022)",
"assemblyNames": ["hg38"],
"adapter": {
"type": "VcfAdapter",
"uri": "https://zenodo.org/api/records/4716169/files/truthset_somaticSVs_COLO829_hg38lifted.vcf/content"
}
}Open this track in JBrowse Web ↗
Open this track in JBrowse Desktop ↗ (JBrowse Desktop 5.0+)
The assembly, synteny track and truth set above reproduce the ribbons and arcs on your own contig; the segment labels, projected gene annotation and realigned reads below come from the demo's config.
Open Add → Linear synteny view with hg38 on the top row and
der3_RARB_BICC1_TRHDE below, and pick der3 contig vs hg38 as the synteny
track. The view shows:
- ribbons colored by the reference chromosome each segment came from
- a BED track on the derivative labelling each segment with its reference interval, which the gene track cannot do because a segment usually sits inside one large intron
- the reference gene annotation projected onto the derivative: the first coding exon of RARB, a short stretch of TRHDE coding sequence in reverse, then RARB again, inverted
- the tumor's split reads under the reference row, one row per molecule, with the truth set's validated calls above them
- each junction drawn once as an arc, with a tick at each end over the sequence retained there. Ticks pointing apart mark a deletion-type join, ticks pointing toward each other a duplication-type join, and parallel ticks an inversion.
Checking the der(3) contig against the reads and the truth set
Zoom the synteny view to the kilobase holding the junctions, where the two inserts have separate ribbons. The truth set has a validated call at each place the split reads stop against hg38, and most of the same reads cross all three junctions in one alignment when realigned to the derivative.
The consensus was polished from these reads, so the realignment shows that they agree with each other. The truth set, called from other platforms, is the independent check.
Each hg38 window is wider than the piece the allele uses, and the read track shows split alignments only, so its coverage counts reads that cross a junction and steps down as each arm ends.
Reproduce it end to end
scripts/build_cancer_sv_demo.sh
builds everything above from public sources into ./cancer_sv_build/jbrowse2.
For COLO829 the script:
- Converts the coverage to bigWig as above.
- Adds the tumor and normal reads as tracks streamed from ONT's bucket.
- Downloads the published der(3) contig with its alignment to GRCh38, its segment labels and the spanning reads realigned to it.
The derivative allele shows how to assemble a contig like it from your own reads. The same run builds the K562 half of the demo, which Gene fusion calls and the DNA behind them walks through.
curl -fO https://raw.githubusercontent.com/GMOD/jbrowse-components/main/scripts/build_cancer_sv_demo.sh
bash build_cancer_sv_demo.sh
npx --yes serve cancer_sv_build/jbrowse2See also
- Tutorial: Gene fusion calls and the DNA behind them
- Tutorial: Reviewing a whole SV callset
- Tutorial: Structural variants from Hi-C
- Tutorial: Structural variants (Cancer GIAB)
- User guide: SV visualization
- User guide: SV inspector view
- User guide: Linear synteny view
Citations
- Valle-Inclán JE, et al. A multi-platform reference for somatic structural variation detection. Cell Genomics (2022). https://doi.org/10.1016/j.xgen.2022.100139
- Nattestad M, et al. Complex rearrangements and oncogene amplifications revealed by long-read DNA and RNA sequencing of a breast cancer cell line. Genome Research (2018). https://doi.org/10.1101/gr.231100.117
- Nattestad M, Aboukhalil R, Chin CS, Schatz MC. Ribbon: intuitive visualization for complex genomic variation. Bioinformatics (2021). https://doi.org/10.1093/bioinformatics/btaa1080
Feedback on this tutorial is welcome: contact us.