Rearrangements between genomes by type (SyRI)
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.
The Columbia and Landsberg accessions of Arabidopsis thaliana differ by an inversion of more than a megabase on the short arm of chromosome 4, first seen under the microscope and later confirmed by assembling Landsberg. SyRI sorts a whole-genome alignment into syntenic, inverted, translocated and duplicated regions. We find the inversion again with it, then compare four more accessions. We:
- run SyRI on each aligned pair of accessions, and turn its output into a JBrowse config with syri2jbrowse
- color the ribbons by SyRI type in a linear synteny view of two accessions
- stack all six accessions in one linear synteny view, as plotsr does
- draw the accessions as lanes under Columbia, beside a row of SyRI regions per accession
Prerequisites
minimap2andsamtools- SyRI (
syri), from bioconda, or Docker, which runs its biocontainers image - syri2jbrowse, which needs only Python
- The NCBI
datasetsCLI, to fetch the assemblies - A running JBrowse instance (the web quickstart or the desktop quickstart)
# Debian/Ubuntu
sudo apt install samtools minimap2
# or conda, which has every tool above
conda install -c bioconda -c conda-forge samtools minimap2 ncbi-datasets-cli \
syri
# or Linux x86_64 binaries for the tools apt lacks
wget -P ~/.local/bin \
https://ftp.ncbi.nlm.nih.gov/pub/datasets/command-line/v2/linux-amd64/datasets \
https://ftp.ncbi.nlm.nih.gov/pub/datasets/command-line/v2/linux-amd64/dataformat
chmod +x ~/.local/bin/datasets ~/.local/bin/dataformat
# any platform
pip install git+https://github.com/cmdcolin/syri2jbrowseThe data
TAIR10 for Columbia, and the chromosome-level assemblies of five more accessions from Jiao and Schneeberger 2020. The build script fetches them all.
| What it is | File |
|---|---|
| Col-0, GCF_000001735.4 | GCF_000001735.4_TAIR10.1/ |
| Ler, GCA_902460285.1 | GCA_902460285.1_Arabidopsis_thaliana_Ler/ |
| Cvi-0, GCA_902460275.1 | GCA_902460275.1_Arabidopsis_thaliana_Cvi-0/ |
| Eri-1, GCA_902460315.1 | GCA_902460315.1_Arabidopsis_thaliana_Eri-1/ |
| Kyo, GCA_902460305.1 | GCA_902460305.1_Arabidopsis_thaliana_Kyo/ |
| Sha, GCA_902460295.1 | GCA_902460295.1_Arabidopsis_thaliana_Sha/ |
Aligning a pair and running SyRI
SyRI reads a whole-genome alignment of two chromosome-level assemblies whose homologous chromosomes share a name. For each pair:
# asm5 is the preset for genomes of one species
# --eqx writes = and X in the CIGAR, which SyRI reads the mismatches from
minimap2 -cx asm5 --eqx Col-0.fa Ler.fa >Col-0_Ler.aln.paf
# -F P says the alignment is PAF
# --nc runs that many chromosomes at once
syri -c Col-0_Ler.aln.paf -r Col-0.fa -q Ler.fa -F P --prefix Col-0_Ler. --nc 5We run it on each accession against the one above it, the pairs plotsr stacks, and on each accession against Col-0.
From SyRI to a JBrowse config
syri2jbrowse takes plotsr's inputs: a genomes file listing each FASTA and its
name in stack order, and one --sr per neighbouring pair. Each --pair adds an
accession against Col-0:
Col-0.fa Col-0
Ler.fa Ler
Cvi.fa Cvi
Eri.fa Eri
Kyo.fa Kyo
Sha.fa Shasyri2jbrowse --genomes genomes.txt -o . \
--sr Col-0_Ler.syri.out --sr Ler_Cvi.syri.out --sr Cvi_Eri.syri.out \
--sr Eri_Kyo.syri.out --sr Kyo_Sha.syri.out \
--pair Col-0 Cvi Col-0_Cvi.syri.out --pair Col-0 Eri Col-0_Eri.syri.out \
--pair Col-0 Kyo Col-0_Kyo.syri.out --pair Col-0 Sha Col-0_Sha.syri.outIt writes config.json with one assembly per accession, read from a
.chrom.sizes beside it:
Goes in the assemblies array of config.json. See Assemblies.
{
"name": "Col-0",
"uri": "Col-0.chrom.sizes"
}Edits config.json in the current folder, creating it if there is none. See JBrowse CLI with Desktop.
jbrowse add-assembly Col-0.chrom.sizes \
--name Col-0 \
--load copyIn JBrowse Desktop, Open your own genome on the start screen (or File → Open genome... in a session), then Open from a URL and paste:
Col-0.chrom.sizesJBrowse reads the format off the file name. Then fill in:
- Genome name:
Col-0
Col-0.chrom.sizes is relative to a config.json. Replace it with its URL or its path on this computer.
and two tracks. The first holds every region as a PAF record whose syri tag is
its type and color tag plotsr's color for it. attributeColumns offers both
on the palette button, and the MultiWaySyntenyDisplay entry sets up the
lanes:
Goes in the tracks array of config.json. See Tracks.
{
"type": "SyntenyTrack",
"trackId": "syri",
"name": "SyRI regions",
"assemblyNames": ["Col-0", "Ler", "Cvi", "Eri", "Kyo", "Sha"],
"adapter": {
"type": "MultiGenomePAFAdapter",
"uri": "syri.paf",
"attributeColumns": ["syri", "color"]
},
"displays": [
{
"type": "MultiWaySyntenyDisplay",
"rows": { "sort": ["Ler", "Cvi", "Eri", "Kyo", "Sha"] },
"ribbons": {
"encoding": {
"color": {
"field": "syri",
"scale": {
"domain": ["SYN", "INV", "TRANS", "INVTR", "DUP", "INVDP"]
}
},
"opacity": 0.7
}
}
}
]
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track-json '{
"type": "SyntenyTrack",
"trackId": "syri",
"name": "SyRI regions",
"assemblyNames": ["Col-0", "Ler", "Cvi", "Eri", "Kyo", "Sha"],
"adapter": {
"type": "MultiGenomePAFAdapter",
"uri": "syri.paf",
"attributeColumns": ["syri", "color"]
},
"displays": [
{
"type": "MultiWaySyntenyDisplay",
"rows": { "sort": ["Ler", "Cvi", "Eri", "Kyo", "Sha"] },
"ribbons": {
"encoding": {
"color": {
"field": "syri",
"scale": {
"domain": ["SYN", "INV", "TRANS", "INVTR", "DUP", "INVDP"]
}
},
"opacity": 0.7
}
}
}
]
}'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": "syri",
"name": "SyRI regions",
"assemblyNames": ["Col-0", "Ler", "Cvi", "Eri", "Kyo", "Sha"],
"adapter": {
"type": "MultiGenomePAFAdapter",
"uri": "syri.paf",
"attributeColumns": ["syri", "color"]
},
"displays": [
{
"type": "MultiWaySyntenyDisplay",
"rows": { "sort": ["Ler", "Cvi", "Eri", "Kyo", "Sha"] },
"ribbons": {
"encoding": {
"color": {
"field": "syri",
"scale": {
"domain": ["SYN", "INV", "TRANS", "INVTR", "DUP", "INVDP"]
}
},
"opacity": 0.7
}
}
}
]
}syri.paf 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.
The second places each accession's regions on Col-0, a BED row per region whose
name is its type and whose query column names the accession. rows gives
each accession a row, encoding.color maps the type to plotsr's colors in
plotsr's order, and disableGeneHeuristic keeps the lanes from drawing it as
Col-0's genes:
Goes in the tracks array of config.json. See Tracks.
{
"type": "FeatureTrack",
"trackId": "syri_regions_on_Col-0",
"name": "SyRI regions on Col-0, by genome",
"assemblyNames": ["Col-0"],
"adapter": {
"type": "BedAdapter",
"uri": "syri_regions.bed",
"columnNames": [
"chrom",
"chromStart",
"chromEnd",
"name",
"score",
"strand",
"thickStart",
"thickEnd",
"itemRgb",
"query"
],
"disableGeneHeuristic": true
},
"displays": [
{
"type": "LinearMultiRowFeatureDisplay",
"rows": { "field": "query", "sort": ["Ler", "Cvi", "Eri", "Kyo", "Sha"] },
"encoding": {
"color": {
"field": "name",
"scale": {
"domain": ["SYN", "INV", "TRANS", "INVTR", "DUP", "INVDP"],
"range": [
"#cccccc",
"#ffa500",
"#9acd32",
"#9acd32",
"#00bbff",
"#00bbff"
]
},
"legend": { "title": "syri" }
}
}
}
]
}Edits config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse add-track-json '{
"type": "FeatureTrack",
"trackId": "syri_regions_on_Col-0",
"name": "SyRI regions on Col-0, by genome",
"assemblyNames": ["Col-0"],
"adapter": {
"type": "BedAdapter",
"uri": "syri_regions.bed",
"columnNames": [
"chrom",
"chromStart",
"chromEnd",
"name",
"score",
"strand",
"thickStart",
"thickEnd",
"itemRgb",
"query"
],
"disableGeneHeuristic": true
},
"displays": [
{
"type": "LinearMultiRowFeatureDisplay",
"rows": { "field": "query", "sort": ["Ler", "Cvi", "Eri", "Kyo", "Sha"] },
"encoding": {
"color": {
"field": "name",
"scale": {
"domain": ["SYN", "INV", "TRANS", "INVTR", "DUP", "INVDP"],
"range": [
"#cccccc",
"#ffa500",
"#9acd32",
"#9acd32",
"#00bbff",
"#00bbff"
]
},
"legend": { "title": "syri" }
}
}
}
]
}'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": "syri_regions_on_Col-0",
"name": "SyRI regions on Col-0, by genome",
"assemblyNames": ["Col-0"],
"adapter": {
"type": "BedAdapter",
"uri": "syri_regions.bed",
"columnNames": [
"chrom",
"chromStart",
"chromEnd",
"name",
"score",
"strand",
"thickStart",
"thickEnd",
"itemRgb",
"query"
],
"disableGeneHeuristic": true
},
"displays": [
{
"type": "LinearMultiRowFeatureDisplay",
"rows": { "field": "query", "sort": ["Ler", "Cvi", "Eri", "Kyo", "Sha"] },
"encoding": {
"color": {
"field": "name",
"scale": {
"domain": ["SYN", "INV", "TRANS", "INVTR", "DUP", "INVDP"],
"range": [
"#cccccc",
"#ffa500",
"#9acd32",
"#9acd32",
"#00bbff",
"#00bbff"
]
},
"legend": { "title": "syri" }
}
}
}
]
}syri_regions.bed is relative to a config.json. Replace it with its URL or its path on this computer.
Columbia against Landsberg on chromosome 4
Open the first 6 Mb of chromosome 4 in both accessions and pick syri under Color by value on the palette button in the view header:
Goes at the top level of config.json, replacing any defaultSession there. See Default session.
{
"defaultSession": {
"name": "Col-0 vs Ler, chromosome 4",
"views": [
{
"type": "LinearSyntenyView",
"views": [
{ "assembly": "Col-0", "loc": "Chr4:1-6,000,000" },
{ "assembly": "Ler", "loc": "Chr4:1-6,000,000" }
],
"tracks": [["syri"]],
"encoding": {
"color": {
"field": "syri",
"scale": {
"domain": ["SYN", "INV", "TRANS", "INVTR", "DUP", "INVDP"]
}
},
"opacity": 0.9
},
"mark": { "interpolate": "bump" },
"render": { "antialias": false },
"collapseEmptyRows": true,
"levelHeights": [260]
}
]
}
}Replaces any defaultSession in config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse set-default-session --session - << 'EOF'
{
"name": "Col-0 vs Ler, chromosome 4",
"views": [
{
"type": "LinearSyntenyView",
"views": [
{ "assembly": "Col-0", "loc": "Chr4:1-6,000,000" },
{ "assembly": "Ler", "loc": "Chr4:1-6,000,000" }
],
"tracks": [["syri"]],
"encoding": {
"color": {
"field": "syri",
"scale": {
"domain": ["SYN", "INV", "TRANS", "INVTR", "DUP", "INVDP"]
}
},
"opacity": 0.9
},
"mark": { "interpolate": "bump" },
"render": { "antialias": false },
"collapseEmptyRows": true,
"levelHeights": [260]
}
]
}
EOFOpen this session 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=test_data%2Fsyri%2Fconfig.json&session=json-%7B%22session%22%3A%7B%22name%22%3A%22Col-0+vs+Ler%2C+chromosome+4%22%2C%22views%22%3A%5B%7B%22type%22%3A%22LinearSyntenyView%22%2C%22views%22%3A%5B%7B%22assembly%22%3A%22Col-0%22%2C%22loc%22%3A%22Chr4%3A1-6%2C000%2C000%22%7D%2C%7B%22assembly%22%3A%22Ler%22%2C%22loc%22%3A%22Chr4%3A1-6%2C000%2C000%22%7D%5D%2C%22tracks%22%3A%5B%5B%22syri%22%5D%5D%2C%22encoding%22%3A%7B%22color%22%3A%7B%22field%22%3A%22syri%22%2C%22scale%22%3A%7B%22domain%22%3A%5B%22SYN%22%2C%22INV%22%2C%22TRANS%22%2C%22INVTR%22%2C%22DUP%22%2C%22INVDP%22%5D%7D%7D%2C%22opacity%22%3A0.9%7D%2C%22mark%22%3A%7B%22interpolate%22%3A%22bump%22%7D%2C%22render%22%3A%7B%22antialias%22%3Afalse%7D%2C%22collapseEmptyRows%22%3Atrue%2C%22levelHeights%22%3A%5B260%5D%7D%5D%7D%7D&sessionName=JBrowse+docs+exampleThe thin ribbons leaving the frame end on another chromosome, which the label at
the frame's edge names. plotsr paints INVTR as TRANS and INVDP as DUP,
so a key row names every type on screen in its color.
Stacking the accessions, one SyRI run per band
The config opens on every accession stacked, each band drawing the SyRI run
between the two genomes it joins. Like plotsr, filter hides regions under 10
kb, though plotsr keeps a short syntenic region and the filter cannot single one
out. Regions joining two chromosomes, which plotsr hides unless given --itx,
stay as the long ribbons:
Goes at the top level of config.json, replacing any defaultSession there. See Default session.
{
"defaultSession": {
"name": "Six Arabidopsis accessions, SyRI regions",
"views": [
{
"type": "LinearSyntenyView",
"views": [
{ "assembly": "Col-0" },
{ "assembly": "Ler" },
{ "assembly": "Cvi" },
{ "assembly": "Eri" },
{ "assembly": "Kyo" },
{ "assembly": "Sha" }
],
"tracks": ["syri"],
"encoding": {
"color": {
"field": "syri",
"scale": {
"domain": ["SYN", "INV", "TRANS", "INVTR", "DUP", "INVDP"]
}
},
"opacity": 0.9
},
"filter": [{ "field": "length", "gte": 10000 }],
"mark": { "interpolate": "bump" },
"render": { "antialias": false },
"collapseEmptyRows": true,
"levelHeights": [150, 150, 150, 150, 150]
}
]
}
}Replaces any defaultSession in config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse set-default-session --session - << 'EOF'
{
"name": "Six Arabidopsis accessions, SyRI regions",
"views": [
{
"type": "LinearSyntenyView",
"views": [
{ "assembly": "Col-0" },
{ "assembly": "Ler" },
{ "assembly": "Cvi" },
{ "assembly": "Eri" },
{ "assembly": "Kyo" },
{ "assembly": "Sha" }
],
"tracks": ["syri"],
"encoding": {
"color": {
"field": "syri",
"scale": {
"domain": ["SYN", "INV", "TRANS", "INVTR", "DUP", "INVDP"]
}
},
"opacity": 0.9
},
"filter": [{ "field": "length", "gte": 10000 }],
"mark": { "interpolate": "bump" },
"render": { "antialias": false },
"collapseEmptyRows": true,
"levelHeights": [150, 150, 150, 150, 150]
}
]
}
EOFOpen this session 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=test_data%2Fsyri%2Fconfig.json&session=json-%7B%22session%22%3A%7B%22name%22%3A%22Six+Arabidopsis+accessions%2C+SyRI+regions%22%2C%22views%22%3A%5B%7B%22type%22%3A%22LinearSyntenyView%22%2C%22views%22%3A%5B%7B%22assembly%22%3A%22Col-0%22%7D%2C%7B%22assembly%22%3A%22Ler%22%7D%2C%7B%22assembly%22%3A%22Cvi%22%7D%2C%7B%22assembly%22%3A%22Eri%22%7D%2C%7B%22assembly%22%3A%22Kyo%22%7D%2C%7B%22assembly%22%3A%22Sha%22%7D%5D%2C%22tracks%22%3A%5B%22syri%22%5D%2C%22encoding%22%3A%7B%22color%22%3A%7B%22field%22%3A%22syri%22%2C%22scale%22%3A%7B%22domain%22%3A%5B%22SYN%22%2C%22INV%22%2C%22TRANS%22%2C%22INVTR%22%2C%22DUP%22%2C%22INVDP%22%5D%7D%7D%2C%22opacity%22%3A0.9%7D%2C%22filter%22%3A%5B%7B%22field%22%3A%22length%22%2C%22gte%22%3A10000%7D%5D%2C%22mark%22%3A%7B%22interpolate%22%3A%22bump%22%7D%2C%22render%22%3A%7B%22antialias%22%3Afalse%7D%2C%22collapseEmptyRows%22%3Atrue%2C%22levelHeights%22%3A%5B150%2C150%2C150%2C150%2C150%5D%7D%5D%7D%7D&sessionName=JBrowse+docs+exampleEvery accession in Columbia coordinates
The --pair runs place every accession on Col-0. Open a linear genome view on
Col-0 at Chr4:1-6,000,000 and turn on SyRI regions on Col-0, by genome and
SyRI regions, which opens as lanes:
Goes at the top level of config.json, replacing any defaultSession there. See Default session.
{
"defaultSession": {
"name": "Six accessions in Col-0's coordinates",
"views": [
{
"type": "LinearGenomeView",
"assembly": "Col-0",
"loc": "Chr4:1-6,000,000",
"tracks": [
{
"trackId": "syri_regions_on_Col-0",
"type": "LinearMultiRowFeatureDisplay",
"height": 110
},
{
"trackId": "syri",
"type": "MultiWaySyntenyDisplay",
"height": 640
}
]
}
]
}
}Replaces any defaultSession in config.json in the current folder. See JBrowse CLI with Desktop.
jbrowse set-default-session --session - << 'EOF'
{
"name": "Six accessions in Col-0's coordinates",
"views": [
{
"type": "LinearGenomeView",
"assembly": "Col-0",
"loc": "Chr4:1-6,000,000",
"tracks": [
{
"trackId": "syri_regions_on_Col-0",
"type": "LinearMultiRowFeatureDisplay",
"height": 110
},
{
"trackId": "syri",
"type": "MultiWaySyntenyDisplay",
"height": 640
}
]
}
]
}
EOFOpen this session 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=test_data%2Fsyri%2Fconfig.json&session=json-%7B%22session%22%3A%7B%22name%22%3A%22Six+accessions+in+Col-0%27s+coordinates%22%2C%22views%22%3A%5B%7B%22type%22%3A%22LinearGenomeView%22%2C%22assembly%22%3A%22Col-0%22%2C%22loc%22%3A%22Chr4%3A1-6%2C000%2C000%22%2C%22tracks%22%3A%5B%7B%22trackId%22%3A%22syri_regions_on_Col-0%22%2C%22type%22%3A%22LinearMultiRowFeatureDisplay%22%2C%22height%22%3A110%7D%2C%7B%22trackId%22%3A%22syri%22%2C%22type%22%3A%22MultiWaySyntenyDisplay%22%2C%22height%22%3A640%7D%5D%7D%5D%7D%7D&sessionName=JBrowse+docs+exampleEach lane is placed by its run against Col-0, while the band between two lanes comes from the run between those two accessions.
Structural forms on the Arabidopsis pangenome page
The
Arabidopsis pangenome page
has SyRI regions for the 1001 Genomes Plus accessions on TAIR10. Type a gene or
region, and it maps the window with one row per structural form: a group of
accessions with the same alleles at every structural-variant site in the window,
called with minigraph --call.
- Open in JBrowse, under the map, opens the window with a row of SyRI regions per accession beneath the graph
- Every accession as SyRI lanes, under the page title, opens the same rows over the chromosome 4 inversion
The rows are the SyRI regions on TAIR10, one row per accession track of the hosted Arabidopsis pangenome config:
Reproduce it end to end
The script needs the tools under Prerequisites:
- Fetch the assemblies and keep the nuclear chromosomes, named
Chr1toChr5, since SyRI pairs chromosomes by name. - Align each accession to Col-0 and to the accession above it, and run SyRI on each alignment.
- Run syri2jbrowse on the SyRI outputs.
curl -fO https://raw.githubusercontent.com/GMOD/jbrowse-components/main/scripts/build_syri_synteny.sh
bash build_syri_synteny.shFor genomes of your own, pass a rows file after the output directory, one
<name> [accession] line per genome in stack order, the reference first. A
chromosome-level <name>.fa already in the output directory needs no accession.
bash build_syri_synteny.sh my_syri rows.txtSee also
- Tutorial: Synteny visualization (pairwise minimap2)
- Tutorial: Synteny visualization (all-vs-all minimap2)
- Tutorial: Synteny from an ortholog table (grape, peach, cacao)
- Tutorial: Synteny by ancestral linkage group (sponge, comb jelly, jellyfish)
- Tutorial: Comparing one genome's two haplotypes (T2T-HG002)
- Tutorial: A grammar of graphics over a BED (RepeatMasker Alu age)
Citations
- Goel et al. (2019). SyRI: finding genomic rearrangements and local sequence differences from whole-genome assemblies
- Goel and Schneeberger (2022). plotsr: visualizing structural similarities and rearrangements between multiple genomes
- Jiao and Schneeberger (2020). Chromosome-level assemblies of multiple Arabidopsis genomes reveal hotspots of rearrangements with altered evolutionary dynamics
- Zapata et al. (2016). Chromosome-level assembly of Arabidopsis thaliana Ler reveals the extent of translocation and inversion polymorphisms
- Fransz et al. (2000). Integrated cytogenetic map of chromosome arm 4S of A. thaliana: structural organization of heterochromatic knob and centromere region
Feedback on this tutorial is welcome: contact us.