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.8. Desktop beta builds are coming soon.
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. We find it again by aligning four assembled accessions, each to the one above it, and running SyRI, which sorts what an alignment contains into syntenic, inverted, translocated and duplicated regions. SyRI's table loads as a synteny track whose ribbons take their color from the type column, which is the picture plotsr draws, with every region open to zooming and clicking.
Prerequisites
minimap2andsamtools- SyRI (
syri), from bioconda, or Docker, which runs its biocontainers image - The NCBI
datasetsCLI, to fetch the assemblies python3- A running JBrowse instance (the web quickstart or the desktop quickstart)
Where the data comes from
TAIR10 for Columbia, and the chromosome-level assemblies of three more accessions from Jiao and Schneeberger 2020, the four plotsr's own figure stacks.
- Col-0, GCF_000001735.4: https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/001/735/GCF_000001735.4_TAIR10.1/
- Ler, GCA_902460285.1: https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/902/460/285/GCA_902460285.1_Arabidopsis_thaliana_Ler/
- Cvi-0, GCA_902460275.1: https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/902/460/275/GCA_902460275.1_Arabidopsis_thaliana_Cvi-0/
- Eri-1, GCA_902460315.1: https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/902/460/315/GCA_902460315.1_Arabidopsis_thaliana_Eri-1/
Aligning a pair and running SyRI
SyRI reads a whole-genome alignment of two chromosome-level assemblies whose
homologous chromosomes share a name. The script
keeps each assembly's five nuclear chromosomes and names them Chr1 to Chr5.
Each genome is then aligned to the one above it in the stack:
# asm5 is the preset for genomes of one species
# --eqx writes = and X in the CIGAR, which SyRI reads the mismatches from
minimap2 -ax asm5 --eqx Col-0.fa Ler.fa |
samtools sort -O BAM -o Col-0_Ler.bam -
# -F B says the alignment is BAM
# --nc runs that many chromosomes at once
syri -c Col-0_Ler.bam -r Col-0.fa -q Ler.fa -F B --prefix Col-0_Ler. --nc 5
Col-0_Ler.syri.out holds one row per annotation. The structural regions are
the rows with no parent: SYN, INV, TRANS, INVTR, DUP and INVDP, each
with its interval on both genomes.
SyRI's regions as a synteny track
A JBrowse ortholog table is a list of id pairs joined to one BED per genome, and
a SyRI region is an id with an interval on each genome, so the conversion is a
rename.
syri_to_blocks.py
writes each region to both BEDs under its SyRI id, the inverted types on the
minus strand of the query's, and one table row per region carrying its type,
that type's color in plotsr's palette and its length:
curl -fO https://raw.githubusercontent.com/GMOD/jbrowse-components/main/scripts/syri_to_blocks.py
python3 syri_to_blocks.py Col-0_Ler.syri.out --prefix Col-0_Ler
attributeColumns names the table's extra columns. type becomes a color-by
mode, and color is the palette the file puts beside each type:
{
"type": "SyntenyTrack",
"trackId": "syri_Col-0_Ler",
"name": "Col-0 vs Ler, SyRI regions",
"assemblyNames": ["Col-0", "Ler"],
"adapter": {
"type": "MCScanBlocksAdapter",
"uri": "Col-0_Ler.blocks",
"blockAssemblies": ["Col-0", "Ler"],
"bedLocations": [
{ "uri": "Col-0_Ler.Col-0.bed" },
{ "uri": "Col-0_Ler.Ler.bed" }
],
"attributeColumns": ["type", "color", "length"]
}
}
jbrowse add-track-json '{
"type": "SyntenyTrack",
"trackId": "syri_Col-0_Ler",
"name": "Col-0 vs Ler, SyRI regions",
"assemblyNames": ["Col-0", "Ler"],
"adapter": {
"type": "MCScanBlocksAdapter",
"uri": "Col-0_Ler.blocks",
"blockAssemblies": ["Col-0", "Ler"],
"bedLocations": [
{ "uri": "Col-0_Ler.Col-0.bed" },
{ "uri": "Col-0_Ler.Ler.bed" }
],
"attributeColumns": ["type", "color", "length"]
}
}'
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_Col-0_Ler",
"name": "Col-0 vs Ler, SyRI regions",
"assemblyNames": ["Col-0", "Ler"],
"adapter": {
"type": "MCScanBlocksAdapter",
"uri": "Col-0_Ler.blocks",
"blockAssemblies": ["Col-0", "Ler"],
"bedLocations": [
{ "uri": "Col-0_Ler.Col-0.bed" },
{ "uri": "Col-0_Ler.Ler.bed" }
],
"attributeColumns": ["type", "color", "length"]
}
}
Col-0_Ler.blocks, Col-0_Ler.Col-0.bed, Col-0_Ler.Ler.bed are relative to a config.json. Replace each with its URL or its path on this computer.
The ribbons need no sequence, so each accession is an assembly of its chromosome
lengths alone, a ChromSizesAdapter over the first two columns of its .fai.
Columbia against Landsberg on chromosome 4
Open the first 6 Mb of chromosome 4 in both accessions and pick type under Color by value on the palette button in the view header:
{
"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_Col-0_Ler"]],
"colorBy": { "field": "type" },
"drawCurves": true,
"alpha": 0.9,
"fadeThinAlignmentsMode": "off",
"collapseEmptyRows": true,
"levelHeights": [260]
}
]
}
}
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_Col-0_Ler"]],
"colorBy": { "field": "type" },
"drawCurves": true,
"alpha": 0.9,
"fadeThinAlignmentsMode": "off",
"collapseEmptyRows": true,
"levelHeights": [260]
}
]
}
EOF
The syntenic regions run straight down in grey, and one inverted region crosses over between them. The thin ribbons leaving the frame are duplications and translocations whose other end sits on another chromosome, which the label at the frame's edge names.
Four accessions
The same view stacks all four, each band drawing the SyRI run between the two genomes it joins:
{
"defaultSession": {
"name": "Four Arabidopsis accessions, SyRI regions",
"views": [
{
"type": "LinearSyntenyView",
"views": [
{ "assembly": "Col-0" },
{ "assembly": "Ler" },
{ "assembly": "Cvi" },
{ "assembly": "Eri" }
],
"tracks": [["syri_Col-0_Ler"], ["syri_Ler_Cvi"], ["syri_Cvi_Eri"]],
"colorBy": { "field": "type" },
"drawCurves": true,
"alpha": 0.9,
"fadeThinAlignmentsMode": "off",
"collapseEmptyRows": true,
"levelHeights": [180, 180, 180]
}
]
}
}
jbrowse set-default-session --session - << 'EOF'
{
"name": "Four Arabidopsis accessions, SyRI regions",
"views": [
{
"type": "LinearSyntenyView",
"views": [
{ "assembly": "Col-0" },
{ "assembly": "Ler" },
{ "assembly": "Cvi" },
{ "assembly": "Eri" }
],
"tracks": [["syri_Col-0_Ler"], ["syri_Ler_Cvi"], ["syri_Cvi_Eri"]],
"colorBy": { "field": "type" },
"drawCurves": true,
"alpha": 0.9,
"fadeThinAlignmentsMode": "off",
"collapseEmptyRows": true,
"levelHeights": [180, 180, 180]
}
]
}
EOF
Check it against syri.out
The largest inverted region of the Col-0 and Ler run, straight from SyRI's table:
awk -F'\t' '$11=="INV" {print $3-$2+1, $1, $2, $3}' Col-0_Ler.syri.out | sort -nr | head -1
It is 1,170,016 bp on Chr4, from 1,612,606 to 2,782,621, the interval the
crossed ribbon spans.
Reproduce it end to end
The script fetches the four assemblies, aligns each to the one above it, runs
SyRI on the three pairs, converts each table and writes the config; see
Prerequisites. Its ROWS list is one <name> <accession>
line per genome in stack order. For genomes of your own, put a chromosome-level
<name>.fa for each row into the output directory, homologous chromosomes
spelled alike, and the download step skips it.
curl -fO https://raw.githubusercontent.com/GMOD/jbrowse-components/main/scripts/build_syri_synteny.sh
bash build_syri_synteny.sh
See also
- Synteny visualization (pairwise minimap2)
- Synteny visualization (all-vs-all minimap2)
- Synteny by ancestral linkage group (sponge, comb jelly, jellyfish)
- Synteny from an ortholog table (grape, peach, cacao)
- Comparing one genome's two haplotypes (T2T-HG002)
References
- Goel M, Sun H, Jiao WB, Schneeberger K. SyRI: finding genomic rearrangements and local sequence differences from whole-genome assemblies. Genome Biol (2019). https://doi.org/10.1186/s13059-019-1911-0
- Goel M, Schneeberger K. plotsr: visualizing structural similarities and rearrangements between multiple genomes. Bioinformatics (2022). https://doi.org/10.1093/bioinformatics/btac196
- Jiao WB, Schneeberger K. Chromosome-level assemblies of multiple Arabidopsis genomes reveal hotspots of rearrangements with altered evolutionary dynamics. Nat Commun (2020). https://doi.org/10.1038/s41467-020-14779-y
- Zapata L, et al. Chromosome-level assembly of Arabidopsis thaliana Ler reveals the extent of translocation and inversion polymorphisms. PNAS (2016). https://doi.org/10.1073/pnas.1607532113
- Fransz PF, et al. Integrated cytogenetic map of chromosome arm 4S of A. thaliana: structural organization of heterochromatic knob and centromere region. Cell (2000). https://doi.org/10.1016/S0092-8674(00)80670-5
Feedback on this tutorial is welcome: contact us.